\begin{gather*}
\lim_{x \to 2} \frac{x^2-5x+6}{x-2}
\end{gather*}
The function
\(\frac{x^2-5x+6}{x-2}\) is undefined at
\(x = 2\text{,}\) because plugging in
\(x=2\) leads to dividing by 0. However, it turns out that we can algebraically manipulate it, by factoring the numerator,
\begin{align*}
\frac{x^2 - 5x + 6}{x - 2} \amp = \frac{(x - 3)(x - 2)}{x - 2}
\end{align*}
Then, cancelling the common factor of
\(x - 2\text{,}\)
\begin{align*}
\amp = x - 3
\end{align*}
Then, since there is no denominator anymore, it turns out we can just plug in
\(x=2\) to get the answer. In total,
\begin{align*}
\lim_{x \to 2} \frac{x^2-5x+6}{x-2} \amp = \lim_{x \to 2} \frac{(x - 3)(x - 2)}{x - 2}\\
\amp = \lim_{x \to 2} (x-3)\\
\amp = 2-3 = -1
\end{align*}
This works because the simplified version is equal to the original expression,
\begin{gather*}
\frac{x^2 - 5x + 6}{x - 2} = x - 3
\end{gather*}
They are the same everywhere, except for
\(x=2\) (because then the left-hand side gives an error for dividing by 0, but the right-hand side gives
\(2 - 3 = -1\)). Therefore, if you want to know what
\(\frac{x^2-5x+6}{x-3}\) is doing near
\(x=2\text{,}\) you can instead consider the simplified expression
\(x-3\text{.}\)
This is because a limit only cares about values of
\(x\) near \(x = 2\text{,}\) and doesn’t care about what happens exactly at
\(x=2\text{.}\) Thus, in terms of limits, the expressions are equal.