Calculus

L'Hôpital's Rule

Differentiating top and bottom to crack 0/0 limits

L'Hôpital's rule evaluates indeterminate limits of the form 0/0 or ∞/∞ by replacing f(x)/g(x) with f′(x)/g′(x). The other indeterminate forms — 0·∞, ∞−∞, 0⁰, 1^∞, ∞⁰ — reduce to these two by algebra or logarithms.

  • Statementlim f/g = lim f′/g′ when 0/0 or ∞/∞
  • Applies to limits ata, ±∞, one-sided
  • Required: g′(x)nonzero near a
  • RepeatableYes, while indeterminate
  • Forms it directly handles0/0, ∞/∞
  • Forms it handles after rewriting0·∞, ∞−∞, 0⁰, 1^∞, ∞⁰

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The rule, stated precisely

Suppose f and g are differentiable on an open interval around a (except possibly at a itself), and g′(x) ≠ 0 there. If both

limx→a f(x) = limx→a g(x) = 0    or    limx→a |f(x)| = limx→a |g(x)| = ∞,

and lim f′(x) / g′(x) exists (or is ±∞), then

limx→a f(x) / g(x) = limx→a f′(x) / g′(x).

The rule applies just as well when a = ±∞ or when the limit is one-sided. The proof uses the Cauchy mean value theorem: there is a point c between x and a with [f(x) − f(a)]/[g(x) − g(a)] = f′(c)/g′(c), and as xa the squeezed c drags the ratio with it.

Worked example: limx→0 sin(x)/x = 1

This is the most-quoted limit in calculus. Direct substitution gives 0/0 — indeterminate. Differentiate top and bottom:

limx→0 sin(x)/x = limx→0 cos(x)/1 = cos(0)/1 = 1.

The new limit is no longer indeterminate — direct substitution works. Done. (Pedants will point out that knowing d/dx sin x = cos x already presupposes this limit, so this is a circular proof of the limit itself. True — but L'Hôpital is still a valid verification, and the small-angle approximation sin xx for small x is the underlying geometric fact.)

Worked example: limx→∞ x²/eˣ = 0

Substitution gives ∞/∞. Differentiate twice:

lim x²/ex = lim 2x/ex = lim 2/ex = 0.

This generalises: any polynomial divided by ex has limit zero at infinity. Exponentials beat polynomials.

The seven indeterminate forms

FormExampleHow to handle
0/0limx→0 sin(x)/xDirect L'Hôpital — differentiate top and bottom.
∞/∞limx→∞ ln(x)/xDirect L'Hôpital.
0·∞limx→0⁺ x·ln(x)Rewrite as ln(x)/(1/x) → ∞/∞, then L'Hôpital.
∞−∞limx→0 [1/sin(x) − 1/x]Combine into one fraction → 0/0, then L'Hôpital.
0⁰limx→0⁺Take log: ln L = lim x·ln(x) → use 0·∞ trick.
1^∞limx→∞ (1+1/x)ˣTake log: ln L = lim x·ln(1+1/x) → 0·∞.
∞⁰limx→∞ x^(1/x)Take log: ln L = lim ln(x)/x → ∞/∞.

The last three are exponential forms. The trick is always the same: write y = f(x)g(x), take ln on both sides to get ln y = g(x) ln f(x), evaluate that limit (which becomes 0·∞), then exponentiate to recover y.

Where the rule shows up

Physics limits. Small-amplitude approximations rely on limθ→0 sin(θ)/θ = 1 (pendulum, optics) and limv/c→0 γ = 1 (Newtonian limit of special relativity). Both are L'Hôpital-style cancellations of leading-order behaviour.

Asymptotic comparisons. Computer scientists ask whether n log n grows faster than n1.5. The ratio (n log n)/n1.5 = log n / n0.5 tends to zero by L'Hôpital — so polynomials beat polylogs.

Defining (1 + 1/n)ne. The 1 form. Taking log gives n · ln(1 + 1/n); rewrite as ln(1 + 1/n) / (1/n); apply L'Hôpital to get 1; exponentiate to get e. This is the modern textbook construction of e.

Verifying derivatives at boundary points. Whether a piecewise-defined function has a derivative at a join point reduces to a 0/0 limit — exactly L'Hôpital's territory.

L'Hôpital vs related techniques

L'Hôpital's ruleAlgebraic manipulationSqueeze theoremTaylor expansion
Best when0/0 or ∞/∞ with simple derivativesFactor cancels cleanlyBounded oscillationNeed leading-order behaviour
Worst whenDerivatives more complex than originalsNo factoring possibleNo tight bounds availableFunction not analytic
ReusabilityApply repeatedlySingle shotSingle shotHigher orders give more accuracy
Catches non-existent limitsNoYes (gives concrete form)Yes (no squeeze possible)Yes (oscillating remainders)
Requires differentiabilityYesNoNoYes (smoothness)
Useful for sequencesAfter turning n into xYesYesIndirectly

Common mistakes

  • Applying L'Hôpital to a non-indeterminate form. If lim f/g already substitutes to 3/2 or 0/5, do not differentiate — you get the wrong answer. Direct substitution wins.
  • Differentiating the quotient. The rule asks for f′ and g′ separately, not (f/g)′. The latter is the quotient rule and a different beast.
  • Stopping too early. If f′/g′ is still 0/0, apply L'Hôpital again. Some rational limits need three or four passes.
  • Stopping too late. Once you reach a determinate form, stop. Differentiating further gives spurious answers.
  • Ignoring the side condition. The rule requires g′ ≠ 0 in a punctured neighbourhood. Functions with horizontal-tangent zeros violate this.
  • Treating the rule as one-way. If f′/g′ has no limit, the original ratio may still have one. The classic counter-example is x → ∞ of (x + sin x)/x.

Frequently asked questions

When can I apply L'Hôpital's rule?

Only when direct substitution gives an indeterminate form — specifically 0/0 or ∞/∞. The functions must be differentiable on a punctured neighbourhood of the limit point, g′(x) must be nonzero there, and the limit of f′/g′ must exist (or be ±∞).

Does L'Hôpital's rule work for limits at infinity?

Yes. The rule applies equally to x → a, x → ∞, and one-sided limits, so long as the indeterminate form is 0/0 or ∞/∞.

Can I apply L'Hôpital's rule multiple times in a row?

Yes. If after differentiating you still have 0/0 or ∞/∞, differentiate again. Polynomial-over-polynomial cases sometimes need n applications. Stop as soon as direct substitution yields a determinate value.

What if the limit of f′/g′ doesn't exist?

The rule says nothing in that case — the original limit may or may not exist. The classic counter-example is x→∞ of (x + sin x)/x: the original limit is 1, but the derivative ratio (1 + cos x)/1 oscillates and has no limit.

Why is differentiation 'cancelling' the indeterminacy?

Both f and g vanish (or blow up) at the limit point. Differentiating measures the rates at which they vanish (or blow up). The rule says: the limit of the ratio equals the ratio of the rates.

Are there limits where L'Hôpital is the wrong tool?

Yes. Limits like x→0 of x²·sin(1/x)/x are best handled by squeeze theorems because the derivatives oscillate. And ratios that aren't indeterminate — like sin x / 2 as x → 0 — should never be differentiated; just substitute.