Mathématiques • Physique • Chimie
Préparation au CEGEP | Exercices • Défis • Corrections
Étudier. Pratiquer. Progresser. Study. Practice. Improve.
📝
Exercices Practice problems
💡
Défis Challenges
✓
Corrections Detailed solutions
📖
Concepts Deeper understanding
StudyGroup AN educational mascot

L’Hôpital’s Rule: When to Use It (and When Not To) — 7 Examples and 6 Solved Exercises

Version française

L'Hôpital's rule (LH) is a powerful shortcut for some limits: instead of the limit of a quotient, you take the limit of the quotient of the derivatives. But it comes with conditions, and using it at the wrong moment gives a wrong answer without you noticing. Here is my summary of section 3.10: the statement, why it works, 7 examples (including a classic mistake and an endless loop), and 6 exercises for practice.

Level: CEGEP — Differential Calculus
Topics: indeterminate forms \(\frac{0}{0}\) and \(\frac{\infty}{\infty}\), L'Hôpital's rule, repeated use, dominant terms, \(\sqrt{x^2}=|x|\)
Prerequisites: derivatives of \(\ln x\), \(e^{kx}\), \(\sin x\), \(\cos x\), \(\sqrt{u}\)

Table of Contents

  1. The statement of the rule
  2. Why it works
  3. 7 worked examples
  4. 6 solved exercises
  5. Traps to avoid
  6. My handwritten notes

1. The statement of the rule

Consider the limit of a quotient \(\displaystyle\lim_{x\to *}\frac{f(x)}{g(x)}\) of the form \(\dfrac{0}{0}\) or \(\dfrac{\pm\infty}{\pm\infty}\), where \(*\) stands for \(a\in\mathbb{R}\), \(a^+\), \(a^-\), \(+\infty\) or \(-\infty\).

If \(g'(x)\) is defined and not zero near \(*\) (except possibly at \(*\)), then

\[\lim_{x\to *}\frac{f(x)}{g(x)}=\lim_{x\to *}\frac{f'(x)}{g'(x)}\]

provided this last limit exists (a real number) or equals \(+\infty\) or \(-\infty\).

Careful: you differentiate the numerator and the denominator separately. This is not the derivative of the quotient (no quotient rule here!).

2. Why it works

In the simplest case, \(f(a)=g(a)=0\) and both functions are differentiable at \(a\). Then we can write

\[\frac{f(x)}{g(x)}=\frac{f(x)-f(a)}{g(x)-g(a)}=\frac{\dfrac{f(x)-f(a)}{x-a}}{\dfrac{g(x)-g(a)}{x-a}}\ \xrightarrow[x\to a]{}\ \frac{f'(a)}{g'(a)}\]

Each small quotient is a rate of change, which tends to the derivative. In other words: near \(a\), both functions look like their tangent lines, and the ratio of two tangent lines that pass through zero is the ratio of their slopes.

Another way to see it: if a point moves with \(x=g(t)\) and \(y=f(t)\), then \(\dfrac{f'(t)}{g'(t)}=\dfrac{dy/dt}{dx/dt}=\dfrac{dy}{dx}\) is the slope of its path. The ratio \(f/g\) is the slope of the line joining the origin to the point; as the point approaches the origin, this slope becomes the slope of the tangent.


3. 7 worked examples

Always the same routine: 1) evaluate to find the form; 2) if it is \(\frac00\) or \(\frac\infty\infty\), apply LH; 3) simplify before evaluating again.

Example 1 — A logarithm

Form: \(\dfrac{\ln 1}{1-1}=\dfrac00\), indeterminate.

\[\lim_{x\to1}\frac{\ln x}{x-1}\overset{LH}{=}\lim_{x\to1}\frac{1/x}{1}=\lim_{x\to1}\frac1x=1\]

Example 2 — LH several times

Form: \(\dfrac{\infty}{\infty}\), indeterminate.

\[\lim_{x\to\infty}\frac{e^{2x}}{x^2}\overset{LH}{=}\lim_{x\to\infty}\frac{2e^{2x}}{2x}\overset{LH}{=}\lim_{x\to\infty}\frac{4e^{2x}}{2}=+\infty\]

After the first application, the form is still \(\frac\infty\infty\), so we apply it again. LH may have to be applied several times. The exponential always ends up beating any power of \(x\).

Example 3 — ln versus square root

Form: \(\dfrac{\infty}{\infty}\).

\[\lim_{x\to\infty}\frac{\ln x}{\sqrt x}\overset{LH}{=}\lim_{x\to\infty}\frac{1/x}{\tfrac12x^{-1/2}}=\lim_{x\to\infty}\frac1x\cdot2x^{1/2}=\lim_{x\to\infty}\frac{2}{\sqrt x}=0\]

You have to simplify the fraction of fractions before evaluating. Conclusion: \(\sqrt x\) grows faster than \(\ln x\).

Left: √x grows faster than ln x; right: x/√(x²+1) with its two horizontal asymptotes y = 1 and y = −1

Example 4 — Three times in a row

Form: \(\dfrac{0-0}{0}=\dfrac00\).

\[\lim_{x\to0}\frac{x-\sin x}{x^3}\overset{LH}{=}\lim_{x\to0}\frac{1-\cos x}{3x^2}\overset{LH}{=}\lim_{x\to0}\frac{\sin x}{6x}\overset{LH}{=}\lim_{x\to0}\frac{\cos x}{6}=\frac16\]

After each step, check the form: \(\frac{1-1}{0}=\frac00\), then \(\frac00\), then finally \(\frac16\), a determinate form. That's where you stop.

Example 5 — The classic mistake: LH without an indeterminate form

\(\displaystyle\lim_{x\to3}\frac{x^2-9}{x-3}\) has the form \(\frac00\). Two methods give the same answer:

\[\lim_{x\to3}\frac{(x+3)(x-3)}{x-3}=\lim_{x\to3}(x+3)=6\qquad\text{or}\qquad\lim_{x\to3}\frac{x^2-9}{x-3}\overset{LH}{=}\lim_{x\to3}\frac{2x}{1}=6\]

But watch out for \(\displaystyle\lim_{x\to3}\frac{x^2-9}{x+3}\): the form is \(\dfrac{9-9}{3+3}=\dfrac06=0\). This is a determinate form and the answer is 0. If you apply LH anyway, you get \(\frac{2x}{1}\to6\): wrong!

The first thing to do, always: evaluate the form. If it is not \(\frac00\) or \(\frac\infty\infty\), LH does not apply.

Example 6 — When another method is faster

Form: \(\dfrac\infty\infty\) (a rational function at infinity).

\[\lim_{x\to-\infty}\frac{x^5+x^4+3x}{x^4-2x^3+x^2+1}=\lim_{x\to-\infty}\frac{x^5\left(1+\frac1x+\frac{3}{x^4}\right)}{x^4\left(1-\frac2x+\frac1{x^2}+\frac1{x^4}\right)}=\lim_{x\to-\infty}x\cdot\frac{1+0+0}{1-0+0+0}=-\infty\]

Factor out the dominant term in the numerator and the denominator. LH would also work, but you would have to apply it 4 times: factoring is much faster.

Example 7 — The endless loop

Form: \(\dfrac\infty\infty\).

\[\lim_{x\to\infty}\frac{x}{\sqrt{x^2+1}}\overset{LH}{=}\lim_{x\to\infty}\frac{1}{\dfrac{2x}{2\sqrt{x^2+1}}}=\lim_{x\to\infty}\frac{\sqrt{x^2+1}}{x}\overset{LH}{=}\lim_{x\to\infty}\frac{x}{\sqrt{x^2+1}}\]

We're going in circles: after two applications, we're back to the original limit! LH leads nowhere. Another strategy: rewrite the function by factoring \(x^2\) out of the square root.

\[\lim_{x\to\infty}\frac{x}{\sqrt{x^2\left(1+\frac1{x^2}\right)}}=\lim_{x\to\infty}\frac{x}{|x|\sqrt{1+\frac1{x^2}}}=\lim_{x\to\infty}\frac{1}{\sqrt{1+0}}=1\]

Since \(x\to+\infty\), \(x\gt0\), so \(|x|=x\). Important reminder: \(\sqrt{x^2}=|x|\), not \(x\). For example, \(\sqrt{(-3)^2}=\sqrt9=3\), not \(-3\). (See exercise 6 for \(x\to-\infty\).)


4. 6 solved exercises

For each limit, start by evaluating the form. Try it before opening the solution.

Exercise 1

\(\displaystyle\lim_{x\to0}\frac{e^x-1}{x}\)

Show the solution

Form \(\frac{1-1}{0}=\frac00\). \(\displaystyle\lim_{x\to0}\frac{e^x-1}{x}\overset{LH}{=}\lim_{x\to0}\frac{e^x}{1}=e^0=\mathbf{1}\).

Exercise 2

\(\displaystyle\lim_{x\to0}\frac{\sin 3x}{x}\)

Show the solution

Form \(\frac00\). \(\displaystyle\lim_{x\to0}\frac{\sin 3x}{x}\overset{LH}{=}\lim_{x\to0}\frac{3\cos 3x}{1}=3\cos0=\mathbf{3}\). Don't forget the inner derivative (the 3) from the chain rule.

Exercise 3

\(\displaystyle\lim_{x\to0}\frac{1-\cos x}{x^2}\)

Show the solution

Form \(\frac00\). Apply LH twice:

\[\lim_{x\to0}\frac{1-\cos x}{x^2}\overset{LH}{=}\lim_{x\to0}\frac{\sin x}{2x}\overset{LH}{=}\lim_{x\to0}\frac{\cos x}{2}=\frac12\]

This is actually the middle step of example 4, divided by 3.

Exercise 4

\(\displaystyle\lim_{x\to\infty}\frac{x^3}{e^x}\)

Show the solution

Form \(\frac\infty\infty\), three times in a row:

\[\lim_{x\to\infty}\frac{x^3}{e^x}\overset{LH}{=}\lim_{x\to\infty}\frac{3x^2}{e^x}\overset{LH}{=}\lim_{x\to\infty}\frac{6x}{e^x}\overset{LH}{=}\lim_{x\to\infty}\frac{6}{e^x}=0\]

This is the "mirror" of example 2: the exponential always wins, whether it's on top (\(+\infty\)) or on the bottom (0).

Exercise 5 — A 0 · ∞ form

\(\displaystyle\lim_{x\to0^+}x\ln x\)

Show the solution

Form \(0\cdot(-\infty)\): it's not a quotient, so LH does not apply directly. Rewrite the product as a quotient:

\[\lim_{x\to0^+}x\ln x=\lim_{x\to0^+}\frac{\ln x}{1/x}\overset{LH}{=}\lim_{x\to0^+}\frac{1/x}{-1/x^2}=\lim_{x\to0^+}(-x)=0\]

Now the form is \(\frac{-\infty}{+\infty}\), so LH applies. Answer: 0.

Exercise 6 — The \(|x|\) trap

\(\displaystyle\lim_{x\to-\infty}\frac{x}{\sqrt{x^2+1}}\)

Show the solution

LH goes in circles as in example 7, so rewrite:

\[\lim_{x\to-\infty}\frac{x}{|x|\sqrt{1+\frac1{x^2}}}\]

This time \(x\lt0\), so \(|x|=-x\):

\[\lim_{x\to-\infty}\frac{x}{-x\sqrt{1+\frac1{x^2}}}=\frac{1}{-\sqrt{1+0}}=-1\]

Answer: −1. If you had written \(\sqrt{x^2}=x\), you would have found 1: wrong. The graph above clearly shows both asymptotes, \(y=1\) on the right and \(y=-1\) on the left.


5. Traps to avoid

  • Not checking the form: LH applies only to \(\frac00\) and \(\frac{\pm\infty}{\pm\infty}\). With \(\frac06\), the answer is simply 0.
  • Differentiating the quotient: differentiate the top and the bottom separately, without the quotient rule.
  • Not simplifying: after LH, simplify fractions of fractions before evaluating.
  • Not checking at every step: if the form is still indeterminate, apply LH again; if it's determinate, stop.
  • Getting stuck in a loop: if LH brings you back to the original limit, change strategy (dominant term, factoring).
  • \(\sqrt{x^2}=x\): false in general. \(\sqrt{x^2}=|x|\), which equals \(-x\) when \(x\to-\infty\).

6. My handwritten notes

Here is my page of notes for section 3.10, in French, the language of my course. Everything on it is explained in English above. The red notes mark the mistake to avoid and the loop in example 7.

Handwritten notes (in French) on L’Hôpital’s rule: statement, examples and mistakes to avoid

Reading guide
  • "Règle de L'Hôpital (RH)" = L'Hôpital's rule (LH). "Soit…" = "Let…"; "au voisinage de" = near.
  • "pas la dérivée du quotient" = not the derivative of the quotient.
  • "indéterminée" = indeterminate; "forme connue" = determinate (known) form; "simplifier avant de réévaluer" = simplify before evaluating again.
  • "RH peut devoir être appliquée plusieurs fois" = LH may have to be applied several times; "3 fois RH" = LH three times.
  • "le √x augmente plus rapidement que le ln(x)" = √x grows faster than ln x.
  • "1ère chose : évaluer forme" = first thing: evaluate the form; "RH non applicable" = LH does not apply; "erreur" = mistake.
  • "Plus efficace que faire 4 fois RH" = faster than applying LH 4 times; "dominant(e)" = dominant term.
  • "on tourne en rond, retour à la lim de départ" = going in circles, back to the original limit; "autre stratégie : écrire autrement la fonction" = another strategy: rewrite the function; "car x > 0" = because x > 0.

Keep Reviewing

StudyGroup AN — Mathematics, physics and chemistry exercises and solutions for CEGEP students.
Review: Yootak Hong, PhD