Aligning Multi-line Equations

It often makes reading equations a lot easier when breaking them up across lines:

Aligning with line numbering

Aligned equation with a number on each line: The equation is aligned at the & character. This feels quite like a tabular environment.

\begin{align}
(a + b)^2 &= a^2 + 2ab + b^2 \\\
&= b^2 + 2ba + a^2 \\\
&= (b + a)^2 \\\
\end{align}


Aligning with single line number

Aligned equation with a single number:


\begin{split}
(a + b)^2 &= a^2 + 2ab + b^2 \\\
&= b^2 + 2ba + a^2 \\\
&= (b + a)^2 \\\
\end{split}