# Are there any situations in which L'Hopital's Rule WILL NOT work?

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.

• Of course. Whenever the conditions for using it are not satisfied. – Joel Reyes Noche Nov 10 '15 at 0:30
• 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: math.stackexchange.com/a/912694/275005 – superckl Nov 10 '15 at 0:31
• You should ask a specific question, with specific functions and conditions. Otherwise we go 'round and 'round on this. – zhw. Nov 10 '15 at 0:34
• @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 6:24
• Try using it for the limit of $f(x)={\sqrt{1+x^2}\over x}$ at $x=0$. – David Mitra Nov 10 '15 at 9:47

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.

• 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
• 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
• 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$.

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.

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$).

Then

$\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.

# Example

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.

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.

• Such a nice example; needs more upvotes! – user21820 Nov 11 '15 at 16:14

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.

• but the conditions for L'Hopitals' rule are not met. How does this answer OP's question? – Ittay Weiss Nov 10 '15 at 0: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 0: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 0: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 0:39
• This is the answer that Joel's comment to OP should have been. – user1717828 Nov 10 '15 at 9: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.

• $f$ and $g$ must be differentiable. $|x|$ is not. – Ben Longo Nov 10 '15 at 0: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 0:30
• 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 0:31
• I guess then a response could elaborate on what the assumptions are. – Ben Longo Nov 10 '15 at 0:32
• That is $\lim_{x \rightarrow c} \frac{f'(x)}{g'(x)}$ @BrevanEllefsen – randomgirl Nov 10 '15 at 0:35

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.

• 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.

• $\lim_{x\to 0}\frac{\sin x}{x}$ can be shown to be equal to 1 without using L'Hôpital's rule. – Joel Reyes Noche Nov 10 '15 at 12:53