I've the following equation :
\begin{equation}\label{eq:5}
\frac{\partial s}{\partial b} = \frac{\partial \sum_{i=1}^{n} (y_i -(W\cdot x_i+b))^2}{\partial b}\\
=\sum_{i=1}^{n} 2(y_i -W\cdot x_i-b)\cdot(-1))
=2\cdot \sum_{i=1}^{n} (-y_i + a \cdot x_i + b ) \stackrel{!}{=} 0} \\
\Longleftrightarrow a\cdot (\sum_{i=1}^{n} x_i) + \sum_{i=1}^{n}b = \sum_{i=1}^{n} y_i
\Longleftrightarrow a\cdot (\sum_{i=1}^{n} x_i) + n \cdot b = \sum_{i=1}^{n}y_i
\end{equation}
and here how the result looks like :
I tough that using align would solve the issue here is what I've tried:
\begin{equation}\label{eq:5}
\begin{align}
\frac{\partial s}{\partial b} = \frac{\partial \sum_{i=1}^{n} (y_i -(W\cdot x_i+b))^2}{\partial b}\\
&=\sum_{i=1}^{n} 2(y_i -W\cdot x_i-b)\cdot(-1))
=2\cdot \sum_{i=1}^{n} (-y_i + a \cdot x_i + b ) \stackrel{!}{=} 0} \\
\Longleftrightarrow a\cdot (\sum_{i=1}^{n} x_i) + \sum_{i=1}^{n}b = \sum_{i=1}^{n} y_i
\Longleftrightarrow a\cdot (\sum_{i=1}^{n} x_i) + n \cdot b = \sum_{i=1}^{n}y_i
\end{align}
\end{equation}
There is now change in the result ! My question is how to align the equation despite starting a new line ?


&in each line. Equations will be aligned relative to the alignment character(s). – Huang_d Jun 07 '17 at 12:43alignenvironment inside anequationenvironment. Both will throw errors. – Torbjørn T. Jun 07 '17 at 12:54