$$\lim _{x\rightarrow 5}\frac{x^2-25}{x-5} = \lim_{x\rightarrow 5} (x+5)$$

I understand that to evaluate a limit that has a zero ("hole") in the denominator we have to factor and cancel terms, and that the original limit is equal to the new and simplified limit. I understand how to do this procedurally, but I'd like to know why this works. I've only been told the methodology of expanding the $x^2-25$ into $(x-5)(x+5)$, but I don't just want to understand the methodology which my teacher tells me to "just memorize", I really want to know what's going on. I've read about factoring in abstract algebra, and about irreducible polynomials (just an example...), and I'd like to get a bigger picture of the abstract algebra in order to see why we factor the limit and why the simplified is equal to the original if it's missing the $(x-5)$, which has been cancelled. I don't want to just memorize things, I would really like to understand, but I've been told that this is "just how we do it" and that I should "practice to just memorize the procedure."
I really want to understand this in abstract algebra terms, please elaborate. Thank you very much.

  • 15,566
  • 8
  • 58
  • 114
Emi Matro
  • 4,583
  • 17
  • 45
  • 64
  • 94
    Very laudable that you want to understand instead of "just memorize". – Daniel Fischer Aug 07 '13 at 19:21
  • 8
    The expression $\frac{(x+5)(x-5)}{x-5}=x+5$, just so long as $x\neq 5$, since $\frac{(x+5)(x-5)}{x-5}$ has the bad fortune of not being defined at $x=5$. – Baby Dragon Aug 07 '13 at 19:29
  • 2
    I don't understand what your question is. Are you asking why the function $\frac{x^2-25}{x-5}$ is undefined at $x=5$? or why we're allowed to cancel $(x-5)$ from the top and bottom? or why the limits before and after cancellation are equal? – BlueRaja - Danny Pflughoeft Aug 07 '13 at 20:09
  • 1
    @BlueRaja-DannyPflughoeft yes, all of those questions I'm asking :) – Emi Matro Aug 07 '13 at 22:35
  • To answer the question - I've only been told the methodology of expanding the x2−25 into (x−5)(x+5). It goes like this: (in reverse) (x-5)(x+5) = x(x+5)-5(x+5) = x^2+5x-5x-25 = x^2-25 So, working above the other way takes x^2-25 back to (x-5)(x+5) – EtherDragon Aug 08 '13 at 22:52
  • Similar to:http://math.stackexchange.com/questions/1455579/why-do-fx-frac-x%C2%B2-1x-1-and-gx-x1-not-have-the-same-domain-o/1455583#comment2964553_1455583 – NoChance Sep 30 '15 at 23:43
  • Srongly related to http://math.stackexchange.com/questions/1525054/why-are-removable-discontinuities-even-discontinuities-at-all – 6005 Sep 26 '16 at 18:05

15 Answers15


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.

  • 205,374
  • 17
  • 121
  • 273
  • 2
    said hole can, of course be filled in by plugging it with the limit ... – Betty Mock Aug 13 '13 at 22:33
  • Some definitions of the limit do not require that we consider points that are not equal to $x_0$. How do you handle these cases then? The definition goes as $\lim f(x) = L$ provided for each $\epsilon\gt 0$ there is some $\delta \gt 0$ such that $\vert x - x_0\vert \lt \delta\ldots$ and so on. – Alex Ortiz Sep 09 '16 at 15:50
  • @AlexOrtiz The epsilon delta definition of the limit for general metric spaces has $0 < d(x,c) < \delta$. Note the first inequality, which implies $x \neq c$. – user76284 Nov 21 '20 at 00:19

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.

  • 69,412
  • 11
  • 108
  • 217
  • 5
    Extremely helpful answer as always, Blue. You're incredible at understanding what people are really asking and providing strong intuition. Thank you for your contribution to this site! – jeremy radcliff Jun 01 '15 at 15:55
  • 2
    @Blue Your answer made me think something: Can we always find another function which - away from a certain value - is completely identical to the former function? I mean, what is done in this example is the following: We have an algebraic expression and we can find another algebraic expression that have that property. – Red Banana Jul 06 '17 at 01:21
  • BTW: I read your image as the jingles in [this video](https://www.youtube.com/watch?v=xuCn8ux2gbs). – Red Banana Jul 06 '17 at 01:21
  • 1
    Super answer...the craziest I ever read in here – MattAllegro Jul 13 '19 at 22:17
  • @Blue: Shameless plug: A downloadable poster version of the "Journey/Destination" image is available at [my Etsy shop](https://etsy.com/listing/810313134), and a t-shirt is available from [Spring](https://inspired-by-math.creator-spring.com/listing/limits-journey). (I'll delete this comment if there are objections.) – Blue Oct 12 '21 at 10:00

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.

  • 62,206
  • 36
  • 276
  • 489

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.

Euro Micelli
  • 1,005
  • 6
  • 11

Here's the basic idea: You're given a rational function, $f\colon \Bbb R \setminus \{5\}\to \Bbb R$, which is continuous everywhere in its domain.

You want to find the limit of that function at $5$.

One way to do that is to construct a continuous extension of that function, $g\colon \Bbb R \to \Bbb R$, such that $g(x) = f(x)$ whenever $x$ is in the domain of $f$. Then $$\lim_{x\to 5}f(x) = \lim_{x\to 5} g(x) = g(5).$$

In this case, factoring and cancelling accomplishes that objective.

  • 8,689
  • 3
  • 31
  • 59
  • 2
    i really like this idea of a "continuous extension", what is the formal name of this rule/theorem? I'd like to read more about it. Thanks for the answer @dfeuer – Emi Matro Aug 08 '13 at 20:07
  • 1
    @user4150: Try this google search: ["removable discontinuity" "continuous extension"](http://www.google.com/search?q=%22removable+discontinuity%22+%22continuous+extension%22) – Dave L. Renfro Aug 08 '13 at 21:24
  • @dfeuer Typo? It should be $$\lim_{x\to 5}f(x) = \lim_{x\to 5} g(x) = g(\color{royalblue}5).$$ – Hakim Oct 01 '14 at 08:06
  • 1
    @Hakim, right you are. Fixed. – dfeuer Oct 01 '14 at 09:55

The chill pill you are looking for is

If $f_1$ = $f_2$ except at $a$ then $\lim _{x{\rightarrow}a}f_1(x)=\lim_{x{\rightarrow}a}f_{2}(x)$

  • 241
  • 1
  • 6

Intuitively, we can start the other way round, by simply considering $\lim_{x\rightarrow 5} (x+5)$ which we're all agreed we understand. Now consider, independently,


this is obviously 1 everywhere, except where it's undefined at $x = 5$. So, what would you expect to be the effect of multiplying the two? It's just multiplying by 1, except that it also introduces a hole at $x = 5$

  • 171
  • 2

To understand this more broadly, it is convenient to check L'Hôpital's rule, which basically boils down to this:

Given a function $f(x)=\frac{g(x)}{h(x)}$, where for some $x=x_0$ both $g(x_0)=0$ and $h(x_0)=0$, the actual value $f(x_0)$ can be obtained as*

$$\lim_{x\to x_0}f(x) = \lim_{x\to x_0}\frac{g'(x)}{h'(x)}$$

(where the prime denotes derivation by $x$) Note that if $g'(x_0)=0=h'(x_0)$, you can re-apply the same rule again and again until either numerator or denominator are not 0. In your example, we get

$$\lim_{x\to 5}\frac{x^2-25}{x-5} = \lim_{x\to 5}\frac{2x}{1}=10=\lim_{x\to5}\,(x+5)$$

To get an even deeper understanding, the rule's proof might be an interesting read.

*: This is only one case, you can also have $|g(x_0)|=|h(x_0)|=\infty$, but not $g(x_0)=0$ and $f(x_0)=\pm\infty$

Tobias Kienzler
  • 6,102
  • 36
  • 78
  • 6
    I don't think it's appropriate to bring up L'Hôpital in a question like this. To justify the rule, the reader needs to be familiar with derivatives, differentiability, the sandwich theorem and Cauchy's mean value theorem just to get started. The OP is asking for understanding, not higher-level magic hand-waving. L'Hôpital's rule is a great practical tool, but it's also wielded too often as a substitute for thinking. – Euro Micelli Aug 08 '13 at 11:53
  • 2
    @EuroMicelli Woah there, I didn't intend to hand-wave magically, I just wanted to provide a different answer that, if one is interested enough, can not only explain the removable singularities in polynomial fractions but also in more complicated cases. Though I agree one shouldn't blindly apply Hôpital to just anything if there is another maybe more elegant way – Tobias Kienzler Aug 08 '13 at 13:04
  • Also you don't obtain the $f(x_0)$ value - you get $f(x_0)$ value provided it is _defined_ and $f$ is _continous_. The OP function is not defined at $5$ but it's limit is. – Maciej Piechotka Aug 09 '13 at 07:05
  • @MaciejPiechotka True, stricly speaking the example function is equivalent to $$f(x) = \begin{cases} x+5 & x\neq 5 \\ \text{undefined} & x = 5\end{cases}$$ but the singularity at $x=5$ is removable as in $$f(x)= \begin{cases}\tfrac{x^2-25}{x-5} & x\neq 5 \\ 10 & x=5 \end{cases} \Rightarrow f(x) \equiv x+5$$ But you're right that one should always keep removed singularities in mind as they may have severe influence to e.g. applications in Physics (though I can't tell one ad hoc) – Tobias Kienzler Aug 09 '13 at 07:10

One of definitions of $\lim_{x \to A} f(x) = B$ is:

$$\forall_{\varepsilon > 0}\exists_{\delta > 0}\forall_{0 < \left|x - A\right| < \delta}\left|f(x) - B\right| < \varepsilon$$

The intuition is that we can achieve arbitrary 'precision' (put in bounds on y axis) provided we get close enough (so we get the bounds on x axis). However the definition does not say anything about the value at the point $f(A)$ which can be undefined or have arbitrary value.

One of method of proving the limit is to find the directly $\delta(\varepsilon)$. Hence we have following formula (well defined as $x\neq 5$):

$$\forall_{0 < \left|x - 5\right| < \delta}\left|\frac{x^2-25}{x-5} - 10\right| < \epsilon$$

As $x\neq 5$ (in such case $\left|x - 5\right| = 0$) we can factor the expression out

$$\forall_{0 < \left|x - 5\right| < \delta} \left|x + 5 - 10\right| < \varepsilon $$ $$\forall_{0 < \left|x - 5\right| < \delta} \left|x - 5 \right| < \varepsilon $$

Taking $\delta(\varepsilon) = \varepsilon$ we find that:

$$\forall_{\varepsilon > 0}\exists_{\delta > 0}\forall_{0 < \left|x - 5\right| < \delta}\left|\frac{x^2-25}{x-5} - 10\right| < \varepsilon$$

The key thing is that we don't care about value at the limit.


The hole doesn't always disappear but when it does it is because one expression is equivalent to another except right at that hole. For example $$\frac{x^2 - 25}{x - 5}= \frac{(x+5)(x-5)}{x-5}= (x + 5)$$ everywhere except at x = 5. However, if we are very close to 5 and we had infinite place arithmetic (as we do theoretically) the calculation of the first expression $\frac{x^2 - 25} {x - 5}$ would be very close to the last expression $(x+5)$, that is the limit as x approaches 5 of the first expression is the same limit as the limit as x approaches 5 of last expression. Since that latter is a 'nice number', we can define the value at 5 for the first expression and remove the "everywhere except at $x = 5$" by just putting 10 as the value and not calculating it.

  • 518
  • 4
  • 3

Look at this example:

$$ \lim _{\text{thing} \to zero}(\dfrac{\text{Thing}}{\text{Thing}}) \cdot \text{Another thing}$$

Here our $\text{'Thing'}$ is tending to zero, but not zero, it is something real, call it a real $\text{Thing}$, which can be cancelled merrily.

  • 7,800
  • 20
  • 37

The trick is to think of limit a bit differently: A limit is the value a function would have at a point were it continuous at that point, with nothing else being different.

You can see this by comparing the epsilon-delta definitions of the two concepts. We say $f$ is continuous at $c$, if $f$ is defined at $c$ and for every $\epsilon > 0$ there is a $\delta > 0$ such that

$|f(x) – f(c)| < \epsilon$ whenever $0 < |x – c| < \delta$.

Likewise, $f$ has limit $L$ at $c$ if for every $\epsilon > 0$ there is a $\delta > 0$ such that

$|f(x) – L| < \epsilon$ whenever $0 < |x – c| < \delta$.

Thus, if we have a function with isolated gaps and there is a different function $f^{*}$ such that

  1. $f^{*}(x) = f(x)$ wherever $f(x)$ is defined and continuous,
  2. $f^{*}$ is defined and continuous everywhere, i.e. has domain $\mathbb{R}$ (versus the original function having domain $\mathbb{R}$ minus a set of isolated points),

then we must have that the value this $f^{*}$ takes at the points where $f$ was not defined or continuous must be the limiting values at those points.

And that's what you find by cancellation: by rewriting the expression describing the function in a form that involves only addition and multiplication with no division, you have created a formula that describes a function that must agree where the division part is defined, but since no division is involved, is defined everywhere. Moreover, since addition and multiplication (and powers, though you can consider them repeated multiplication) are continuous, then it follows that this function must be continuous as well. Hence the above are met, and the holes fill in.

  • 17,776
  • 4
  • 43
  • 71

The idea is that if two functions $f$ and $g$ differ only at $a$ but are identical otherwise, we have $\displaystyle \lim_{x \to a} f(x) = \lim_{x \to a} g(x)$. In this case $f(x) = \dfrac {x^2-25}{x-5}$ and $g(x) = x+5$ are identical everywhere except $x=5$, so $\displaystyle \lim_{x \to 5} \dfrac {x^2-25}{x-5} = \lim_{x \to 5} x+5 = 10.$

  • 22,361
  • 11
  • 76
  • 151

In limits the value of x is always tending and not exact

x→a means the value of x tends to a. Similarly x→5 means tending to 5. So basically the value of x is not 5, but a little more or less than 5.

Hence you cannot take the denominator 0 in any case as the denominator will be, again, tending to zero. That is why we try to factorize the numerator first in order to check if there are any terms common both on the numerator and the denominator.


$$L:=\lim_{x\to x_0}f(x)$$ is the value that would make $f$ continuous at $x_0$.

If you known another function $g$ which is continuous and coincides with $f$ around $x_0$, then perforce