On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Introduction to Calculus · Grade 9-12

L'Hopital's Rule

L'Hopital's Rule evaluates a limit that comes out to the indeterminate form 00 or ∞∞ by taking lim⁡f′(x)g′(x) instead of lim⁡f(x)g(x).

lim⁡x→af(x)g(x)=00 or ∞∞lim⁡x→af′(x)g′(x)

Quick Answer

L'Hopital's Rule evaluates a limit that comes out to the indeterminate form 00 or ∞∞ by taking lim⁡f′(x)g′(x) instead of lim⁡f(x)g(x). Use it after substitution gives one of those forms and factoring cannot cancel anything, as with ex−1x at 0 or ln⁡xx as x→∞. Differentiate the top and the bottom separately, not as a quotient, then substitute again, repeating if the form is still indeterminate. Forms like 0⋅∞ must first be rewritten as a fraction.

Why This Matters

Limits of the form 00 sit at the heart of calculus, and many resist algebra: ex−1x, 1−cos⁡xx2, x2ex as x→∞. L'Hopital's rule settles them in a line or two and answers questions like "which grows faster, x10 or ex?" Applied to a limit that is not indeterminate, though, it produces an answer that looks confident and is wrong.

Intuitive Explanation

Near x=0, both ex−1 and x are tiny, so ex−1x looks like a tiny number over a tiny number, which could be anything. What matters is how fast each one shrinks. Zoom in on the graphs and each looks like its tangent line at 0: ex−1≈1⋅x, and x is exactly 1⋅x. Their ratio is then about the ratio of their slopes, 11=1. That is L'Hopital's rule: when top and bottom both head to 0, their ratio approaches the ratio of their derivatives.

The same idea works for ∞∞. As x→∞, both parts of x2ex grow without bound. Apply the rule twice: 2xex, then 2ex→0. So ex outgrows x2, and repeating the argument shows it outgrows every power of x. Each round needs its own check that the form is still 00 or ∞∞.

The rule applies only to those two forms. For cos⁡xx+1 at x=0, substitution gives 11=1 at once; differentiating anyway gives −sin⁡x1→0, a wrong answer. For x+1x at 0 the form is 10, so the function blows up, yet the derivatives 11 would wrongly suggest 1. And L'Hopital is not the quotient rule: you differentiate f and g separately, never the fraction fg as a whole.

Think of it like this. Two runners leave the same line at the same instant. A moment later both are barely past it, so comparing their distances directly is hopeless, but the ratio of their distances is about the ratio of their speeds. That is the rule for 00. The comparison only makes sense if both really started together at zero.

Core idea. For an indeterminate 00 or ∞∞ limit, replace it with the limit of the ratio of derivatives.


When to Use

Use it when direct substitution into a quotient gives 00 or ∞∞ and algebra (factoring, rationalising, a known limit) does not cancel easily: exponentials, logarithms and trig functions mixed with polynomials. For 0⋅∞, ∞−∞ or exponent forms like 1∞, rewrite as a fraction first. If substitution gives a number, or a non-zero number over 0, the limit is already decided and the rule must not be used. For a bounded, oscillating factor, try the Squeeze Theorem.

Tip. Ask: Does plugging in give 00 or ∞∞ in a quotient — and only then?

How to Recognize It

Substitute first, then look at what the substitution produced and at which kinds of functions sit on the top and the bottom.

  1. Is the expression a single fraction f(x)g(x)?

    Yes lets you use the rule once the form is checked. Products like xln⁡x, differences like 1x−1sin⁡x and powers like (1+1x)x must first be rewritten as a quotient, using a common denominator or a logarithm.

  2. Does a factor cancel, or does a known limit like sin⁡xx→1 fit?

    If so, that algebra is usually quicker and safer than derivatives: x2−9x−3 is just x+3. The rule earns its place with mixtures such as ex−1−xx2, where nothing factors.

  3. Does the expression contain a part that keeps oscillating, like sin⁡x as x→∞?

    Then derivatives can make things worse: x+sin⁡xx has the form ∞∞, but 1+cos⁡x1 has no limit. Divide through by x, or use the Squeeze Theorem, to get the true limit, 1.

  4. Are you asked for a limit, rather than a derivative?

    The derivative of a fraction uses the quotient rule, f′g−fg′g2. L'Hopital's Rule never produces the derivative of anything; it only swaps one limit for another.

L'Hopital's Rule compared with Quotient rule, Direct substitution / factoring, and Squeeze Theorem

All four rows can appear in the same limit or derivative problem, and two of them differentiate a fraction. What separates them is what substitution gives, a number, 00 or ∞∞, or a bounded wobble, and whether you want a limit or a derivative.

L'Hopital's Rule

Meaning
Use this when a quotient limit evaluates to the indeterminate form 00 or ∞∞ and algebra is awkward.
Key test
Does plugging in give 00 or ∞∞ in a quotient — and only then?
Formula
lim⁡x→af(x)g(x)=00 or ∞∞lim⁡x→af′(x)g′(x)
Example
Find lim⁡x→0ex−1x.

Quotient rule

Meaning
Differentiates a quotient of functions; L'Hopital differentiates top and bottom SEPARATELY.
Key test
Use the quotient rule to find a derivative, not to evaluate a limit.
Formula
(fg)′=f′g−fg′g2
Example
derivative of xx+1

Direct substitution / factoring

Meaning
Resolves a limit without derivatives when it isn't indeterminate or factors cleanly.
Key test
Use first; only reach for L'Hopital if you actually get 00 or ∞∞.
Example
lim⁡x→2x2−4x−2=4 by factoring

Squeeze Theorem

Meaning
Bounds an oscillating function between two limits; not for 00 quotients.
Key test
Use when the trouble is oscillation, not an indeterminate quotient.
Formula
g≤f≤h
Example
lim⁡x2sin⁡(1/x)=0

Formula & Notation

lim⁡x→af(x)g(x)=00 or ∞∞lim⁡x→af′(x)g′(x)
If lim⁡x→af(x)=lim⁡x→ag(x)=0 (or both ±∞), g′(x)≠0 near a, and lim⁡x→af′(x)g′(x) exists (or is ±∞), then lim⁡x→af(x)g(x)=lim⁡x→af′(x)g′(x).

How to read it: Indeterminate forms: 00, ∞∞, 0⋅∞, ∞−∞, 00, 1∞, ∞0. The last five must be rewritten as 00 or ∞∞ before applying the rule.

Worked Examples

Example 1 — Resolve a 0/0 limit

Easy

Find lim⁡x→0ex−1x.
Show the steps and the answer
  1. Substitute x=0: e0−10=00.

    Both parts go to 0, an indeterminate form, so the rule may be used.

  2. Differentiate the top and the bottom separately: (ex−1)′=ex and (x)′=1.

    The rule compares how fast the two parts approach 0.

  3. Take the new limit: lim⁡x→0ex1=e0=1.

    The new quotient is not indeterminate, so substitution finishes it.

  4. Check numerically: at x=0.01, e0.01−10.01≈1.005.

    Values close to 0 agree with the limit.

Answer: 1

Takeaway: Confirm 00 first, then differentiate the top and bottom separately and substitute again.

Example 2 — Not indeterminate

Standard

Find lim⁡x→0cos⁡xx+1 — can you use L'Hopital?
Show the steps and the answer
  1. Substitute x=0: cos⁡00+1=11=1.

    The result is an ordinary number, not 00 or ∞∞, so the limit is already found.

  2. See what the rule would give: −sin⁡x1→−sin⁡0=0.

    Differentiating a quotient that is not indeterminate changes its limit, here from the true 1 to a false 0.

  3. Conclude: the limit is 1, and L'Hopital's rule does not apply.

    The rule's condition, an indeterminate form, is not met, so its conclusion cannot be trusted.

Answer: 1 by direct substitution (L'Hopital invalid)

Takeaway: Always substitute first; L'Hopital's rule is only for 00 and ∞∞.

Example 3 — Find the mistake: not the quotient rule

Application

Find lim⁡x→0sin⁡3xx. Lou writes: "Using L'Hopital, (sin⁡3xx)′=3xcos⁡3x−sin⁡3xx2, which is still 00 at x=0, so the limit cannot be found." Find the mistake and correct it.
Show the steps and the answer
  1. Confirm the form: sin⁡00=00.

    The rule does apply, so the error is in how Lou used it.

  2. Find the error: Lou applied the quotient rule to the whole fraction.

    L'Hopital's rule differentiates the top and the bottom as separate functions; the derivative of the fraction is a different object.

  3. Differentiate separately: (sin⁡3x)′=3cos⁡3x and (x)′=1.

    The chain rule puts the factor 3 on top.

  4. Take the limit: lim⁡x→03cos⁡3x1=3. Check: at x=0.01, sin⁡0.030.01≈2.9996.

    The new quotient is determinate, and nearby values agree.

Answer: 3

Takeaway: L'Hopital means f′g′, two separate derivatives, never (fg)′.

Where You'll See It

  • Interest compounded every instant

    Compounding n times a year multiplies money by (1+rn)n, a 1∞ form as n→∞. Its logarithm, ln⁡(1+r/n)1/n, is 00, and the rule gives the limit r, so the factor approaches er. At 5%, $1,000 grows to 1000e0.05≈$1,051.27 in a year.

  • Comparing algorithm running times

    Is a sort taking nln⁡n steps faster than one taking n2 for large n? The ratio is nln⁡nn2=ln⁡nn, an ∞∞ form, and the rule gives 1/n1→0. So the nln⁡n method wins by a growing margin as the list gets longer.

Common Mistakes

  1. The slip: Applying it to a non-indeterminate form

    Instead: confirm substitution gives 00 or ∞∞ first, otherwise it is invalid.

  2. The slip: Using the quotient rule instead of separate derivatives

    Instead: differentiate f and g independently, not as fg.

  3. The slip: Stopping or not re-checking

    Instead: if f′g′ is still 00, apply the rule again; rewrite forms like 0⋅∞ as a quotient before using it.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Find lim⁡x→0sin⁡3xx.

    Hint: Check that substitution gives 00, then differentiate the top and bottom separately.

  2. Find lim⁡x→∞ln⁡xx.

    Hint: Both top and bottom grow without bound, so this is ∞∞.

  3. Find lim⁡x→01−cos⁡xx2.

    Hint: After one use of the rule you may still have 00. Check again.

  4. Find lim⁡x→0+xln⁡x.

    Hint: This is 0⋅(−∞). Rewrite it as ln⁡x1/x first.

  5. Which of these limits allows L'Hopital's Rule: lim⁡x→2x2−4x−2 or lim⁡x→2x2+4x+2?

    Hint: Substitute x=2 into each and see which gives an indeterminate form.

  6. A student writes: "lim⁡x→0e2x−1x=lim⁡x→02xe2x−(e2x−1)x2, using the quotient rule." Correct the work.

    Hint: L'Hopital's Rule differentiates two things separately. Which two?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

How can I use the rule on a power like lim⁡x→0+xx?

Take the logarithm first. If y=xxy=x^x, then ln⁡y=xln⁡x=ln⁡x1/x\ln y=x\ln x=\frac{\ln x}{1/x}, which has the form −∞∞\frac{-\infty}{\infty} as x→0+x\to0^+. The rule gives 1/x−1/x2=−x→0\frac{1/x}{-1/x^2}=-x\to0, so ln⁡y→0\ln y\to0 and y→e0=1y\to e^0=1. The last step is the one students forget: the limit you found belongs to ln⁡y\ln y, not to yy.

Can L'Hopital's Rule go round in circles?

Yes. For lim⁡x→∞ex+e−xex−e−x\lim_{x\to\infty}\frac{e^x+e^{-x}}{e^x-e^{-x}}, one application gives ex−e−xex+e−x\frac{e^x-e^{-x}}{e^x+e^{-x}}, the original flipped upside down, and the next flips it back, forever. Dividing the top and the bottom by exe^x instead gives 1+e−2x1−e−2x→1\frac{1+e^{-2x}}{1-e^{-2x}}\to1 at once. When the derivatives are not getting simpler, stop and try algebra.

Did L'Hopital actually discover his rule?

No. Johann Bernoulli worked it out and sent it to the Marquis de L'Hopital, who paid Bernoulli for his mathematical results under a private agreement. L'Hopital published the rule in 1696 in the first textbook on differential calculus. Bernoulli later complained, and letters and lecture notes found long afterwards supported him, but the name stuck; some books call it the Bernoulli-L'Hopital rule.

Learning Path

L'Hopital's Rule

You are here

Next →

Taylor Series
You need Limit, Derivative and Infinity, including what 00 and ∞∞ mean as forms rather than values. L'Hopital's rule replaces such a limit with the limit of f′g′, repeated if needed. Next, Taylor Series explains why the rule works, by writing each function near a point as a polynomial whose leading terms decide the limit.

See Also