When you start a display environment, be it
\begin{equation}
\begin{equation*}
\begin{align}
\begin{align*}
\begin{gather}
\begin{gather*}
and the other display environments, you are already in math mode, so a $
character is illegal.
Type $<formula>$
only for inline math formulas.
So
\begin{align}
\lim_{x \to 2} f(x) &= \lim_{x \to 2}\dfrac{2x^2-5x+2}{5x^2-7x-6} \\
&= \lim_{x \to 2}\dfrac{(x-2)(2x-1)}{(x-2)(5x+3)}
\end{align}
Don't add \\
to the last row of a display environment. It's optional in array
, but at the outer level in a display environment it would produce an unwanted blank line.
$
characters: you're already in math mode when you startalign
.