Today was my first day learning L'Hopital's Rule, and I was wondering if there are any situations in which you cannot use this rule, with the exception of when a limit is determinable.

  • 3,377
  • 1
  • 17
  • 30
  • 423
  • 2
  • 5
  • 15
  • 69
    Of course. Whenever the conditions for using it are not satisfied. – Joel Reyes Noche Nov 10 '15 at 00:30
  • 3
    If you have an indeterminate form in one variable, with differentiable numerator and denominator, to my knowledge you can always use L'Hopital's rule. It is a $\textit{rule}$ after all. However, there are cases when it is not useful. For instance, see the functions given in this answer to a related question: http://math.stackexchange.com/a/912694/275005 – superckl Nov 10 '15 at 00:31
  • 3
    You should ask a specific question, with specific functions and conditions. Otherwise we go 'round and 'round on this. – zhw. Nov 10 '15 at 00:34
  • 3
    @JoelReyesNoche Only if said conditions are both sufficient and necessary! Strictly speaking a rule may still work outside of its prescribed conditions either because they are not strict enough, or just by sheer luck. :) – Thomas Nov 10 '15 at 06:24
  • @Thomas, you are correct. – Joel Reyes Noche Nov 10 '15 at 09:26
  • 6
    Try using it for the limit of $f(x)={\sqrt{1+x^2}\over x}$ at $x=0$. – David Mitra Nov 10 '15 at 09:47
  • 2
    @Thomas: I would prefer to say that the rule can NEVER be used when the conditions for using it are not satisfied, even though the conclusion of the theorem may sometimes still hold (by 'luck' if you will). – Michael Joyce Nov 10 '15 at 18:52
  • Closely related: [Are there any limit questions which are easier to solve using methods other than l'Hopital's Rule?](http://math.stackexchange.com/q/1534296/72968) – Silverfish Nov 18 '15 at 21:16
  • Related: https://math.stackexchange.com/questions/1286699/whats-wrong-with-lhopitals-rule/1286727#1286727 – Watson Nov 29 '18 at 16:27

9 Answers9


Consider the function $f(x)=e^{-\frac{1}{x^2}}$, for all $x\ne 0\in \mathbb R$, and $f(0)=0$ (or take any other function with the property that all derivatives at $0$ vanish, but the function is not locally constant at $0$). Now suppose you are asked to compute $\lim_{x\to 0}\frac{f(x)}{f(x)}$. Of course, this limit is $1$ by simply working out the fraction first, and then taking the limit. But if you try to use L'Hopitals' rule you find that the conditions are met, but $\lim_{x\to 0}\frac{f'(x)}{f'(x)}$ is still of indeterminate form. Again L'Hopitals is applicable, and again $\lim_{x\to 0}\frac{f''(x)}{f''(x)}$ is indeterminate. This will go on forever. So even though the limit can be determined, and even though the conditions for L'Hopitals rule are repeatedly met, you will never get the result this way.

Ittay Weiss
  • 76,165
  • 7
  • 131
  • 224
  • 3
    Thank you for answering this, the way you worded everything clicked very well with me. – ErinAjello Nov 10 '15 at 15:39
  • you are very welcome @ErinAjello – Ittay Weiss Nov 10 '15 at 20:16
  • 6
    If you ignore intermediate siplifications, you could just as well work with $\lim_{x\to0}\frac{x^{-1}}{x^{-1}}$ which is of the indeterminate form $\frac\infty\infty$, and will stay in that form after differntiation ($\frac{-x^{-2}}{-x^{-2}}$, $\frac{2x^{-3}}{2x^{-3}}$ and so on) – Hagen von Eitzen Nov 11 '15 at 14:59
  • 1
    You are absolutely right @HagenvonEitzen Somehow I was trying to guess what OP had in mind, and came up with that. – Ittay Weiss Nov 11 '15 at 20:41

L'Hopital's rule fails if $$\lim_{x\to x_0} \frac f g \text{ exists but} \lim_{x\to x_0}\frac {f'}{g'} \text{doesn't}$$

e.g. $$\lim_{x\to \infty} \frac {x+\sin x}x.$$

I wonder if we could extend generalization of Stolz–Cesàro theorem to continuous case - i.e. if $$\liminf \frac {f'}{g'}\le \liminf \frac f g\le \limsup \frac f g\le \limsup \frac {f'}{g'}$$ for $x\to \infty$ in all limits and $\lim f=\lim g=\infty$.

  • 3,955
  • 1
  • 9
  • 22

Our first step to better understand when L'Hospital's Rule is applicable, is to consider its formal statement. It is a theorem, therefore it is always correct; we just have to make sure that all needed assumptions/hypotheses do hold for the limit we are trying to evaluate. Let's take a look!

Theorem (L'Hospital's Rule for right-hand limits):

Let $f$, $g$ be functions:

Condition 1. That are differentiable on the interval $(a,b)$, where we allow the possibility $a = -\infty$ and/or $b = +\infty$

Condition 2. Such that the derivative of $g$ is never zero on that interval

Condition 3. Satisfying $\text{ }\text{ }\lim_{x \to a^+} f(x) = \lim_{x \to a^+} g(x) = 0\text{ }\text{ }$ or $\text{ }\text{ }\lim_{x \to a^+} g(x) = \pm \infty $

Condition 4. Satisfying $\text{ }\text{ }\lim_{x \to a^+} \dfrac{f'(x)}{g'(x)} = L\text{ }\text{ }$ (where we allow the possibility that $L$ is a real number, $+\infty$ or $-\infty$).


$\text{ }\text{ }\lim_{x \to a^+} \dfrac{f(x)}{g(x)} = L\text{ }\text{ }$

For left-hand limits, replace all $x \to a^+$ occurences with $x \to b^-$.

For "normal" limits, just check that both parts of L'Hospital theorems apply and the left-hand limit found is equal to the right-hand limit found. This is correct because we know that a limit exists if and only if the lateral limits exist and are equal.

Seeing the formal statement of L'Hospital's theorem is very useful in understanding when it can be applied. Let's look again and make some remarks:

Remark 1. Make sure your function is differentiable on that interval $(a, b)$. If you are taking $x \to a^+$, for example, remember that you are free to choose $b$. You can choose $b$ as close to $a$ as you want to. The only problem here would be if your function is so weird that no matter how close you get to $a$, it is still not differentiable in that little interval.

Remark 2. After you found that interval $(a, b)$, make sure $g'$ is never zero inside that interval. Again, remember, if your interval didn't work, don't give up just yet, try to see if there is a smaller interval that fits your needs.

Remark 3. You can only apply if you've got $\frac{0}{0}$ or the denominator goes to infinity.

Remark 4. The last condition says that you must be able to compute $\text{ }\text{ }\lim_{x \to a^+} \dfrac{f'(x)}{g'(x)}\text{ }\text{ }$ somehow, maybe with another application of L'Hospital Rule.


Let's consider you want to apply L'Hospital's Rule to compute $$\lim_{x \to 0} \dfrac{x}{\sin( x)}$$

Let's check the four conditions.

Condition 1. If we choose $a = 0$ and $b = 2\pi$, both $f$ and $g$ are differentiable in $(0,2\pi)$, so it is fine.

Condition 2. Unfortunately, the derivative of $g$ is zero for $p = \frac{\pi}{2}$, and this would violate Condition 2. Fortunately, we can avoid this problem by choosing a smaller interval, $a = 0$ and $b = \frac{\pi}{4}$, for example. Now, both functions are differentiable in the interval and the derivative of $g$ is never zero.

Condition 3. We have the first option, because $\text{ }\text{ }\lim_{x \to 0^+} f(x) = \lim_{x \to 0^+} g(x) = 0\text{ }\text{ }$

Condition 4. We have $\text{ }\text{ }\lim_{x \to 0^+} \dfrac{f'(x)}{g'(x)} = \lim_{x \to 0^+} \dfrac{1}{\cos(x)} = L\text{ }\text{ }$ where $L = 1 \in \mathbb{R}$

Therefore, all conditions are met and we conclude that

$$\text{ }\text{ }\lim_{x \to 0^+} \dfrac{x}{\sin(x)} = 1\text{ }\text{ }$$

Examples that won't work

Let's look at examples that break the conditions given. We are getting close to answer your question.

For condition 1. Take $f$ as the Triangle Wave Function, and you want to calculate the limit when $x \to \infty$. The problem here is that you can't choose any $a \in \mathbb{R}$ such that $f$ is differentiable in $(a,\infty)$, because there will always be a peak of the triangle wave inside that interval, and the function is not differentiable in that peak.

For condition 2. Take $g(x) = \sin(\frac{1}{x})$, and you want to calculate the limit when $x \to 0$. The problem here is that you can't choose any $b > 0$ such that $g'$ is never zero in $(0,b)$, because there will always be an infinite amount of sine peaks in any interval $(0,b)$ (look at a graph of $\sin(\frac{1}{x})$).

For condition 3. I challenge you to think of this example, shouldn't be too hard.

For condition 4. Steven Gubkin gave this example in his answer: consider $f(x) = x+\sin(x)$ and $g(x) = x$. The limit of $\frac{x + \sin(x)}{x}$ does exist when $x \to \infty$, but $\lim_{x \to \infty} \frac{1+\cos(x)}{1}$ does not exist.

TL;DR & Final Words

  • L'Hospital's Rule is a math theorem, therefore it is always correct. You just have to check if all hypothesis were satisfied. In the beginning of this answer, the four conditions for the Theorem to hold are given.

  • Pay attention to what the theorem actually says: given the needed hypotheses, if the limit of $\dfrac{f'(x)}{g'(x)}$ exists, then the limit of $\dfrac{f(x)}{g(x)}$ also exists and those limits are equal.

  • There are situations in which the theorem is applicable, and correct (of course), but useless, if the new limit is as hard (or even harder) to be calculated than the first one. Alex Zorn gave an excellent example of this in his answer:

$$\lim_{x \rightarrow 0}\frac{e^{-\frac{1}{x^2}}}{x}$$

L'Hopital's Theorem is applicable in this case, and is correct, but not useful because the new limit is as hard as the first one, and you didn't make any progress.

Just one last thing (fun fact). In your question, you said

Today was my first day learning L'Hopital's Rule, and I was wondering if there are any situations in which you cannot use this rule, with the exception of when a limit is determinable.

An interesting catch is that the exception you mentioned isn't really an exception. If the limit is easily determinable, but still falls into the theorem's conditions, the theorem is still correct, for example:

$$\lim_{x \to \infty}\frac{1}{x}$$

The functions $f(x) = 1$ and $g(x) = x$ fit all four conditions in any interval $(a, \infty)$, for any $a > 0$, therefore you can apply L'Hospital's Rule to it, and get

$$\lim_{x \to \infty}\frac{1}{x} = \lim_{x \to \infty}\frac{0}{1} = 0$$

By the way, this kind of analysis is made in courses of Real Analysis, in case you are interested in learning more, I strongly recommend you take such course.

Pedro A
  • 2,718
  • 1
  • 15
  • 36

In a more subtle way, one often forgets the hypotheses: there must exist a neighbourhood $V$ of $a$ such that on $V\smallsetminus\{a\}$, neither $g(x)$ nor $g'(x)$ vanish.

Using Taylor's polynomial is much more secure. Or better, when possible, using equivalents of the numerator and denominator is more elegant.

Ali Caglayan
  • 5,546
  • 9
  • 40
  • 72
  • 1
  • 9
  • 62
  • 162

Here is an example of why you should be careful:

$ \begin{align*} \lim_{x \to \infty} \frac{x+\sin(x)}{x} &= \lim_{x \to \infty} \frac{\frac{d}{d x}(x+\sin(x))}{\frac{d}{dx}(x)}\\ &= \lim_{x \to \infty} \frac{1+\cos(x)}{1}\\ \end{align*} $

This last limit does not exist, so you might conclude that the original limit does not either.

In fact,

$ \begin{align*} \lim_{x \to \infty} \frac{x+\sin(x)}{x} &= \lim_{x \to \infty} 1+ \frac{\sin(x)}{x}\\ &= 1 \end{align*} $

since you can use the squeeze theorem to prove $\lim_{x \to \infty} \frac{\sin(x)}{x} = 0$.

What happened?

One of the hypotheses of l'Hopital's rule is that $\lim \frac{f'}{g'}$ exists.

Steven Gubkin
  • 7,856
  • 22
  • 46

There are a couple assumptions we must make. First,either $\lim_{x \to c} f(x) = \lim_{x \to c} g(x) = 0$ or $\lim_{x \to c} |f(x)| = \lim_{x \to c} |g(x)| = \pm \infty$ and $\lim_{x \to c} \frac{f'(x)}{g'(x)}$ must exist When this isn't true, we get this $$\lim_{x \to 5} \frac{x}{x-5}$$ Graphing this, we find the answer is undefined, approaching $\pm \infty$. However, naively using L'Hopital we get $$\lim_{x \to 5} \frac{1}{1} = 1$$ Which is clearly false. You have to make sure you follow these assumptions. If you do, there are no exceptions.

Brevan Ellefsen
  • 13,643
  • 4
  • 23
  • 63
  • 4
    but the conditions for L'Hopitals' rule are not met. How does this answer OP's question? – Ittay Weiss Nov 10 '15 at 00:27
  • @IttayWeiss edited my answer to clear up what I was trying to say. I was making a ridiculous case to show why assumptions are necessary for a theorem. – Brevan Ellefsen Nov 10 '15 at 00:35
  • I do not think OP was asking about the assumptions, but rather if the assumptions are met is it guaranteed using L'Hopitals will be successful. The answer is negative, but not because sometimes the conditions are not met. – Ittay Weiss Nov 10 '15 at 00:38
  • @IttayWeiss I agree, and I upvoted your answer accordingly. I still provide my answer as a warning though.... naive students forget the assumptions quite often – Brevan Ellefsen Nov 10 '15 at 00:39
  • This is the answer that Joel's comment to OP should have been. – user1717828 Nov 10 '15 at 09:26

What about $f(x) = x$, $g(x)=|x|$ and you're interested in $\lim_{x\rightarrow0} \frac{f(x)}{g(x)}$?

Both $f(x)$ and $g(x)$ go to 0 when $x$ goes to 0, but you cannot use L'Hôpital because $\lim_{x\rightarrow 0} \frac1{g'(x)}$ does not exist.

  • 1,053
  • 9
  • 24
  • 2
    $f$ and $g$ must be differentiable. $|x|$ is not. – Ben Longo Nov 10 '15 at 00:30
  • @Ben Of course L'Hopital will work when its assumptions hold, that's the point, it's a theorem. The only reasonable answer to this question is to present a situation where the assumptions don't hold. It can't be a situation where you can just get the limit by substitution, by the restriction of the OP, so this seems like a good example to me. – Ian Nov 10 '15 at 00:30
  • 1
    technically, this doesn't break the rule, as it is required that $\lim_{x \to c} \frac{f'(c)}{g'(c)}$ exists – Brevan Ellefsen Nov 10 '15 at 00:31
  • I guess then a response could elaborate on what the assumptions are. – Ben Longo Nov 10 '15 at 00:32
  • That is $\lim_{x \rightarrow c} \frac{f'(x)}{g'(x)} $ @BrevanEllefsen – randomgirl Nov 10 '15 at 00:35
  • @randomgirl good catch – Brevan Ellefsen Nov 10 '15 at 00:36
  • So yeah the only problem I see here is you keep cycling through the same limits if you keep applying l'hospital.. Like you get... $\lim_{x \rightarrow 0} \frac{|x|}{x}=\lim_{ x \rightarrow 0} \frac{x}{|x|}$ – randomgirl Nov 10 '15 at 00:37
  • @BenLongo Differentiability at the point where the limit is computed is of course not required: the function need not even be defined there! This is a perfectly good example; a similar one is $f(x)=\frac{x}{\sqrt{x^2+1}}$ – egreg Nov 10 '15 at 18:12

Here's a similar example to Ittay Weiss's, but more nefarious, since in Ittay's example the limit was easily seen to be equal to 1:

$$\lim_{x \rightarrow 0}\frac{e^{-\frac{1}{x^2}}}{x}$$

Both the numerator and denominator go to zero. But applying l'Hospital gives:

$$\lim_{x \rightarrow 0}\frac{2e^{-\frac{1}{x^2}}}{x^3}$$

And applying l'Hospital again:

$$\lim_{x \rightarrow 0}\frac{4e^{-\frac{1}{x^2}}}{3x^5}$$

We see that the situation is getting worse, not better!

The way out is to forget about l'Hospital entirely, and try to replace $e^{-1/x^2}$ with something more manageable. We have, for all $x$:

$$e^x \geq x$$

And so for all $x > 0$:

$$e^{-x} \leq \frac{1}{x}$$

Hence, for all $x \neq 0$:

$$e^{-\frac{1}{x^2}} \leq x^2$$

This implies:

$$0 \leq \frac{e^{-\frac{1}{x^2}}}{x} \leq \frac{x^2}{x} = x \qquad (x > 0)$$ $$x = \frac{x^2}{x} \leq \frac{e^{-\frac{1}{x^2}}}{x} \leq 0 \qquad (x < 0)$$

And the squeeze theorem tells us that the original limit is zero.

Alex Zorn
  • 4,096
  • 10
  • 10
  • 1
    This limit can be transformed so that l'Hopital is applicable: $\frac{1/x}{e^{1/x^2}}$. Differentiating both gives $\frac{-1/x^2}{-2/x^3\cdot e^{1/x^2}}$ which is now easily seen to have limit $0$. – Wojowu Nov 10 '15 at 19:48

There are situations where all conditions are met, but the usage of L'Hôpital leads to circular reasoning. For example,

$$\lim_{x \to 0}\frac{\sin x}x = \{\text{L'Hôpital}\}=\lim_{x \to 0}\frac{\cos x}1=\cos 0=1$$

Here, you have used the fact that $\frac d{dx}\sin x = \cos x$, which is proven by using $\lim_{x \to 0}\frac{\sin x}x$, which can be found is $1$ by use of L'Hôpital, which uses the fact that $\frac d{dx}\sin x = \cos x$, which...

More information can be found in the not so meta-ish, but still excellent, meta.math thread on the subject here.

Daniel R
  • 3,133
  • 3
  • 24
  • 39