Mathematics
The great power of LaTeX lies in it's ability to easily render mathematics. There are two types of mathematics. Inline and display.
Cheat Sheet
Inline Mathematics
Inline mathematics form part of a sentence and start and end with a single $. Eg.
To differentiate $x^n$ we multiply by the power and decrease it by 1 to get $nx^{n-1}$.

Display Mathematics
Display mathematics has it's own line and starts and end with a double $$. You can choose to make your code neater by putting in on it's own line but this is not required. Eg.
To differentiate $x^n$ we multiple by the power and decrease it by 1 to get \[nx^{n-1}\].

Aligned Mathematics
Sometimes we want to align the equals sign on multiple mathematical steps. To do this we need to use the amsmath package by including the line
\usepackage{amsmath}
at the top of our document.
We can then use the align environment with a & sign before the symbol we want aligned to and \\ to signify the end of a line. For example:
\begin{align}
(x+2)(x-2) &= x^2 + 2x - 2x -4 \\
&= x^2 -4
\end{align}

If we don't want our equations to be numbers, we can use the align* environment:
\begin{align*}
(x+2)(x-2) &= x^2 + 2x - 2x -4 \\
&= x^2 -4
\end{align*}

Symbols
Powers
Roots
Fractions
Inequalities
The basic less than / more than inequalities are just represented by < and >. We can use \leq for less than or equal to and \geq for greater than or equal to
\begin{align*}
3 &> 2 \\
2 &< 3 \\
x &\leq 2 \\
x &\geq 2
\end{align*}

Limits
Sums
Calculus
Sets
Last updated
Was this helpful?