L’Hôpital’s Rule

L’Hôpital’s rule finds limits of fractions that give the indeterminate forms \frac{0}{0} or \frac{\infty}{\infty}. If \lim \frac{f(x)}{g(x)} has one of these forms, then it equals \lim \frac{f'(x)}{g'(x)}, as long as that new limit exists. Differentiate the top and bottom separately; do not use the quotient rule.

Before this lesson: Evaluating Limits Algebraically, Limits at Infinity and Derivatives of Exponential Functions

Why L’Hôpital’s rule works

When x is near a and both f(a) = 0 and g(a) = 0, each function looks like its tangent line: f(x) \approx f'(a)(x - a) and g(x) \approx g'(a)(x - a) (see linear approximation). The factors (x − a) cancel in the fraction, leaving \frac{f'(a)}{g'(a)}. So the ratio of the functions approaches the ratio of their slopes.

An indeterminate form is a warning that the limit could be anything. A form like \frac{0}{0} doesn’t tell you the answer: \frac{x^2}{x}, \frac{x}{x^2} and \frac{5x}{x} all have this form at 0, with limits 0, ∞ (it doesn’t exist) and 5.

Graph of y = sin(3x)/x for x from −3 to 3. The curve is a wave that rises to a peak near x = 0, with an open circle at (0, 3) because the function is undefined at x = 0. The curve approaches height 3 from both sides.
At x = 0, sin(3x)/x has the form 0/0, but the graph shows the limit is 3. L’Hôpital’s rule gives 3cos(0)/1 = 3.

L’Hôpital’s rule statement

\text{If } \lim_{x \to a}\frac{f(x)}{g(x)} \text{ is } \frac{0}{0} \text{ or } \frac{\pm\infty}{\pm\infty}, \text{ then } \lim_{x \to a}\frac{f(x)}{g(x)} = \lim_{x \to a}\frac{f'(x)}{g'(x)}

Here a can be a number or ±∞, and the rule also works for one-sided limits. It needs f and g to be differentiable near a, with g′(x) ≠ 0 near a.

  1. Substitute to check the form. If it is not 0/0 or ∞/∞, stop: the rule does not apply.
  2. Differentiate the numerator and the denominator separately.
  3. Find the limit of the new fraction.
  4. If the new fraction is still 0/0 or ∞/∞, you can apply the rule again.

L’Hôpital’s rule examples

Example 1: A 0/0 limit you could also factor

Find \lim_{x \to 2}\frac{x^2 - 4}{x - 2}.

\frac{2^2 - 4}{2 - 2} = \frac{0}{0}

Substitute x = 2. The form is 0/0, so the rule applies.

\lim_{x \to 2}\frac{x^2 - 4}{x - 2} = \lim_{x \to 2}\frac{2x}{1}

Differentiate the top and the bottom separately.

\lim_{x \to 2}\frac{2x}{1} = 4

Substitute x = 2.

Answer: 4. Factoring gives the same result: \frac{(x - 2)(x + 2)}{x - 2} = x + 2 \to 4 (see evaluating limits algebraically).

Example 2: A trig limit

Find \lim_{x \to 0}\frac{\sin(3x)}{x}.

\frac{\sin 0}{0} = \frac{0}{0}

Substitute x = 0. The form is 0/0.

\lim_{x \to 0}\frac{3\cos(3x)}{1}

Differentiate: the chain rule gives 3cos(3x) on top.

3\cos 0 = 3

Substitute x = 0.

Answer: 3. The graph above confirms it.

Example 3: Using the rule twice

Find \lim_{x \to 0}\frac{e^x - 1 - x}{x^2}.

\frac{e^0 - 1 - 0}{0} = \frac{0}{0}

Substitute x = 0. The form is 0/0.

\lim_{x \to 0}\frac{e^x - 1}{2x}

Differentiate the top and the bottom.

\frac{e^0 - 1}{0} = \frac{0}{0}

Still 0/0, so apply the rule again.

\lim_{x \to 0}\frac{e^x}{2} = \frac{1}{2}

Differentiate again, then substitute x = 0.

Answer: \frac{1}{2}. Check the form before every round.

Example 4: An ∞/∞ limit

Find \lim_{x \to \infty}\frac{\ln x}{x}.

\frac{\infty}{\infty}

As x → ∞, both ln x and x grow without bound.

\lim_{x \to \infty}\frac{\frac{1}{x}}{1} = \lim_{x \to \infty}\frac{1}{x}

Differentiate the top and the bottom.

\lim_{x \to \infty}\frac{1}{x} = 0

1/x shrinks to 0.

Answer: 0. The logarithm grows more slowly than x.

Example 5: Word problem with a medicine

The amount of a medicine in a patient’s blood t hours after a dose is A(t) = \frac{50t}{e^{0.5t}} mg. What happens to the amount in the long run?

\lim_{t \to \infty}\frac{50t}{e^{0.5t}} \text{ is } \frac{\infty}{\infty}

Both the top and the bottom grow without bound.

\lim_{t \to \infty}\frac{50}{0.5e^{0.5t}}

Differentiate: the derivative of e^(0.5t) is 0.5e^(0.5t).

\lim_{t \to \infty}\frac{100}{e^{0.5t}} = 0

Simplify 50/0.5 = 100. The bottom grows without bound.

Answer: the amount approaches 0 mg. The body clears the medicine, because the exponential in the denominator eventually beats the linear growth on top.

Common mistakes

MistakeExample of the errorFix
Using the rule when the form isn’t indeterminate\lim_{x \to 1}\frac{x^2 + 1}{x + 1} “= \lim \frac{2x}{1} = 2“Substitute first: \frac{2}{2} = 1. The rule doesn’t apply.
Using the quotient ruleDifferentiating f/g as \frac{f'g - fg'}{g^2}Differentiate the top and the bottom separately: \frac{f'}{g'}.
Not checking the form againApplying the rule a third time in Example 3 after getting eˣ/2Once the limit is not indeterminate, substitute and stop.
Using it on 0 · ∞ directlyApplying it to x ln x as writtenRewrite as a fraction first, such as \frac{\ln x}{1/x} (next lesson).
Concluding the limit doesn’t exist when f′/g′ has no limitFor \frac{x + \sin x}{x} as x → ∞The rule just gives no answer. Dividing by x shows the limit is 1.

Related methods

Growth rates at infinity

Repeated use of the rule shows that as x → ∞, ln x grows more slowly than any positive power of x, and any power of x grows more slowly than e^x. For example, \lim_{x \to \infty}\frac{x^{100}}{e^x} = 0. This ranking is useful for limits at infinity.

Other indeterminate forms

Forms like 0 · ∞, ∞ − ∞, 1^∞, 0⁰ and ∞⁰ are also indeterminate. You rewrite them as a fraction, then use L’Hôpital’s rule. That is the next lesson, Indeterminate Forms.

Practice problems

  1. Find \lim_{x \to 3}\frac{x^2 - 9}{x - 3}.
  2. Find \lim_{x \to 0}\frac{1 - \cos x}{x^2}.
  3. Find \lim_{x \to 0}\frac{\tan x}{x}.
  4. Find \lim_{x \to \infty}\frac{3x^2 + 1}{5x^2 - x}.
  5. Find \lim_{x \to 1}\frac{\ln x}{x - 1}.
  6. Find \lim_{x \to 0}\frac{e^{2x} - 1}{x}.
  7. Find \lim_{x \to \infty}\frac{x^3}{e^x}.
  8. Find \lim_{x \to 0}\frac{x - \sin x}{x^3}.
  9. Find \lim_{x \to 1}\frac{x^2 + 3}{x + 1}.
  10. Find \lim_{x \to \infty}\frac{\sqrt{x}}{\ln x}.
Show answers

1.

\frac{0}{0}

Substitute x = 3: 9 − 9 = 0 and 3 − 3 = 0.

\lim_{x \to 3}\frac{2x}{1} = 6

Differentiate the top and the bottom, then substitute.

Answer: 6

2.

\frac{0}{0}

Substitute x = 0: 1 − cos 0 = 0.

\lim_{x \to 0}\frac{\sin x}{2x}

Differentiate. Still 0/0.

\lim_{x \to 0}\frac{\cos x}{2} = \frac{1}{2}

Differentiate again, then substitute.

Answer: \frac{1}{2}

3.

\frac{0}{0}

Substitute x = 0: tan 0 = 0.

\lim_{x \to 0}\frac{\sec^2 x}{1} = \sec^2 0 = 1

Differentiate, then substitute.

Answer: 1

4.

\frac{\infty}{\infty}

Both grow without bound.

\lim_{x \to \infty}\frac{6x}{10x - 1}

Differentiate. Still ∞/∞.

\lim_{x \to \infty}\frac{6}{10} = \frac{3}{5}

Differentiate again and simplify.

Answer: \frac{3}{5}

5.

\frac{0}{0}

Substitute x = 1: ln 1 = 0.

\lim_{x \to 1}\frac{\frac{1}{x}}{1} = 1

Differentiate, then substitute.

Answer: 1

6.

\frac{0}{0}

Substitute x = 0: e⁰ − 1 = 0.

\lim_{x \to 0}\frac{2e^{2x}}{1} = 2

Differentiate (chain rule), then substitute.

Answer: 2

7.

\lim_{x \to \infty}\frac{3x^2}{e^x}

∞/∞: differentiate once.

\lim_{x \to \infty}\frac{6x}{e^x}

Still ∞/∞: differentiate again.

\lim_{x \to \infty}\frac{6}{e^x} = 0

Differentiate a third time. The bottom grows without bound.

Answer: 0

8.

\lim_{x \to 0}\frac{1 - \cos x}{3x^2}

0/0: differentiate once.

\lim_{x \to 0}\frac{\sin x}{6x}

Still 0/0: differentiate again.

\lim_{x \to 0}\frac{\cos x}{6} = \frac{1}{6}

Differentiate a third time, then substitute.

Answer: \frac{1}{6}

9.

\frac{1 + 3}{1 + 1} = \frac{4}{2} = 2

Substitute x = 1. The form is not indeterminate, so the rule doesn’t apply.

Answer: 2

10.

\lim_{x \to \infty}\frac{\frac{1}{2\sqrt{x}}}{\frac{1}{x}}

∞/∞: differentiate the top and the bottom.

\lim_{x \to \infty}\frac{x}{2\sqrt{x}} = \lim_{x \to \infty}\frac{\sqrt{x}}{2}

Divide by a fraction: multiply by its reciprocal, then simplify x/√x = √x.

Answer: the limit is ∞ (it does not exist). √x grows faster than ln x.

L’Hôpital’s rule FAQ

When can you use L’Hôpital’s rule?

Only when direct substitution gives 0/0 or ∞/∞ (in any combination of signs). Other indeterminate forms must be rewritten as one of these first.

Do you use the quotient rule in L’Hôpital’s rule?

No. You take the derivative of the numerator and the derivative of the denominator separately, then form a new fraction.

Can you use L’Hôpital’s rule more than once?

Yes, as long as the new fraction is still 0/0 or ∞/∞ each time. Check the form before every round.

Is L’Hôpital’s rule allowed on the AP Calculus exam?

Yes. It is part of the AP Calculus AB and BC course. Show the indeterminate form before you use it.

Summary

  • For 0/0 or ∞/∞: \lim\frac{f}{g} = \lim\frac{f'}{g'}.
  • Always check the form first; otherwise the rule gives wrong answers.
  • Differentiate the top and the bottom separately, not with the quotient rule.
  • Repeat if the result is still indeterminate.
  • At infinity: ln x is slower than any power of x, and powers are slower than eˣ.

Previous lesson: Differentials

Next lesson: Indeterminate Forms

Back to the Calculus 1 Index