26.4 L’Hôpital’s Rule
AHL 5.13
- the indeterminate forms \(\frac{0}{0}\), \(\frac{\infty}{\infty}\) and \(0 \times \infty\)
- l’Hôpital’s rule for limits of the form \(\frac{0}{0}\) and \(\frac{\infty}{\infty}\), including repeated use
- how to change a \(0 \times \infty\) limit into a quotient
- when the rule cannot be used
Indeterminate forms
In the earlier sections we used limits to study holes, asymptotes and the behaviour of a graph for large \(|x|\). Sometimes it is not clear whether a limit exists, or how to find it. Two examples:
- \(f(x) = \dfrac{\sin x}{x}\) is not defined at \(x = 0\). In \(\displaystyle\lim_{x \to 0} \frac{\sin x}{x}\), the top \(\to 0\) and the bottom \(\to 0\). This is a limit of the form \(\frac{0}{0}\). (We know from Section 26.2 that the answer is \(1\).)
- \(f(x) = x^3\mathrm{e}^{-x}\) as \(x \to \infty\): \(x^3 \to \infty\) but \(\mathrm{e}^{-x} \to 0\). This is a limit of the form \(\infty \times 0\).
In each case the “form” alone does not tell us the answer. Such forms are called indeterminate.
| Form | Meaning |
|---|---|
| \(\dfrac{0}{0}\) | \(\displaystyle\lim_{x \to a} \frac{f(x)}{g(x)}\) where \(f(x) \to 0\) and \(g(x) \to 0\) |
| \(\dfrac{\infty}{\infty}\) | \(\displaystyle\lim_{x \to a} \frac{f(x)}{g(x)}\) where \(f(x) \to \pm\infty\) and \(g(x) \to \pm\infty\) |
| \(0 \times \infty\) | \(\displaystyle\lim_{x \to a} \big[f(x)\,g(x)\big]\) where \(f(x) \to 0\) and \(g(x) \to \pm\infty\) |
Here \(a\) may be a number, or \(\pm\infty\).
L’Hôpital’s rule
L’Hôpital’s rule Not in the formula booklet
Suppose \(f\) and \(g\) are differentiable near \(x = a\) (except possibly at \(a\)), with \(g'(x) \neq 0\) near \(a\).
If \(f(x) \to 0\) and \(g(x) \to 0\), or \(f(x) \to \pm\infty\) and \(g(x) \to \pm\infty\), as \(x \to a\), then
\[ \lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}, \]
provided the limit on the right exists (or is \(\pm\infty\)). The rule also works for \(x \to \pm\infty\).
- \(f(x)\): the numerator
- \(g(x)\): the denominator
- \(a\): the value that \(x\) approaches
- \(f'(x)\), \(g'(x)\): the derivatives of the numerator and the denominator
Method.
- Check the form first. Substitute: you must get \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\).
- Differentiate the top and the bottom separately. (This is not the quotient rule.)
- Find the new limit. If it is still \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\), use the rule again.
- For \(0 \times \infty\), first rewrite the product as a quotient, e.g. \(x \ln x = \dfrac{\ln x}{\frac{1}{x}}\).
The derivative rules are in Unit 24. Many of these limits can also be found with Maclaurin series (see Unit 30).
Do not use l’Hôpital’s rule to prove \(\displaystyle\lim_{x \to 0} \frac{\sin x}{x} = 1\). The rule needs the derivative of \(\sin x\), and finding that derivative from first principles already uses this limit. The argument would go round in a circle.
Example 1 Use l’Hôpital’s rule to find
(a) \(\displaystyle\lim_{x \to 0} \frac{1 - \cos 3x}{x^2}\)
(b) \(\displaystyle\lim_{x \to 0^+} \sqrt{x}\,\ln x\)
(c) \(\displaystyle\lim_{x \to 0^+} x^3 \ln x\)
(d) \(\displaystyle\lim_{x \to \infty} x^3\mathrm{e}^{-x}\)
(a) Form \(\frac{0}{0}\). Differentiate the top and the bottom:
\[ \lim_{x \to 0} \frac{1 - \cos 3x}{x^2} = \lim_{x \to 0} \frac{3\sin 3x}{2x}. \]
Still \(\frac{0}{0}\), so use the rule again:
\[ = \lim_{x \to 0} \frac{9\cos 3x}{2} = \frac{9}{2}. \]
(b) Form \(0 \times (-\infty)\). Rewrite: \(\sqrt{x}\,\ln x = \dfrac{\ln x}{x^{-\frac{1}{2}}}\), which has the form \(\frac{-\infty}{\infty}\).
\[ \lim_{x \to 0^+} \frac{\ln x}{x^{-\frac{1}{2}}} = \lim_{x \to 0^+} \frac{\frac{1}{x}}{-\frac{1}{2}x^{-\frac{3}{2}}} = \lim_{x \to 0^+} \left(-2x^{\frac{1}{2}}\right) = 0. \]
(c) Rewrite: \(x^3\ln x = \dfrac{\ln x}{x^{-3}}\), form \(\frac{-\infty}{\infty}\).
\[ \lim_{x \to 0^+} \frac{\frac{1}{x}}{-3x^{-4}} = \lim_{x \to 0^+} \left(-\frac{x^3}{3}\right) = 0. \]
(d) Rewrite: \(x^3\mathrm{e}^{-x} = \dfrac{x^3}{\mathrm{e}^x}\), form \(\frac{\infty}{\infty}\). Use the rule three times:
\[ \lim_{x \to \infty} \frac{x^3}{\mathrm{e}^x} = \lim_{x \to \infty} \frac{3x^2}{\mathrm{e}^x} = \lim_{x \to \infty} \frac{6x}{\mathrm{e}^x} = \lim_{x \to \infty} \frac{6}{\mathrm{e}^x} = 0. \]
In words: \(\mathrm{e}^x\) grows faster than any power of \(x\), and \(\ln x\) grows more slowly than any positive power of \(x\).
Example 2 Find, if possible,
(a) \(\displaystyle\lim_{x \to 0^+} \frac{\ln(\cos 4x)}{\ln(\cos 2x)}\)
(b) \(\displaystyle\lim_{x \to \frac{\pi}{3}^-} \frac{\ln(\sin 3x)}{\ln(\cos 3x)}\)
(a) As \(x \to 0\), \(\cos 4x \to 1\) and \(\cos 2x \to 1\), so the form is \(\frac{\ln 1}{\ln 1} = \frac{0}{0}\). Use the chain rule:
\[ \lim_{x \to 0^+} \frac{\frac{-4\sin 4x}{\cos 4x}}{\frac{-2\sin 2x}{\cos 2x}} = \lim_{x \to 0^+} \frac{2\tan 4x}{\tan 2x}. \]
Still \(\frac{0}{0}\). Use the rule again (\(\frac{\mathrm{d}}{\mathrm{d}x}\tan kx = k\sec^2 kx\)):
\[ = \lim_{x \to 0^+} \frac{2 \times 4\sec^2 4x}{2\sec^2 2x} = \frac{8 \times 1}{2 \times 1} = 4. \]
(b) Check the form first. When \(x\) is a little less than \(\frac{\pi}{3}\), \(3x\) is a little less than \(\pi\). Then \(\cos 3x\) is close to \(-1\), so it is negative, and \(\ln(\cos 3x)\) is not defined. So the function is not defined near \(x = \frac{\pi}{3}\) (on the left), and the limit cannot be found. L’Hôpital’s rule does not apply: the form is not \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\).
Common errors
| ✗ Wrong | ✓ Right | Why |
|---|---|---|
| Using the quotient rule on \(\frac{f}{g}\) | Differentiate \(f\) and \(g\) separately | L’Hôpital’s rule uses \(\frac{f'}{g'}\). |
| Using the rule without checking the form | Substitute first | \(\displaystyle\lim_{x \to 0} \frac{x + 1}{x + 2} = \frac{1}{2}\), but \(\frac{f'}{g'} = 1\). |
| Using the rule on \(0 \times \infty\) directly | Rewrite as a quotient first | The rule is only for \(\frac{0}{0}\) and \(\frac{\infty}{\infty}\). |
| Stopping after one step when the form is still \(\frac{0}{0}\) | Use the rule again | e.g. Example 1 (a). |
| Proving \(\frac{\sin x}{x} \to 1\) with the rule | Use the table / known result | The argument is circular. |
Exercises
1 Find \(\displaystyle\lim_{x \to 0} \frac{\mathrm{e}^{2x} - 1}{x}\).
Form \(\frac{0}{0}\). \(\displaystyle\lim_{x \to 0} \frac{2\mathrm{e}^{2x}}{1} = 2\).
2 Find \(\displaystyle\lim_{x \to 0} \frac{\sin 3x}{\mathrm{e}^x - 1}\).
Form \(\frac{0}{0}\). \(\displaystyle\lim_{x \to 0} \frac{3\cos 3x}{\mathrm{e}^x} = \frac{3}{1} = 3\).
3 Find \(\displaystyle\lim_{x \to 1} \frac{\ln x}{x^2 - 1}\).
Form \(\frac{0}{0}\). \(\displaystyle\lim_{x \to 1} \frac{\frac{1}{x}}{2x} = \frac{1}{2}\).
4 Find \(\displaystyle\lim_{x \to 0} \frac{x - \sin x}{x^3}\).
Form \(\frac{0}{0}\) three times: \(\displaystyle\lim_{x \to 0} \frac{1 - \cos x}{3x^2} = \lim_{x \to 0} \frac{\sin x}{6x} = \lim_{x \to 0} \frac{\cos x}{6} = \frac{1}{6}\).
5 Find \(\displaystyle\lim_{x \to \infty} \frac{\ln x}{\sqrt{x}}\).
Form \(\frac{\infty}{\infty}\). \(\displaystyle\lim_{x \to \infty} \frac{\frac{1}{x}}{\frac{1}{2\sqrt{x}}} = \lim_{x \to \infty} \frac{2}{\sqrt{x}} = 0\).
6 Find \(\displaystyle\lim_{x \to \infty} \frac{x^2}{\mathrm{e}^{3x}}\).
Form \(\frac{\infty}{\infty}\) twice: \(\displaystyle\lim_{x \to \infty} \frac{2x}{3\mathrm{e}^{3x}} = \lim_{x \to \infty} \frac{2}{9\mathrm{e}^{3x}} = 0\).
7 Find \(\displaystyle\lim_{x \to 0^+} x(\ln x)^2\).
Rewrite as \(\dfrac{(\ln x)^2}{x^{-1}}\), form \(\frac{\infty}{\infty}\).
\(\displaystyle\lim_{x \to 0^+} \frac{\frac{2\ln x}{x}}{-x^{-2}} = \lim_{x \to 0^+} (-2x\ln x) = \lim_{x \to 0^+} \frac{-2\ln x}{x^{-1}} = \lim_{x \to 0^+} \frac{-\frac{2}{x}}{-x^{-2}} = \lim_{x \to 0^+} 2x = 0\).
8 Find \(\displaystyle\lim_{x \to 0} \frac{1 - \cos x}{x\sin x}\).
Form \(\frac{0}{0}\). \(\displaystyle\lim_{x \to 0} \frac{\sin x}{\sin x + x\cos x}\), still \(\frac{0}{0}\). Again: \(\displaystyle\lim_{x \to 0} \frac{\cos x}{2\cos x - x\sin x} = \frac{1}{2}\).
9 Find \(\displaystyle\lim_{x \to 2} \frac{x^3 - 8}{x^2 + x - 6}\)
(a) by factorising
(b) by l’Hôpital’s rule.
(a) \(\dfrac{(x - 2)(x^2 + 2x + 4)}{(x - 2)(x + 3)} = \dfrac{x^2 + 2x + 4}{x + 3} \to \dfrac{12}{5}\).
(b) \(\displaystyle\lim_{x \to 2} \frac{3x^2}{2x + 1} = \frac{12}{5}\). ✓
10 (a) Explain why l’Hôpital’s rule must not be used for \(\displaystyle\lim_{x \to 0} \frac{\cos x}{x + 1}\), and find the limit.
(b) Find \(\displaystyle\lim_{x \to 0} \frac{\mathrm{e}^x - 1 - x}{x^2}\).
(a) Substitution gives \(\dfrac{1}{1}\), which is not an indeterminate form. The limit is simply \(1\). (The rule would give \(\dfrac{-\sin 0}{1} = 0\), which is wrong.)
(b) Form \(\frac{0}{0}\) twice: \(\displaystyle\lim_{x \to 0} \frac{\mathrm{e}^x - 1}{2x} = \lim_{x \to 0} \frac{\mathrm{e}^x}{2} = \frac{1}{2}\).