Math Core

Lesson 4.5 · Contextual Applications of Differentiation

L'Hôpital's rule

Some limits can't be found by substitution because they produce a meaningless expression like 00\dfrac{0}{0}. In Unit 1 you handled these with algebra: factoring, rationalizing, or special trig limits. L'Hôpital's rule gives a single, powerful method that uses derivatives instead, and it works on many limits where algebra gets stuck.

Indeterminate forms

Try substituting x=0x = 0 into sin⁡(3x)x\dfrac{\sin(3x)}{x}. You get 00\dfrac{0}{0}. That doesn't mean the limit is 0, or 1, or undefined; it means substitution gave you no information. The numerator and denominator are both shrinking toward 0, and the limit depends on how fast each one shrinks.

The same thing happens with ∞∞\dfrac{\infty}{\infty}: in lim⁡x→∞x2ex\lim\limits_{x \to \infty} \dfrac{x^2}{e^x}, both parts grow without bound, and you need to know which grows faster. These two expressions are called indeterminate forms.

The rule

L'Hôpital's rule

Suppose ff and gg are differentiable near aa (except possibly at aa), g′(x)≠0g'(x) \ne 0 near aa, and

lim⁡x→af(x)=lim⁡x→ag(x)=0orlim⁡x→af(x)=±∞ and lim⁡x→ag(x)=±∞.\lim_{x \to a} f(x) = \lim_{x \to a} g(x) = 0 \quad\text{or}\quad \lim_{x \to a} f(x) = \pm\infty \text{ and } \lim_{x \to a} g(x) = \pm\infty.

Then

lim⁡x→af(x)g(x)=lim⁡x→af′(x)g′(x),\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 same rule holds for one-sided limits and for x→±∞x \to \pm\infty.

Why does this work? When f(a)=g(a)=0f(a) = g(a) = 0, local linearity says f(x)≈f′(a)(x−a)f(x) \approx f'(a)(x - a) and g(x)≈g′(a)(x−a)g(x) \approx g'(a)(x - a) near aa. The factors of (x−a)(x - a) cancel, leaving f′(a)g′(a)\dfrac{f'(a)}{g'(a)}. The ratio of two quantities that both vanish is decided by the ratio of their rates.

Common mistake

Check the form first, every time. L'Hôpital's rule applies only to 00\dfrac{0}{0} or ∞∞\dfrac{\infty}{\infty}. For example, lim⁡x→0x+1x+2=12\lim\limits_{x \to 0} \dfrac{x + 1}{x + 2} = \dfrac{1}{2} by substitution, but blindly differentiating top and bottom gives 11=1\dfrac{1}{1} = 1, which is wrong. On the AP exam you must show that the form is indeterminate (by writing the two separate limits) to earn credit for using the rule.

Also: differentiate the numerator and denominator separately. This is not the quotient rule.

Worked examples

y = sin(3x)/x is undefined at x = 0, but the graph heads toward a height of 3.Open in grapher →

Worked example: A basic 0/0 limit

Evaluate lim⁡x→0sin⁡(3x)x\lim\limits_{x \to 0} \dfrac{\sin(3x)}{x}.

Solution. As x→0x \to 0, sin⁡(3x)→0\sin(3x) \to 0 and x→0x \to 0, so the form is 00\dfrac{0}{0}. By L'Hôpital's rule,

lim⁡x→0sin⁡(3x)x=lim⁡x→03cos⁡(3x)1=3.\lim_{x \to 0} \frac{\sin(3x)}{x} = \lim_{x \to 0} \frac{3\cos(3x)}{1} = 3.

Worked example: Applying the rule twice

Evaluate lim⁡x→0ex−1−xx2\lim\limits_{x \to 0} \dfrac{e^x - 1 - x}{x^2}.

Solution. Substituting gives 1−1−00=00\dfrac{1 - 1 - 0}{0} = \dfrac{0}{0}. Apply the rule:

lim⁡x→0ex−12x.\lim_{x \to 0} \frac{e^x - 1}{2x}.

This is still 00\dfrac{0}{0}, so apply the rule again:

lim⁡x→0ex2=12.\lim_{x \to 0} \frac{e^x}{2} = \frac{1}{2}.

Each time, confirm the new limit is still indeterminate before differentiating again.

Worked example: An infinity-over-infinity limit

Evaluate lim⁡x→∞x2ex\lim\limits_{x \to \infty} \dfrac{x^2}{e^x}.

Solution. Both numerator and denominator grow without bound: ∞∞\dfrac{\infty}{\infty}. Apply the rule twice:

lim⁡x→∞x2ex=lim⁡x→∞2xex=lim⁡x→∞2ex=0.\lim_{x \to \infty} \frac{x^2}{e^x} = \lim_{x \to \infty} \frac{2x}{e^x} = \lim_{x \to \infty} \frac{2}{e^x} = 0.

Exponential functions eventually outgrow every power of xx. In the same way, lim⁡x→∞ln⁡xx=lim⁡x→∞1/x1=0\lim\limits_{x \to \infty} \dfrac{\ln x}{x} = \lim\limits_{x \to \infty} \dfrac{1/x}{1} = 0: logarithms grow more slowly than any power.

Worked example: AP style: using given values

Functions ff and gg are differentiable with f(2)=0f(2) = 0, g(2)=0g(2) = 0, f′(2)=5f'(2) = 5 and g′(2)=−2g'(2) = -2, and f′f' and g′g' are continuous. Find lim⁡x→2f(x)g(x)\lim\limits_{x \to 2} \dfrac{f(x)}{g(x)}.

Solution. Because ff and gg are continuous, lim⁡x→2f(x)=f(2)=0\lim\limits_{x \to 2} f(x) = f(2) = 0 and lim⁡x→2g(x)=0\lim\limits_{x \to 2} g(x) = 0, so the form is 00\dfrac{0}{0}. Since f′f' and g′g' are continuous and g′(2)≠0g'(2) \ne 0,

lim⁡x→2f(x)g(x)=lim⁡x→2f′(x)g′(x)=f′(2)g′(2)=5−2=−52.\lim_{x \to 2} \frac{f(x)}{g(x)} = \lim_{x \to 2} \frac{f'(x)}{g'(x)} = \frac{f'(2)}{g'(2)} = \frac{5}{-2} = -\frac{5}{2}.

When to reach for the rule, and when not to

L'Hôpital's rule is a tool, not a reflex. A few guidelines keep it working for you:

  • Try substitution first. If substitution gives a real number, or a nonzero number over 0, the form is not indeterminate and the rule does not apply. A nonzero number over 0 points to an infinite limit or a vertical asymptote, which you analyze with signs, as in Unit 1.
  • Simplify between steps. After differentiating, cancel common factors or rewrite trig expressions before deciding whether to differentiate again. Messy expressions tend to get messier.
  • Watch for circles. Some limits, such as lim⁡x→∞x2+1x\lim\limits_{x \to \infty} \dfrac{\sqrt{x^2 + 1}}{x}, bounce back and forth between two forms no matter how many times you apply the rule. When that happens, switch to algebra: dividing the numerator and denominator by xx gives the limit 1 immediately.
  • Algebra is still allowed. For a rational function like x2−9x−3\dfrac{x^2 - 9}{x - 3}, factoring is just as quick. Both methods earn full credit when done correctly.

The rule also sharpens what you learned about end behavior. Comparing growth rates with limits at infinity shows the ranking that AP questions rely on: logarithms grow more slowly than powers of xx, and powers grow more slowly than exponentials.

Tip

Many AP free-response questions give values of ff, f′f', gg and g′g' in a table and ask for a limit of f(x)g(x)\dfrac{f(x)}{g(x)}. Write the separate limits of the numerator and denominator, name the form, name the rule, then substitute. Those four short steps are worth the full point.

Practice

Practice 1

Evaluate lim⁡x→3x2−9x−3\lim\limits_{x \to 3} \dfrac{x^2 - 9}{x - 3} using L'Hôpital's rule.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Evaluate lim⁡x→01−cos⁡xx2\lim\limits_{x \to 0} \dfrac{1 - \cos x}{x^2}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Evaluate lim⁡x→0tan⁡(4x)sin⁡(2x)\lim\limits_{x \to 0} \dfrac{\tan(4x)}{\sin(2x)}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Evaluate lim⁡x→1ln⁡xx2−1\lim\limits_{x \to 1} \dfrac{\ln x}{x^2 - 1}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Evaluate lim⁡x→0e2x−1−2xx2\lim\limits_{x \to 0} \dfrac{e^{2x} - 1 - 2x}{x^2}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Evaluate lim⁡x→∞5x+ln⁡x2x\lim\limits_{x \to \infty} \dfrac{5x + \ln x}{2x}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Functions ff and gg have continuous derivatives, with f(1)=0f(1) = 0, g(1)=0g(1) = 0, f′(1)=4f'(1) = 4 and g′(1)=6g'(1) = 6. What is lim⁡x→1f(x)g(x)\lim\limits_{x \to 1} \dfrac{f(x)}{g(x)}?

Practice 8

For which limit is L'Hôpital's rule not appropriate to apply directly?