L'Hôpital's Rule: When and How to Use It, With Examples
Learn L'Hôpital's rule for 0/0 and ∞/∞ limits, how to handle 0·∞, ∞ − ∞ and 1^∞ forms, worked examples, and when the rule does not apply.
By the PracticeCalculus team Published 7 min read
On this page
- What L'Hôpital's rule says
- How to apply L'Hôpital's rule step by step
- Worked example 1: a 0/0 limit
- Worked example 2: applying the rule twice
- Worked example 3: an ∞/∞ limit
- Other indeterminate forms
- When not to use L'Hôpital's rule
- Common mistakes with L'Hôpital's rule
- Quick reference
- Practice until the form check is automatic
Some limits refuse to give in to algebra. You cannot factor \frac{e^x - 1}{x}, and there is no conjugate that tames \frac{x^2}{e^x}. L'Hôpital's rule handles these in a few lines by trading the original fraction for a fraction of derivatives. It is powerful, but it has strict conditions, and using it at the wrong moment produces confidently wrong answers.
What L'Hôpital's rule says
Suppose f and g are differentiable near a (except possibly at a), with g'(x) \neq 0 near a. If
then
as long as the limit on the right exists (or is \pm\infty). The same rule holds for one-sided limits and for x \to \pm\infty.
In plain language: when the top and bottom are both heading to 0, or both blowing up, the limit is decided by how fast each one is changing. That is exactly what the derivatives measure.
Tip: differentiate the numerator and denominator separately. You are not differentiating the fraction, so the quotient rule has nothing to do with it.
Why it works
Near x = a, a differentiable function is almost a straight line: f(x) \approx f(a) + f'(a)(x - a). In the \frac{0}{0} case f(a) = g(a) = 0, so
The factors of (x - a) cancel, leaving the ratio of slopes. The full proof uses the Cauchy mean value theorem, but this picture explains the idea.
How to apply L'Hôpital's rule step by step
- Substitute to identify the form. If it is not \frac{0}{0} or \frac{\infty}{\infty}, stop: the rule does not apply.
- Differentiate the top and the bottom separately.
- Take the limit of the new fraction. Simplify first if you can.
- If the new limit is again \frac{0}{0} or \frac{\infty}{\infty}, apply the rule again. Otherwise you have your answer.
Worked example 1: a 0/0 limit
Evaluate \lim_{x \to 0} \frac{e^x - 1}{x}.
Step 1. Check the form. \frac{e^0 - 1}{0} = \frac{0}{0}. The rule applies.
Step 2. Differentiate top and bottom. \frac{d}{dx}(e^x - 1) = e^x and \frac{d}{dx}(x) = 1.
Step 3. Take the new limit.
Worked example 2: applying the rule twice
Evaluate \lim_{x \to 0} \frac{1 - \cos x}{x^2}.
Step 1. Check the form. \frac{1 - 1}{0} = \frac{0}{0}.
Step 2. First application.
Step 3. Check the form again. \frac{\sin 0}{0} = \frac{0}{0}. Still indeterminate, so apply the rule again.
Step 4. Second application.
Worked example 3: an ∞/∞ limit
Evaluate \lim_{x \to \infty} \frac{x^2}{e^x}.
Step 1. Check the form. Both x^2 and e^x grow without bound: \frac{\infty}{\infty}.
Step 2. First application. \lim_{x \to \infty} \frac{2x}{e^x}, which is still \frac{\infty}{\infty}.
Step 3. Second application. \lim_{x \to \infty} \frac{2}{e^x}. Now the top is constant and the bottom grows without bound.
The same argument, repeated n times, shows that \frac{x^n}{e^x} \to 0 for every power n. Exponentials beat polynomials, which is why the graph below rises at first but is eventually crushed toward 0.
Other indeterminate forms
L'Hôpital's rule works only on fractions. The other indeterminate forms must be rewritten as \frac{0}{0} or \frac{\infty}{\infty} first.
| Form | Example | How to rewrite |
|---|---|---|
| 0 \cdot \infty | x \ln x as x \to 0^+ | Move one factor to the bottom: \frac{\ln x}{1/x} |
| \infty - \infty | \frac{1}{x} - \frac{1}{e^x - 1} as x \to 0^+ | Combine into a single fraction |
| 1^\infty | \left(1 + \frac{1}{x}\right)^x as x \to \infty | Take \ln, then rewrite as a fraction |
| 0^0 | x^x as x \to 0^+ | Take \ln, then rewrite as a fraction |
| \infty^0 | x^{1/x} as x \to \infty | Take \ln, then rewrite as a fraction |
Worked example 4: the 0 · ∞ form
Evaluate \lim_{x \to 0^+} x \ln x.
Step 1. Identify the form. x \to 0 and \ln x \to -\infty: this is 0 \cdot \infty.
Step 2. Rewrite as a fraction. Divide by the reciprocal of x:
which has the form \frac{-\infty}{\infty}.
Step 3. Apply the rule.
So x \ln x \to 0. The x shrinks faster than \ln x blows up.
Worked example 5: the ∞ − ∞ form
Evaluate \lim_{x \to 0^+} \left(\frac{1}{x} - \frac{1}{e^x - 1}\right).
Step 1. Combine into one fraction.
At x = 0 this is \frac{0}{0}.
Step 2. First application. The derivative of the bottom x e^x - x is e^x + x e^x - 1:
still \frac{0}{0}.
Step 3. Second application.
Worked example 6: the 1^∞ form
Evaluate \lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x.
Step 1. Identify the form. The base goes to 1 and the exponent to \infty. This is 1^\infty, which is not automatically 1.
Step 2. Take the natural log. Let y = \left(1 + \frac{1}{x}\right)^x. Then
which has the form \frac{0}{0}.
Step 3. Apply the rule. The derivative of the top is \frac{1}{1 + \frac{1}{x}} \cdot \left(-\frac{1}{x^2}\right) and the derivative of the bottom is -\frac{1}{x^2}. They share the factor -\frac{1}{x^2}, so
Step 4. Undo the log. Since \ln y \to 1, we get y \to e^1:
This is one of the classic definitions of e. The same method gives \lim_{x \to \infty}\left(1 + \frac{k}{x}\right)^x = e^k, and \lim_{x \to 0^+} x^x = e^0 = 1.
When not to use L'Hôpital's rule
When the limit is not indeterminate
Consider \lim_{x \to 0} \frac{x + 1}{x + 2}. Direct substitution gives \frac{1}{2}, and that is the answer. If you wrongly apply the rule anyway you get \frac{1}{1} = 1, which is false. Always check the form first.
When the derivatives go in circles
For \lim_{x \to \infty} \frac{\sqrt{x^2 + 1}}{x}, one application gives \frac{x/\sqrt{x^2+1}}{1} = \frac{x}{\sqrt{x^2 + 1}}, the original fraction upside down. A second application flips it back. Algebra is the way out: divide top and bottom by x to get \sqrt{1 + \frac{1}{x^2}} \to 1.
When the new limit does not exist
For \lim_{x \to \infty} \frac{x + \sin x}{x}, the rule gives \lim (1 + \cos x), which oscillates and does not exist. That does not mean the original limit fails. Dividing by x gives 1 + \frac{\sin x}{x} \to 1. The rule only promises an answer when the new limit exists.
When algebra is simpler
\lim_{x \to 3} \frac{x^2 - 9}{x - 3} is faster by factoring, and limits of rational functions at infinity are faster with the degree rules. L'Hôpital's rule is a tool, not a reflex.
Common mistakes with L'Hôpital's rule
- Using the quotient rule. Differentiate top and bottom separately.
- Skipping the form check. Applying the rule to a determinate limit gives a wrong answer.
- Applying it to products, differences or powers directly. Rewrite 0 \cdot \infty, \infty - \infty, 1^\infty, 0^0 and \infty^0 as fractions first.
- Forgetting to exponentiate. With the log method, the limit of \ln y is not the final answer. Raise e to it.
- Assuming 1^\infty = 1. It can equal any positive number, as e^k shows.
Quick reference
| Limit | Form | Result |
|---|---|---|
| \lim_{x \to 0} \frac{e^x - 1}{x} | \frac{0}{0} | 1 |
| \lim_{x \to 0} \frac{1 - \cos x}{x^2} | \frac{0}{0} | \frac{1}{2} |
| \lim_{x \to \infty} \frac{x^2}{e^x} | \frac{\infty}{\infty} | 0 |
| \lim_{x \to \infty} \frac{\ln x}{x} | \frac{\infty}{\infty} | 0 |
| \lim_{x \to 0^+} x \ln x | 0 \cdot \infty | 0 |
| \lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x | 1^\infty | e |
| \lim_{x \to 0^+} x^x | 0^0 | 1 |
Practice until the form check is automatic
The hard part of L'Hôpital's rule is not the derivatives. It is recognizing the form, rewriting it correctly, and knowing when to stop. The interactive lesson below gives you a mix of indeterminate forms, checks each step instantly, and points out exactly where a form check or a log was missed.
Practice it now
L'Hôpital's rule
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson