# When does L' Hopital's rule fail?

This thought jumped out of me during my calculus teaching seminar.

It is well known that the classical L'Hospital rule claims that for the $\frac{0}{0}$ indeterminate case, we have: $$\lim_{x\rightarrow A}\frac{f(x)}{g(x)}=\lim_{x\rightarrow A}\frac{f'(x)}{g'(x)}$$ where the later could take any value including $\infty$. Here we assume that right hand side limit exist.

However, to apply it one often has to take the derivative of $f'(x)$ again at $A$, and in principle one assumes by repeatedly applying this rule we can resolve the problem by plug in the value into the function's derivative at $A$. My question is, what if the student ask if it is possible for $\lim_{x\rightarrow A} f(x),\lim_{x\rightarrow A} f'(x)\cdots \lim^{n}_{x\rightarrow A}f^{n}(x)$ be all zero for any $n$, so the rule 'fails'. How should we answer the question properly?

For example, consider the well-known non-analytic smooth function: $$f(x)= \begin{cases} e^{-1/x}& x> 0\\ 0& x\le 0 \end{cases}$$ It is a trivial exercise to verify that $f^{n}(0)=0$ for any $n\in \mathbb{N}$. Now using L'Hospital rule we compute (as if we are a low level student) $$1=\lim_{x\rightarrow 0^{+}}\frac{f(x)}{f(x)}=\lim_{x\rightarrow 0^{+}}\frac{f'(x)}{f'(x)}=\lim_{x\rightarrow 0^{+}}\frac{f''(x)}{f''(x)}\cdots =\frac{0}{0}=?$$ as the chain does not stop if the student applies the rule faithfully and blindly. This is a silly example, but in general for non-analytical functions I think this kind of thing could happen. And there should be more non-analytical functions than analytical functions. Is there a way for us to resolve this at introductory calculus level, so that the student know what to do, without introducing confusing concepts' like $\epsilon-\delta$ language, Cauchy mean value theorem, Taylor series, and infinitesimals?

• Somewhat related: It's not just that the limit should be of type 0/0, there's also the additional assumption that $g'$ stays away from zero. If one forgets to include this, the "rule" may very well "fail". See Boas's article: maa.org/programs/faculty-and-departments/… – Hans Lundmark Aug 29 '14 at 6:38
• No, I am not considering this case. I think this can still be ruled out by first year calc students, and is also covered by the textbook. – Bombyx mori Aug 29 '14 at 6:44
• Related question on meta, specifically this answer and the comments. Not exactly the obvious L'Hôpital fail, but somewhat connected anyway. – Daniel R Aug 29 '14 at 17:48
• @DanielR: Thanks! This helpful. – Bombyx mori Aug 29 '14 at 17:56
• You never have to compute the derivative of the function at $A$. – Mariano Suárez-Álvarez Aug 29 '14 at 17:59

Even for analytical functions, this kind of thing can happen.

Consider $\displaystyle\lim_{x \to \infty}\dfrac{e^{x}-e^{-x}}{e^{x}+e^{-x}}$.

Blindly applying L'Hopital's Rule repeatedly gives: $\displaystyle\lim_{x \to \infty}\dfrac{e^{x}-e^{-x}}{e^{x}+e^{-x}} = \lim_{x \to \infty}\dfrac{e^{x}+e^{-x}}{e^{x}-e^{-x}} = \lim_{x \to \infty}\dfrac{e^{x}-e^{-x}}{e^{x}+e^{-x}} = \cdots$.

But if we divide the numerator and denominator by $e^x$ we get: $\displaystyle\lim_{x \to \infty}\dfrac{e^{x}-e^{-x}}{e^{x}+e^{-x}} = \lim_{x \to \infty}\dfrac{1-e^{-2x}}{1+e^{-2x}} = \dfrac{1+0}{1+0} = 1$.

Also, consider $\displaystyle\lim_{x \to 0^+}x \ln x = \lim_{x \to 0^+}\dfrac{\ln x}{1/x}$.

Blindly applying L'Hopital's Rule repeatedly gives: $\displaystyle\lim_{x \to 0^+}x \ln x = \lim_{x \to 0^+}\dfrac{\ln x}{1/x} = \lim_{x \to 0^+}\dfrac{1/x}{-1/x^2} = \lim_{x \to 0^+}\dfrac{-1/x^2}{2/x^3} = \lim_{x \to 0^+}\dfrac{2/x^3}{-6/x^4} = \cdots$.

But it we stop after applying L'Hopital's Rule once and simplify stuff, we get: $\displaystyle\lim_{x \to 0^+}x \ln x = \lim_{x \to 0^+}\dfrac{\ln x}{1/x} = \lim_{x \to 0^+}\dfrac{1/x}{-1/x^2} = \lim_{x \to 0^+} -x = 0$.

In both of these problems, the solution was to use basic algebra instead of just L'Hopital's Rule. The techniques taught in introductory calculus will not solve every limit problem in the world, but they will solve the problems encountered in introductory calculus. The important thing for students is to know many techniques and learn to figure out which ones will work for a given problem. Many students learn L'Hopital's Rule and then forget how to use every other tool. This is why after teaching L'Hopital's Rule, you should throw in a few examples where L'Hopital's Rule fails. This way, they think of L'Hopital's Rule as just another tool instead of magic.

• +1, good examples. I was trying to come up with such an example (and I utterly failed at it..). – Patrick Da Silva Aug 29 '14 at 2:50
• The first one is actually similar to the one I found, because changing coordinate $x=\frac{1}{y}$ would show the function are not analytic at $0$. But I did not thought about the second one. Nice example! – Bombyx mori Aug 29 '14 at 5:05
• This way, they think of L'Hopital's Rule as just another tool instead of magic`. Except that L'Hopital's is pretty much sorcery. Just sorcery that sometimes fails :) – Cruncher Aug 29 '14 at 13:11
• L'Hospital does not "fail" in this case. L'Hospital only states that if the one limit exist, the other limit exists as well. It does not say you can derive the limit in an easier way after applying it. – Adrian Feb 21 '16 at 17:22

A priori l'Hospital's rule is not meant to be a magic rule to solve limits ; you can write every limit in the universe as a ratio of two functions, and if these two functions happen to be infinitely-differentiable-non-analytic functions like yours, then applying l'Hospital's rule won't be much of use.

At the introductory calculus level, what is most important for students is not to learn all those rules by heart and throw them on paper (which is useful to get grades, but completely useless outside the classroom for most of them), but rather to use their brains and figure out a solution. I don't think that writing $$\lim_{x \to 0} \frac{e^{-\frac 1x}}{e^{-\frac 1{x^2}}}$$ by writing it as $e^{\frac 1{x^2} - \frac 1x}$... okay I had a comment about this but it kind of went wrong when I found the trick.

And yes, there will always be issues with such functions ; it could be a good exercise to come up with functions whose limit might exist but be hard to compute.

Hope that helps,

• I guess this does not really answer my question, but I see your point. Is there any resolution of this problem in literature?(I have never seen this appear in any analysis textbook) – Bombyx mori Aug 29 '14 at 2:33
• @Bombyx mori : What do you want? A general way of attacking limits of ratios of functions in a wide class of functions (non-trivial smooth functions with taylor expansion equal to zero)? I mean, I can't even begin to imagine how many examples I could pull off out of my hat, and the exponential ones above are just the first one that came out. My point was to try to say that you shouldn't expect anything magical enough to satisfy a calculus student, even though the question is very legitimate on its own. – Patrick Da Silva Aug 29 '14 at 2:48
• Of course I can say "in this case you cannot continue", etc. But this would not be satisfactory to the student. – Bombyx mori Aug 29 '14 at 2:55
• I feel in current US culture, a suggestion like "using your brains" seems not so polite to the student.... – Bombyx mori Aug 29 '14 at 17:51
• @Bombyxmori : I'm not talking to a student, am I? :) You have much more polite ways of saying this, such as "Try a different approach, you can do it!" or "Have you tried to =*insert different approach here*=?". I was tired, I agree I was probably way too rude to write an answer on MSE... – Patrick Da Silva Aug 29 '14 at 20:47