Why does factoring eliminate a hole in the limit?

First, and by definition, when dealing with

$$\lim_{x\to x_0}f(x)$$

we must assume $\,f\,$ is defined in some neighborhood of $\,x_0\,$ except , perhaps, on $\,x_0\,$ itself, and from here that in the process of taking the limit we have the right and the duty to assume $\,x\,$ approaches $\,x_0\,$ in any possible way but it is never equal to it.

Thus, and since in our case we always have $\,x\ne x_0=5\,$ during the limit process , we can algebraically cancel for the whole process.

$$\frac{x^2-25}{x-5}=\frac{(x+5)\color{red}{(x-5)}}{\color{red}{x-5}}=x+5\xrightarrow[x\to 5]{}10$$

The above process shows that the original function behaves exactly as the straight line $\,y=x+5\,$ except at the point $\,x=5\,$ , where there exists "a hole", as you mention.


This image of mine seems apropos:

Limits are about the journey ...

In the case of $\lim_{x\to 5} \frac{x^2-25}{x-5}$, the message here is: Away from $x=5$, the function $\frac{x^2-25}{x-5}$ is completely identical to $x+5$; thus, what we expect to find as we approach $x=5$ is the value $5+5$. This anticipated value is what a limit computes.

The fact that the original function isn't defined at $x=5$ is immaterial. Walley World may be closed for repairs when you arrive, but that doesn't mean you and your dysfunctional family didn't spend an entire cross-country road trip anticipating all the fun you'd have there.


Let's consider a simpler example first. Consider the function $f(x) = \frac{2x}x$. This says you take some number $x$, multiply by 2, then divide by the original number $x$. Obviously the answer is always 2, right? Except that when $x$ is zero, the division is forbidden and there is no answer at all. But for every $x$ except 0, we have $\frac{2x}x = 2$. In particular, for values of $x$ close to, but not equal to 0, we have $\frac{2x}x = 2$.

The function $\frac{x^2-25}{x-5}$ is similar, just a little more complicated. Calculating $x^2-25$ always gives you the same as $(x-5)(x+5)$. That is, if you take $x$, square it, and subtract 25, you always get the same number as if you take $x$, add 5 and subtract 5, and then multiply the two results. So we can replace $x^2-25$ with $(x+5)(x-5)$ because they always give the same number regardless of what you start with; they are two ways of getting to the same place. And then we see that $$\frac{x^2-25}{x-5} = \frac{(x+5)(x-5)}{x-5} = x+5$$

except that if $x-5$ happens to be zero (that is, if $x=5$) the division by zero is forbidden and we get nothing at all. But for any other $x$ the result of $\frac{x^2-25}{x-5}$ is always exactly equal to $x+5$. In particular, for values of $x$ close to, but not equal to 5, we have $\frac{x^2-25}{x-5} = x+5 $.

The limit $$\lim_{x\to 5} \ldots$$ asks what happens to some function when $x$ close to, but not exactly equal to 5. And while this function is undefined for $x=5$, because to calculate it you would have to divide by zero, it is perfectly well-behaved for other values of $x$, and in particular for values of $x$ close to 5. For values of $x$ close to 5 it is equal to $x+5$, and so for values of $x$ close to 5 it is close to 10. And that is exactly what the limit is calculating.


I think that what confuses you is the difference between "solving the algebraic expression", and "finding the limit". Given:

$$f_1=\frac{x^2-25}{x-5} \quad f_2 = (x+5)$$

Then, $f_1$ and $f_2$ are most definitely NOT the same function. This is because they have different domains: 5 is not a member of the domain of $f_1$, but it is in the domain of $f_2$.

However, when we go from: $$\lim _{x\rightarrow 5}\frac{x^2-25}{x-5} \quad to \quad \lim _{x\rightarrow 5}\frac{(x-5)(x+5)}{x-5} \quad to \quad \lim_{x\rightarrow 5} (x+5)$$

We are not saying that the expressions inside the limits are equal; maybe they are, maybe they are not. What we are saying that they have the same limit. Totally different statement.

Above, the transformation of the second expression to the third one allows us to find a different function for which a) we know that the limit is the same, and b) we know how to trivially calculate that limit.

The big question, then: what transformations can I make to the function $f_1$ so that the limit stays the same? I think this is usually poorly explained in introductory courses -- a lot of hand-waving going on.

Obviously you can do any algebraic manipulation that leaves $f_1$ unchanged. You can also make any manipulation that removes and/or introduces discontinuities (points for which the function does not exist), as long as the new function stays continuous for an arbitrarily small neighborhood around $a$ (except possibly at $a$ itself). Your example is a case of such a transformation.

Here I'm myself cheating because I'm not defining 'continuity' for you. I'm sorry; please use an intuitition of what continuous means ("no holes, no jumps"), until you are presented with a formal one.

More complex transformations exist, but they have to be justified individually. You'll get to them eventually.