Skip to content
EN - Language: English
MathematicsHigh school

L'Hôpital's rule - limits of the form 0/0 and ∞/∞, step by step

· 14 min read

In short

L'Hôpital's rule works out limits of the form 0/0 or ∞/∞. Instead of the quotient of two functions, you take the limit of the quotient of their derivatives, f′(x)/g′(x). It works because close to a point where both functions are 0, their graphs look like their tangent lines, so the quotient is close to the quotient of the slopes.

Words to know

Indeterminate form
An expression such as 0/0 or ∞/∞ that does not tell you the limit by itself.
Derivative
How fast a function changes at a point - the slope of the tangent to its graph there.
Tangent line
The straight line that runs exactly like the graph at one point. Close up, the graph looks like it.
Quotient of derivatives
f′(x)/g′(x), the derivative of the numerator over the derivative of the denominator.
One-sided limit
The limit as x approaches a from one side only, for example x → 0⁺, from the right.

What do you think?

The functions ff and gg are both 00 at x=0x = 0. If you zoom in close to 00, the graph of ff looks like the line y=3xy = 3x, and the graph of gg like the line y=2xy = 2x. What is lim⁡x→0f(x)g(x)\lim\limits_{x \to 0} \frac{f(x)}{g(x)}?

The idea: compare how fast they shrink

When you substitute the point into a fraction and get 00\frac{0}{0}, the numerator and the denominator both tend to 00. That alone does not tell you the limit: 00\frac{0}{0} is an indeterminate form. The limit could be any number, or there could be none at all. What decides it is how fast each part shrinks.

How fast a function changes is what its derivative measures. Close to a point, the graph of a differentiable function looks like its tangent line. So if f(a)=0f(a) = 0 and g(a)=0g(a) = 0, then near aa

f(x)≈f′(a) (x−a)g(x)≈g′(a) (x−a)\begin{aligned} f(x) &\approx f'(a)\,(x - a) \\ g(x) &\approx g'(a)\,(x - a) \end{aligned}

Divide one by the other, and the factor x−ax - a cancels: the quotient f(x)g(x)\frac{f(x)}{g(x)} is close to f′(a)g′(a)\frac{f'(a)}{g'(a)}. That is L’Hôpital’s rule: in a limit of the form 00\frac{0}{0}, you may replace the two functions by their derivatives.

Zoom in on 0/0, step by step

Go through the animation with the buttons or the arrow keys. The teal graph is ff, and the blue one is gg.

0.511.52-1123h2hh0/0fg

f(1) = 0 · g(1) = 0 · f(1)/g(1) = 0/0

Step 1 of 6
Steps of the animation. Arrow keys move between steps.

These are the graphs of f(x) = x² − 1 and g(x) = ln x. Both cross the x axis at x = 1, so f(1) = 0 and g(1) = 0. We want the limit of f(x)/g(x) as x → 1, but substituting x = 1 gives 0/0, which tells us nothing yet.

We never put x=1x = 1 into the fraction. Every step only looked at points close to 11, just as a limit does. The derivatives answered the question that 00\frac{0}{0} left open: how fast each function shrinks.

Try it yourself: two quotients side by side

Pick a limit and move the point xx towards aa. The upper picture shows ff and gg with the heights f(x)f(x) and g(x)g(x). The lower one shows two graphs: the quotient f(x)g(x)\frac{f(x)}{g(x)}, and the quotient of the derivatives f′(x)g′(x)\frac{f'(x)}{g'(x)}. They are different functions, but when the rule applies, they meet at the same limit.

Limit
x = 2
0.511.522

f(x) = x² − 1g(x) = ln x

The two quotients near the point

0.511.5224

f(x)/g(x)f′(x)/g′(x)

Substitute x = 1
0/0 - the rule applies
f(x)/g(x)
≈ 4.33
f′(x)/g′(x) = 2x/(1/x) = 2x²
8
Limit of f(x)/g(x) as x → 1
2

What to notice:

  • for x2−1ln⁡x\frac{x^2 - 1}{\ln x}, the quotient is not defined at x=1x = 1 (the ring on its graph), but the quotient of the derivatives, 2x22x^2, goes right through that point, at height 22,
  • for 1−cos⁡xx2\frac{1 - \cos x}{x^2}, the quotient of the derivatives, sin⁡x2x\frac{\sin x}{2x}, is 00\frac{0}{0} at 00 again. Using the rule once more gives cos⁡x2\frac{\cos x}{2}, which tends to 12\frac{1}{2},
  • for x2+1x+1\frac{x^2 + 1}{x + 1} at 11, substituting gives 22=1\frac{2}{2} = 1. That is not an indeterminate form, so the limit is simply 11. The quotient of the derivatives, 2x2x, tends to 22: here the rule does not apply, and using it anyway gives a wrong answer.

The rule

L’Hôpital’s rule. Let ff and gg be differentiable near aa (at aa itself they need not be), with g′(x)≠0g'(x) \neq 0 near aa. Suppose that, as x→ax \to a,

  • f(x)→0f(x) \to 0 and g(x)→0g(x) \to 0, or
  • f(x)f(x) and g(x)g(x) both tend to infinity (+∞+\infty or −∞-\infty).

If the limit of f′(x)g′(x)\frac{f'(x)}{g'(x)} exists - a number, or ±∞\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)}.

The same holds for one-sided limits, and for x→∞x \to \infty or x→−∞x \to -\infty.

Three things to keep in mind:

  • Separately. You differentiate the numerator and the denominator separately. This is not the quotient rule: the derivative of the whole fraction has nothing to do with it.
  • Check first, every time. The rule works only for 00\frac{0}{0} and ∞∞\frac{\infty}{\infty}. If the new limit is again 00\frac{0}{0} or ∞∞\frac{\infty}{\infty}, you may use the rule again - but check the form before every step.
  • Other forms need rewriting. 0⋅∞0 \cdot \infty, ∞−∞\infty - \infty, 1∞1^\infty, 000^0 and ∞0\infty^0 are indeterminate too, but they are not quotients. Rewrite them first: a product f⋅gf \cdot g becomes f1/g\frac{f}{1/g}, and a power is handled with logarithms.

Where the name comes from. Guillaume de l’Hôpital (1661-1704), a French marquis and mathematician, published the rule in 1696 in his book Analyse des infiniment petits pour l’intelligence des lignes courbes - the first textbook on differential calculus. The rule itself is credited to Johann Bernoulli. He had taught l’Hôpital, who paid him to share his discoveries. In l’Hôpital’s time his name was spelled l’Hospital, which is why you will see both spellings.

Example 1: 0/0, with the rule used twice

We want lim⁡x→0ex−1−xx2\lim\limits_{x \to 0} \frac{e^x - 1 - x}{x^2}.

Step 1. Check the form

We substitute x=0x = 0 into the numerator and into the denominator.

e0−1−0=002=0\begin{aligned} e^0 - 1 - 0 &= 0 \\ 0^2 &= 0 \end{aligned}

It is 00\frac{0}{0}, so the rule may be used.

Step 2. Differentiate the numerator and the denominator

We differentiate each of them on its own, not the fraction as a whole.

(ex−1−x)′=ex−1(x2)′=2x\begin{aligned} (e^x - 1 - x)' &= e^x - 1 \\ (x^2)' &= 2x \end{aligned}

Step 3. Check the new limit

The new limit is lim⁡x→0ex−12x\lim\limits_{x \to 0} \frac{e^x - 1}{2x}. Substituting x=0x = 0 gives 00\frac{0}{0} again, so we use the rule once more.

e0−12⋅0=00\frac{e^0 - 1}{2 \cdot 0} = \frac{0}{0}

Step 4. Differentiate again

We differentiate the new numerator and the new denominator.

(ex−1)′=ex(2x)′=2\begin{aligned} (e^x - 1)' &= e^x \\ (2x)' &= 2 \end{aligned}

Step 5. Substitute

The limit of ex2\frac{e^x}{2} is not indeterminate, so now we can substitute x=0x = 0.

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

Answer

lim⁡x→0ex−1−xx2=12\lim\limits_{x \to 0} \frac{e^x - 1 - x}{x^2} = \frac{1}{2}. Close to 00, the numerator is about half as big as x2x^2.

Example 2: ∞/∞ - which grows faster?

We want lim⁡x→∞x2ex\lim\limits_{x \to \infty} \frac{x^2}{e^x}.

Step 1. Check the form

As xx grows, both the numerator and the denominator grow without bound.

x2→∞ex→∞\begin{aligned} x^2 &\to \infty \\ e^x &\to \infty \end{aligned}

It is ∞∞\frac{\infty}{\infty}, so the rule may be used.

Step 2. Differentiate once

We differentiate the numerator and the denominator separately.

(x2)′=2x(ex)′=ex\begin{aligned} (x^2)' &= 2x \\ (e^x)' &= e^x \end{aligned}

The new limit, lim⁡x→∞2xex\lim\limits_{x \to \infty} \frac{2x}{e^x}, is still ∞∞\frac{\infty}{\infty}.

Step 3. Differentiate again

We use the rule a second time.

(2x)′=2(ex)′=ex\begin{aligned} (2x)' &= 2 \\ (e^x)' &= e^x \end{aligned}

Step 4. Find the limit

The numerator stays 22 while the denominator grows without bound, so the fraction tends to 00.

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

Answer

lim⁡x→∞x2ex=0\lim\limits_{x \to \infty} \frac{x^2}{e^x} = 0: exe^x grows faster than x2x^2. The same happens with any power xnx^n - after nn uses of the rule the numerator is a constant, and the limit is 00.

Your turn

Find lim⁡x→0+xln⁡x\lim\limits_{x \to 0^+} x \ln x. The sign 0+0^+ means that xx approaches 00 from the right: ln⁡x\ln x exists only for x>0x > 0.

Hintshow

This is a product, not a quotient. Write it as a fraction first: multiplying by xx is the same as dividing by 1x\frac{1}{x}.

Solutiontry it on your own first

Step 1. Check the form

As x→0+x \to 0^+, the first factor tends to 00 and the second to −∞-\infty.

x→0ln⁡x→−∞\begin{aligned} x &\to 0 \\ \ln x &\to -\infty \end{aligned}

That is the form 0⋅∞0 \cdot \infty. It is not a quotient, so the rule cannot be used yet.

Step 2. Write the product as a quotient

Multiplying by xx is the same as dividing by 1x\frac{1}{x}.

xln⁡x=ln⁡x1/xx \ln x = \frac{\ln x}{1/x}

Now the numerator tends to −∞-\infty and the denominator to +∞+\infty: the form ∞∞\frac{\infty}{\infty}.

Step 3. Differentiate the numerator and the denominator

We differentiate each of them on its own.

(ln⁡x)′=1x(1x)′=−1x2\begin{aligned} (\ln x)' &= \tfrac{1}{x} \\ \left(\tfrac{1}{x}\right)' &= -\tfrac{1}{x^2} \end{aligned}

Step 4. Simplify the new quotient

Dividing by a fraction means multiplying by its reciprocal.

1/x−1/x2=1x⋅(−x2)=−x\begin{aligned} \frac{1/x}{-1/x^2} &= \frac{1}{x} \cdot (-x^2) \\ &= -x \end{aligned}

Step 5. Find the limit

As x→0+x \to 0^+, the expression −x-x tends to 00.

lim⁡x→0+xln⁡x=0\lim_{x \to 0^+} x \ln x = \boxed{0}

Answer

lim⁡x→0+xln⁡x=0\lim\limits_{x \to 0^+} x \ln x = 0. The factor xx shrinks to 00 faster than ln⁡x\ln x falls to −∞-\infty.

Common mistakes

  • Using the rule when the form is not 0/0 or ∞/∞. Substituting x=1x = 1 into x2+1x+1\frac{x^2 + 1}{x + 1} gives 22=1\frac{2}{2} = 1, and that is the limit. Differentiating would give 2x1→2\frac{2x}{1} \to 2, which is wrong. Always substitute first.
  • Using the quotient rule. The rule takes the derivative of the numerator over the derivative of the denominator, f′g′\frac{f'}{g'}. It does not differentiate the fraction as a whole.
  • Using the rule once too often. For ex−1x2+x\frac{e^x - 1}{x^2 + x} at 00, one step gives ex2x+1\frac{e^x}{2x + 1}, and substituting gives 11=1\frac{1}{1} = 1. That is the answer. One more step would give ex2→12\frac{e^x}{2} \to \frac{1}{2}, which is wrong: ex2x+1\frac{e^x}{2x + 1} was no longer indeterminate.
  • “No limit of f′/g′ means no limit of f/g.” As x→∞x \to \infty, x+sin⁡xx=1+sin⁡xx\frac{x + \sin x}{x} = 1 + \frac{\sin x}{x} tends to 11. Yet f′g′=1+cos⁡x\frac{f'}{g'} = 1 + \cos x keeps swinging between 00 and 22. When the limit of f′g′\frac{f'}{g'} does not exist, the rule simply says nothing.
  • Forgetting to rewrite other forms. xln⁡xx \ln x as x→0+x \to 0^+ is 0⋅∞0 \cdot \infty. Turn it into a quotient first, as in “Your turn”.

In exams and at university

In the United States, L’Hôpital’s rule is part of both AP Calculus AB and AP Calculus BC, in Unit 4, Contextual Applications of Differentiation. Before using it, students must show that the rule applies: that the numerator and the denominator both tend to 00, or both to infinity. The exams test only the forms 00\frac{0}{0} and ∞∞\frac{\infty}{\infty}. Other indeterminate forms, such as ∞−∞\infty - \infty, are not assessed, although teachers may cover them.

In England, the rule is not part of A-level Mathematics, but it does appear in A-level Further Mathematics. AQA lists evaluating limits with Maclaurin series or l’Hôpital’s rule in its compulsory content, and Pearson Edexcel covers the rule in an optional paper, Further Pure Mathematics 1.

At university, it is a standard topic of first-year calculus. The open textbook Active Calculus, for example, introduces it right after the rules of differentiation, in a section on using derivatives to evaluate limits.

Check yourself

Test yourself

What is lim⁡x→1ln⁡xx−1\lim\limits_{x \to 1} \frac{\ln x}{x - 1}?

What is lim⁡x→∞x3ex\lim\limits_{x \to \infty} \frac{x^3}{e^x}?

Someone differentiates the numerator and the denominator of x2+1x+1\frac{x^2 + 1}{x + 1} and gets lim⁡x→12x1=2\lim\limits_{x \to 1} \frac{2x}{1} = 2. What is lim⁡x→1x2+1x+1\lim\limits_{x \to 1} \frac{x^2 + 1}{x + 1} really?

The limit lim⁡x→af(x)g(x)\lim\limits_{x \to a} \frac{f(x)}{g(x)} has the form 00\frac{0}{0}. Which quotient does L’Hôpital’s rule tell you to look at?

What should you do first with lim⁡x→0+xln⁡x\lim\limits_{x \to 0^+} x \ln x?

Flashcards for review

Flip a card and say whether you knew the answer. The ones you did not know come back at the end of the deck. Why it pays to come back to them in a few days is explained in the guide Spaced repetition.

Flashcards

  1. What does L’Hôpital’s rule say?

    If f(x)g(x)\frac{f(x)}{g(x)} has the form 00\frac{0}{0} or ∞∞\frac{\infty}{\infty} as x→ax \to a, then lim⁡f(x)g(x)=lim⁡f′(x)g′(x)\lim \frac{f(x)}{g(x)} = \lim \frac{f'(x)}{g'(x)}, provided the limit on the right exists.
  2. For which forms can you use the rule straight away?

    Only for 00\frac{0}{0} and ∞∞\frac{\infty}{\infty}.
  3. Do you use the quotient rule in L’Hôpital’s rule?

    No. You differentiate the numerator and the denominator separately.
  4. Why does the rule work for 00\frac{0}{0}?

    Near aa the graphs look like their tangents: 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). The factor x−ax - a cancels, leaving f′(a)g′(a)\frac{f'(a)}{g'(a)}.
  5. What if f′(x)g′(x)\frac{f'(x)}{g'(x)} is again 00\frac{0}{0}?

    Use the rule again - but check the form before every step.
  6. What is lim⁡x→∞x2ex\lim\limits_{x \to \infty} \frac{x^2}{e^x}?

    00. Two steps of the rule give 2ex\frac{2}{e^x}: exe^x grows faster than x2x^2.
  7. How do you deal with a product such as xln⁡xx \ln x as x→0+x \to 0^+?

    It has the form 0⋅∞0 \cdot \infty, so rewrite it as a quotient first: ln⁡x1/x\frac{\ln x}{1/x}, which is ∞∞\frac{\infty}{\infty}.
  8. The limit of f′(x)g′(x)\frac{f'(x)}{g'(x)} does not exist. Does that mean f(x)g(x)\frac{f(x)}{g(x)} has no limit either?

    No - the rule just says nothing then. x+sin⁡xx\frac{x + \sin x}{x} tends to 11 as x→∞x \to \infty, although 1+cos⁡x1 + \cos x has no limit.
  9. Why is lim⁡x→1x2+1x+1\lim\limits_{x \to 1} \frac{x^2 + 1}{x + 1} not a job for L’Hôpital’s rule?

    Substituting gives 22=1\frac{2}{2} = 1, which is not an indeterminate form. The derivatives would give the wrong answer 22.
  10. Who is the rule named after, and who found it?

    Guillaume de l’Hôpital, who published it in 1696 in the first textbook on differential calculus. It is credited to his teacher, Johann Bernoulli.

Sources

We checked the facts on this page against these sources. All of them may be reused freely: they carry an open licence or are not covered by copyright.

  1. Active Calculus (Matthew Boelkins, Grand Valley State University) - 2.8 Using Derivatives to Evaluate Limits (the rule for 0/0 and ∞/∞, local linearity as the reason, checking the conditions each time, x²/eˣ) · CC BY-SA 4.0
  2. Dale Hoffman - Contemporary Calculus, 3.7 L'Hôpital's Rule (the statement, the idea of the proof through tangent lines, repeated use, other indeterminate forms rewritten as quotients, x ln x, the credit to Johann Bernoulli) (PDF) · CC BY 3.0 US
  3. MacTutor History of Mathematics - Guillaume François Antoine Marquis de l'Hôpital (1661-1704, Analyse des infiniment petits of 1696 as the first textbook on differential calculus, the payment to Bernoulli, the spelling l'Hospital) · CC BY-SA 4.0
  4. MacTutor History of Mathematics - Johann Bernoulli (he taught l'Hôpital, and the rule in l'Hôpital's book is credited to him) · CC BY-SA 4.0
  5. Wikibooks - Calculus/L'Hôpital's Rule (the statement for 0/0 and ∞/∞, using the rule again, other indeterminate forms, the rule applies only to indeterminate forms) · CC BY-SA 4.0
  6. Wikipedia - L'Hôpital's rule (the statement, one-sided limits and limits at infinity, the counterexample (x + sin x)/x, history) · CC BY-SA 4.0
  7. Wikipedia - Guillaume de l'Hôpital · CC BY-SA 4.0
  8. Wikipedia - Indeterminate form (0/0, ∞/∞ and the other forms) · CC BY-SA 4.0

More explainers