A worked solution runs over several lines, and reads best when every equals sign sits under the one above. align* does exactly that, with the same & and \\ you used for matrices.
Lining up at the equals sign
Put the lines between \begin{align*} and \end{align*}. Put & just before each equals sign, and \\ at the end of every line but the last:
The & marks the point that lines up, so it can go before any sign: &\leq, &\approx, &\Rightarrow.
Carrying on a calculation
When a line carries on from the one above, leave the left side empty and start with &=:
Numbered equations
Without the star, align numbers every line, so you can refer to them later:
For one numbered equation there is equation. To give a line your own label, put \tag{...} at its end: E = mc^2 \tag{1}. In a full document, \label{...} on a line and \ref{...} in your text make LaTeX write the number for you:
\begin{equation}
E = mc^2 \label{eq:energy}
\end{equation}
By \eqref{eq:energy}, ...These environments come from the amsmath package, so a document that uses them needs \usepackage{amsmath} at the top. You will see a whole document in lesson 12.
Centred lines
gather* puts each line in the centre, without lining anything up. It suits a list of separate results:
Practise
&before each equals sign,\\at the end of each line but the last.\begin{align*} 2x + 3 &= 7 \\ 2x &= 4 \\ x &= 2 \end{align*}The second line starts with
&=.\begin{align*} (a+b)^2 &= (a+b)(a+b) \\ &= a^2 + 2ab + b^2 \end{align*}Two lines, both lined up at the equals sign.
\begin{align*} f(x) &= x^2 + 2x \\ f'(x) &= 2x + 2 \end{align*}The
&can go before any sign, here\leq.\begin{align*} |a + b| &\leq |a| + |b| \end{align*}\tag{1}at the end gives the label.E = mc^2 \tag{1}gather*centres each line; no&needed.\begin{gather*} x + y = 5 \\ x - y = 1 \end{gather*}
In short
align*lines equations up at the&;\\starts a new line.- A line that carries on starts with
&=. alignandequationnumber lines;\tag{...}sets your own label; they needamsmathin a document.
Next, in lesson 11: words inside maths, and spacing.