# L'Hopital's rule conditions

I have seen easy geometrical argument why L'Hopital's rule ($$\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}$$) works (local linearization). But, I still don't understand this:

1. why is rule defined just when limit is in form $$\frac{0}{0}$$ or $$\pm \frac{\infty}{\infty}$$?
2. Why must be $$f(a) = g(a) = 0$$ ?
3. why must be $$g'(a) \neq 0$$?

Counterexample for 1: $$\lim_{x \to 0} \frac{e^x}{x^2 + x + 1} = \frac{1}{1}$$ but is also $$\lim_{x \to 0} \frac{(e^x)'}{(x^2 + x + 1)'} = \lim_{x \to 0} \frac{e^x}{2x + 1} = \frac{1}{1}.$$ So, L'Hopital's rule works here but $$\frac{1}{1} \neq \frac{0}{0}$$!

Also, I read that there is another condition: 4. $$\frac{f'(x)}{g'(x)}$$ must exist

• does condition 3 implies this?
• can you give example when original limit exist but $$\frac{f'}{g'}$$ does not and how is this possible if functions $$f, g$$ are differentiable?
• Just a note on your "counterexample" for 1: it is not a counterexample, because this rule does not apply to that case (in general). Your example only shows that sometimes the limits may be the same, but this is not true in general – Manuel Norman Jul 7 at 22:10
• Yes, it is not counterexample in general. I am interested in why this condition exist, logic behind it. $\lim_{x \to 0} \frac{(e^x)'}{(2x + 1)'} = \lim{x \to 0}\frac{e^x}{2} = \frac{1}{2}$ (wrong result) – 1b3b Jul 7 at 22:12
• Is one of your questions why we can't use L'Hopital's Rule when, say, we have a limit of the form $\frac11$? If so, one seeming counterexample is $\lim_{x \to 1} \frac{x}{2-x} = \frac{1}{1} = 1$, but $\frac{(x)'}{(2-x)'} \to \frac{1}{-1} = -1$. – Brian Tung Jul 7 at 22:14
• As an example for 4: let $f(x)=x+\sin x$, $g(x)=3x$. The limit for $x \rightarrow \infty$ exists, but the limit of the quotient of derivative doesn't. – Manuel Norman Jul 7 at 22:20
• Thanks, all! This examples are very helpful. – 1b3b Jul 7 at 22:25

You can easily come up with counterexamples for applying L'Hôpital's rule when the limit is not of the form $$0/0$$ or $$\infty/\infty$$. For any $$a\in\mathbb{R}$$: $$\lim_{x\to a}\frac{x}{1+x}=\frac{a}{1+a}\neq1=\lim_{x\to1}\frac{1}{1}=\lim_{x\to1}\frac{(x)'}{(1+x)'}.$$ The limit is never of the form $$0/0$$ or $$\infty/\infty$$ and clearly L'Hôpital's rule does not work on this example. To see why the rule does work for limits of the $$0/0$$ or $$\infty/\infty$$ form, see any analysis textbook for a proof (for example, Rudin's Principles of Mathematical Analysis).

We don't strictly need $$g'(a)\neq0$$. For example: $$\lim_{x\to0}\frac{x^2}{x^2+x^3}=\lim_{x\to0}\frac{2x}{2x+3x^2}=\lim_{x\to0}\frac{2}{2+6x}=1,$$ where we applied L'Hôpital's rule twice, but the second limit still is of the form $$0/0$$.

The limit $$f'/g'$$ may fail to exist even when the conditions for L'Hôpital's rule are satisfied and the limit $$f/g$$ exists; the classic example is: $$\lim_{x\to\infty}\frac{x+\sin(x)}{x}=1,$$ but upon applying L'Hôpital's rule we obtain: $$\lim_{x\to\infty}1+\cos(x),$$ for which the limit does not exist.

• Suppose we have $f, g$ both differentiable on some interval $[a, b].$ We can approximate $f, g$ with lines (tangents) $t_f, t_g$ in interval $[a, a + dx]$ for small $dx > 0.$ If $f(a) \neq f(b)$ then intersection of $t_f, t_g$ is obviously not at the $x = a.$ WLOG suppose lines are not parallel; let $x_f \neq x_g$ be their intersection with $y$ axis. And notice that slope of a line is always constant so slopes of $t_f, t_g$ are $f'(a), g'(a).$ We have $\frac{f}{g}$. So If we divide numerator and denominator with same value it is impossible to have slopes or both $f, g$ because $x_f \neq x_g$. – 1b3b Jul 8 at 12:37
• That's why must be $f(a) = g(a).$ Another thing: we suppose that $g'(a) \neq 0$ because then $g$ would aproximatelly be (in the interval $a, a + dx$) just line $y = c, c \in \mathbb{R}$ so $\Delta{g} = 0$ and we would have $\frac{f}{0}$. – 1b3b Jul 8 at 12:44
• And yes only exceptions on rule "only when $\frac{0}{0}$ or $\frac{\infty}{\infty}$" are those where limit is in form $\frac{c}{c},$ $c \in \mathbb{R}, 0 \neq c \neq \pm \infty$ and slopes of $t_f, t_g$ are equal - then they intersect in some point $(x, c)$ and have same slopes - so they are equal and then of course $x_f = x_g$ and we can apply L'Hopital's rule. Also, I think that your last example is wrong because $\lim_{x \to 0} \sin{x} = 0 \neq \lim_{x \to 0} x^2 + 1 = 1$ so you can't apply L'Hopital's rule. – 1b3b Jul 9 at 22:19
• The geometric intuition is good. And yes you're certainly right about the last example, sorry for that. A better example would be $(x+\sin x)/x$, which has limit $1$ as $x\to\infty$, but upon applying L'Hôpital's rule you obtain $1+\cos(x)$, for which the limit does not exist. – csch2 Jul 10 at 0:53
• Thanks! I think that this and simillar topics requires deep geometric understanding. Of course, formal proof is necessary, but I like analogy of the path and understanding; geometry or intuition is the winding path before complete understanding. Then, formalism is just like saying: done! So, thank you again. – 1b3b Jul 10 at 9:44

1.: The rule can also be applied in the case of $$\frac{a}{\infty}$$ and even when the limit of $$f$$ does not exist (but the limit of $$g$$ is $$\infty$$); but it's rarely told. To see why does it fail otherwise, you need to look at the proof. The most general case, when $$g \to \infty$$ can be proven with the Mean Value theorem and Stolz-Cesaro theorem and the $$\frac{0}{0}$$ is a consequence of this case. The problem comes from the Stolz-Cesaro theorem: the theorem requires the denominator to diverge to infinity.

2.: As I pointed it out on 1., they don't need to be zero; just their limits need to be "critical", i.e. $$\frac{0}{0}$$ or $$\frac{\infty}{\infty}$$ or just $$g\to \infty$$.

3.: The proper requirement is $$g' \neq 0$$ around $$a$$. This is needed because the Mean Value Theorem would not be applicable in the proof otherwise.

4.: No, condition 3 does not imply that.

• (+1) for your mentioning that it is not necessary that $f\to\infty$. In fact, $\lim f$ need not even exist. So the limit you have of $f\to a$ can be relaxed. You might consider mentioning this. – Mark Viola Jul 7 at 22:17
• @MarkViola Yes, I missed it out. Thanks for pointing it out! – Botond Jul 7 at 22:17
• This version of L'Hopital's Rule (where it is not assume that $f(x) \to \infty$) is proved in baby Rudin. It is very surprising that not many students look at this theorem even though the book is so popular. – Kavi Rama Murthy Jul 7 at 23:32
• @KaviRamaMurthy: most students rarely look at exact hypotheses of various theorems and are interested only in conclusions – Paramanand Singh Jul 8 at 1:32
• @KaviRamaMurthy Considering that there is no need to apply L'Hospital rule in that case (the limit has to be 0), this doesn't surprise me at all. That the rule still works is a nice theoretical tidbit, but it is useless knowledge for the calculations the students are asked to perform in the corresponding exam. – mlk Jul 8 at 7:49