I'm having trouble understanding what really happens when we evaluate the limit of a certain function f(x) as x approaches a certain value.
For ex, if we have lim x-->2 $\frac{x^2 + x -6}{(x-2)}$ we can't just plug in 2 and evaluate that because f(x) is undefined when x=2. So we factor out the numerator and find that lim x-->2 $\frac{x^2 + x -6}{(x-2)} = \frac{(x+3)(x-2)}{(x-2)}$
Here is where there seems to be an inconsistency as far as I understand what's going on. We are ok with canceling out the (x+2) terms because we're not saying that x=2, we're saying x approaches 2, so (x-2) in the denominator =/= 0 and we can simplify.
However, then it seems we just plug 2 into (x+3) and say that lim x-->2 $\frac{x^2 + x -6}{(x-2)} = 5$.
That's very confusing to me because we go from not being ok with plugging in the value 2, instead imagining that we're getting closer and closer to it from both ends, to just plugging in 2 and saying (2+3) = 5.
I understand that there's no more problem with using 2 once we got rid of (x-2) in the denominator, but what happened to just approaching x?