practicecalculus
Limit laws

L'Hôpital's Rule: Formula, Conditions and Examples

L'Hôpital's rule evaluates 0/0 and ∞/∞ limits by differentiating the top and bottom. The exact conditions, worked examples and other indeterminate forms.

Limit laws Updated 3 min read

At a glance

\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}
Applies to
Limits of the indeterminate form \frac{0}{0} or \frac{\pm\infty}{\pm\infty}
In words
Differentiate the numerator and the denominator separately, then take the limit again
Also requires
The new limit \lim \frac{f'(x)}{g'(x)} exists or is \pm\infty
Works for
x \to a, one-sided limits and x \to \pm\infty
Other forms
0 \cdot \infty, \infty - \infty, 1^\infty, 0^0, \infty^0 after rewriting
On this page
  1. The rule and its conditions
  2. Worked examples
  3. Other indeterminate forms
  4. Common mistakes

L'Hôpital's rule evaluates limits of fractions that come out as \frac{0}{0} or \frac{\infty}{\infty}. Instead of the original fraction, you take the limit of the derivative of the top over the derivative of the bottom. It is often the fastest way through a limit that algebra cannot easily simplify.

The rule and its conditions

Suppose f and g are differentiable on an open interval around a (except possibly at a), and g'(x) \ne 0 there for x \ne a. If

\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,\ \lim_{x \to a} g(x) = \pm\infty

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 same holds for one-sided limits and for x \to \infty or x \to -\infty.

If the right-hand limit does not exist, the rule tells you nothing. The original limit may still exist.

Graph of y = sin(x)/x approaching 1 at x = 0
At x = 0 the fraction is \frac{0}{0}. L'Hôpital's rule gives \lim_{x \to 0} \frac{\cos x}{1} = 1, matching the graph.

Worked examples

Example 1: \frac{0}{0}. At x = 0, \frac{\sin x}{x} is \frac{0}{0}:

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

(The derivative of \sin x is itself proved using this limit, so in a proof course you would use the squeeze theorem instead. For computation, the shortcut is fine.)

Example 2: applying the rule twice. Each step is still \frac{0}{0} until the last:

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

Example 3: \frac{\infty}{\infty}. As x \to \infty, both \ln x and x grow without bound:

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

So x grows faster than \ln x.

Example 4: 0 \cdot \infty. Rewrite the product as a fraction first. As x \to 0^+, x \ln x has the form 0 \cdot (-\infty):

\lim_{x \to 0^+} x \ln x = \lim_{x \to 0^+} \frac{\ln x}{1/x} = \lim_{x \to 0^+} \frac{1/x}{-1/x^2} = \lim_{x \to 0^+} (-x) = 0

Other indeterminate forms

Form How to rewrite
0 \cdot \infty Write fg as \frac{f}{1/g} or \frac{g}{1/f}
\infty - \infty Combine into one fraction (common denominator or conjugate)
1^\infty, 0^0, \infty^0 Let y = f^g, take \ln y = g \ln f, find that limit, then exponentiate

For example, with y = \left(1 + \frac{1}{x}\right)^x you get \ln y = \frac{\ln(1 + 1/x)}{1/x}, which is \frac{0}{0} as x \to \infty. The rule gives \ln y \to 1, so y \to e.

Common mistakes

  1. Using the rule when the form is not indeterminate. \lim_{x \to 0} \frac{x + 1}{x + 2} = \frac{1}{2} by direct substitution. Differentiating would wrongly give 1.
  2. Using the quotient rule. Differentiate f and g separately. Do not compute the derivative of \frac{f}{g} with the quotient rule.
  3. Skipping the rewrite. The rule only applies to a fraction. Turn products, differences and powers into a fraction first.
  4. Not rechecking the form. Before each repeated application, confirm the new limit is still \frac{0}{0} or \frac{\infty}{\infty}.

For more examples, including limits at infinity and exponent forms, read the full guide to L'Hôpital's rule.

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

Frequently asked questions

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

When direct substitution gives \frac{0}{0} or \frac{\pm\infty}{\pm\infty}, f and g are differentiable near the point, g'(x) \ne 0 near it, and the limit of \frac{f'}{g'} exists or is infinite.

Is L'Hôpital's rule the same as the quotient rule?

No. L'Hôpital's rule takes the derivative of the numerator and the derivative of the denominator separately. The quotient rule finds the derivative of the whole fraction and has nothing to do with this limit.

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

Yes. If the new limit is still \frac{0}{0} or \frac{\infty}{\infty}, apply the rule again. Check the form before every application.

How do you use L'Hôpital's rule for 1 to the infinity?

Take the natural log to turn the power into a product, rewrite that product as a fraction, apply the rule, and then exponentiate the result.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.