In short
L'Hopital's rule says: if \lim_{x \to a} \frac{f(x)}{g(x)} gives \frac{0}{0} or \frac{\infty}{\infty}, then \lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}, provided the right-hand limit exists. You replace the functions by their derivatives and try the limit again. The rule can be applied repeatedly if the indeterminate form persists.
Consider this limit:
You know the answer is 1 -- you have seen it derived geometrically, with the squeeze theorem, and through numerical tables. But suppose you meet a harder version of the same pattern:
Plugging in x = 0 gives \frac{0}{0}. You cannot factor it. The squeeze theorem does not obviously apply. The standard limits do not match this shape directly.
Build a table to see what is happening:
| x | e^x - 1 - x | x^2 | ratio |
|---|---|---|---|
| 0.1 | 0.00517 | 0.01 | 0.517 |
| 0.01 | 0.0000502 | 0.0001 | 0.502 |
| 0.001 | 5.0002 \times 10^{-7} | 10^{-6} | 0.5000 |
The ratio is clearly heading toward 0.5 = 1/2. But how do you prove this? Is there a general-purpose machine for problems like this?
There is. The idea is almost unreasonably simple: differentiate the numerator and the denominator separately, and take the limit of the new fraction. For the limit above:
So the rule says the original limit equals
Still 0/0. Apply the rule again:
Two applications of differentiation, and the limit falls out. No clever algebraic tricks, no series expansions -- just derivatives.
This is L'Hopital's rule, and it is the single most powerful tool for evaluating indeterminate limits.
Why it should be true
Before stating the rule formally, here is the intuition for why differentiating top and bottom should give the same limit.
When f(a) = 0 and g(a) = 0, both functions are zero at the point a. Near a, each function behaves approximately like a straight line through the origin:
These are the tangent-line approximations. So the ratio becomes
The (x-a) factors cancel, and the limit is the ratio of the derivatives at a. That is exactly what L'Hopital's rule says.
The formal statement
L'Hopital's Rule (0/0 form)
Suppose f and g are differentiable near x = a (except possibly at a itself), and
- \lim_{x \to a} f(x) = 0 and \lim_{x \to a} g(x) = 0, and
- g'(x) \neq 0 near a (except possibly at a), and
- \lim_{x \to a} \frac{f'(x)}{g'(x)} exists (or is \pm\infty).
Then
Reading the definition. Condition 1 says the original limit is 0/0. Condition 2 says the denominator is not flat near a (otherwise you would be dividing by zero in the derivative ratio). Condition 3 is the critical one: the rule only applies when the derivative ratio has a limit. If the derivative ratio oscillates or does something strange, the rule gives no information.
The rule also works when a is replaced by \infty (the limit at infinity) and when the limits are one-sided.
L'Hopital's Rule ($\infty/\infty$ form)
The same statement holds when condition 1 is replaced by
1'. \lim_{x \to a} |f(x)| = \infty and \lim_{x \to a} |g(x)| = \infty.
The \infty/\infty form is not just a corollary of the 0/0 form -- it requires a separate (and slightly harder) proof -- but the use is identical. If the limit gives \infty/\infty, differentiate top and bottom and try again.
One common source of confusion: the rule says "\lim f'(x)/g'(x) exists." It does not say "apply L'Hopital to f'/g' recursively until something works." Each application of the rule is a separate decision -- you must check the conditions (especially the form being 0/0 or \infty/\infty) afresh before each application.
Proof sketch for the 0/0 case
Here is a clean proof when f and g are continuous at a and g'(a) \neq 0, using the mean value theorem.
Since f(a) = g(a) = 0, write
By the Cauchy mean value theorem (a generalisation of the ordinary mean value theorem), there exists a point c between a and x such that
As x \to a, the point c is squeezed between a and x, so c \to a as well. Therefore
That is the entire proof. The Cauchy mean value theorem provides the bridge: it says that the ratio of the differences equals the ratio of the derivatives at some intermediate point, and that intermediate point is forced toward a as x approaches a.
The full proof without the assumption that f and g are continuous at a is more delicate and uses the extended mean value theorem directly on intervals not containing a. The conclusion is the same.
A first worked example
Example 1: A trigonometric limit
Evaluate \displaystyle\lim_{x \to 0} \frac{\tan x - x}{x - \sin x}.
Step 1. Check the form. At x = 0: \tan 0 - 0 = 0 and 0 - \sin 0 = 0. This is 0/0.
Why: confirming 0/0 is mandatory before applying L'Hopital. The rule does not apply to limits that are not indeterminate.
Step 2. Differentiate the numerator and denominator.
Why: the derivative of \tan x is \sec^2 x, and the derivative of \sin x is \cos x. Each differentiation is applied separately to the top and bottom -- not as a quotient rule.
Step 3. Check the new limit. At x = 0: \sec^2 0 - 1 = 0 and 1 - \cos 0 = 0. Still 0/0. Apply the rule again.
Why: the first application did not resolve the indeterminacy. L'Hopital allows repeated application as long as conditions are met.
Step 4. Check again. At x = 0: 2\sec^2 0 \cdot \tan 0 = 0 and \sin 0 = 0. Still 0/0. One more round.
At x = 0: the numerator gives 2(0 + 1) = 2 and the denominator gives 1.
Why: after three applications, the derivatives finally produce nonzero values at x = 0, and the limit can be evaluated by direct substitution.
Result: \displaystyle\lim_{x \to 0} \frac{\tan x - x}{x - \sin x} = 2
The fact that three rounds of L'Hopital were needed is itself informative. Each application of L'Hopital "peels off" one power of x from the numerator and denominator. Since both \tan x - x and x - \sin x start at order x^3, three applications are needed to get past the zeros. The expansion method would have found the answer in one step: \frac{x^3/3 + \cdots}{x^3/6 + \cdots} = \frac{1/3}{1/6} = 2.
A second example: the \infty/\infty form
Example 2: Polynomial vs exponential growth
Evaluate \displaystyle\lim_{x \to \infty} \frac{x^3}{e^x}.
Step 1. Check the form. As x \to \infty: x^3 \to \infty and e^x \to \infty. This is \infty/\infty.
Why: L'Hopital applies to \infty/\infty just as it does to 0/0.
Step 2. Differentiate top and bottom.
Still \infty/\infty. Apply again.
Why: the exponential e^x is its own derivative, so the denominator never changes. But the polynomial degree drops by 1 each time.
Step 3. Still \infty/\infty. One more.
Now the numerator is the constant 6 and the denominator is e^x \to \infty.
Why: a constant divided by something that grows without bound goes to 0. After three differentiations, the polynomial has been reduced to a constant, but the exponential is still growing.
Result: \displaystyle\lim_{x \to \infty} \frac{x^3}{e^x} = 0
This is a general principle: \lim_{x \to \infty} \frac{x^n}{e^x} = 0 for any positive integer n. Each application of L'Hopital reduces the polynomial degree by one, but the exponential stays unchanged. After n applications, the polynomial becomes a constant, and the constant divided by e^x goes to zero. Exponential growth beats polynomial growth, always.
Common confusions
-
"Differentiate the fraction using the quotient rule." No. L'Hopital says to differentiate the numerator and denominator separately -- not as a single quotient. The quotient rule gives a completely different (and wrong) answer. \frac{f'(x)}{g'(x)} is not the same as \left(\frac{f}{g}\right)'(x).
-
"L'Hopital works for every limit." It does not. It works only for 0/0 and \infty/\infty. If the limit is \frac{5}{0} or \frac{3}{7} or \frac{0}{\infty}, you cannot apply the rule. You must check the form every time before applying it.
-
"If L'Hopital gives a finite answer, that answer must be correct." Almost. The rule requires that \lim f'(x)/g'(x) exists (condition 3). If you apply L'Hopital and the derivative ratio has a limit, then yes, that limit is correct. But if the derivative ratio does not have a limit (it oscillates, for instance), the rule is inconclusive -- the original limit might still exist, and you need a different method.
-
"L'Hopital is always the best method." It is the most mechanical, but not always the fastest. The example \frac{\tan x - x}{x - \sin x} needed three rounds of differentiation. The expansion method solves it in one step. For limits with deep cancellation, expansions are usually faster. L'Hopital is best when one or two rounds suffice.
-
"I can apply L'Hopital to limits that are not indeterminate." This is the most dangerous mistake. If the limit is, say, \frac{\sin x}{x + 1} as x \to 0, direct substitution gives \frac{0}{1} = 0. Applying L'Hopital would give \frac{\cos x}{1} \to 1, which is wrong. L'Hopital's rule is only valid for indeterminate forms.
-
"I need to simplify before applying L'Hopital." Not necessarily, but sometimes simplification first makes L'Hopital unnecessary. For \lim_{x \to 2} \frac{x^2 - 4}{x - 2}, you could apply L'Hopital (giving \frac{2x}{1} \to 4), or you could factor: \frac{(x-2)(x+2)}{x-2} = x + 2 \to 4. Both give 4. Factoring is faster here, but L'Hopital is a safety net when factoring is not obvious.
Going deeper
If you came here to learn how to use L'Hopital's rule for limits, you have it. The rest of this section covers the cases where the rule fails, the subtlety of condition 3, and some traps.
When L'Hopital fails: the rule's blind spot
The most important subtlety in L'Hopital's rule is condition 3: \lim f'(x)/g'(x) must exist. If the derivative ratio does not converge, the rule says nothing -- but that does not mean the original limit fails to exist.
The standard counterexample:
This is \infty/\infty. Direct simplification gives 1 + \frac{\sin x}{x} \to 1 + 0 = 1. The limit exists and equals 1.
But applying L'Hopital:
This limit does not exist, because \cos x oscillates between -1 and 1 forever. L'Hopital gives no answer -- not because the original limit doesn't exist, but because the derivative ratio doesn't settle down.
The lesson: L'Hopital's rule is a sufficient condition, not a necessary one. If \lim f'/g' exists, you get the answer. If it does not, you need a different approach -- algebra, expansion, or the squeeze theorem.
Another failure mode: cycling
Sometimes L'Hopital does not oscillate but instead cycles. Consider
This is \infty/\infty. Apply L'Hopital:
Apply again:
You are back where you started. L'Hopital is cycling without making progress.
The fix is algebra: divide numerator and denominator by e^x:
When L'Hopital cycles, it is a signal that the expressions have a structure that differentiation cannot simplify. Algebraic manipulation usually resolves it.
The trap of circular reasoning
A common trap in textbooks: "Prove that \lim_{x \to 0} \frac{\sin x}{x} = 1 using L'Hopital's rule."
Applying L'Hopital gives \lim \frac{\cos x}{1} = 1. Correct? The algebra is fine. But there is a problem: the derivative of \sin x is \cos x only because \lim_{x \to 0} \frac{\sin x}{x} = 1. That limit is used in the derivation of the derivative formula. So using L'Hopital to prove this limit is circular reasoning -- you are assuming the answer to derive the answer.
This does not mean L'Hopital gives the wrong answer. It gives the right answer. It just cannot serve as the proof of this particular limit. The proof must come from the geometric squeeze argument, which does not use derivatives.
The general principle: you cannot use L'Hopital to prove any limit that was itself used to derive the differentiation formulas. The basic limits \frac{\sin x}{x}, \frac{e^x - 1}{x}, and \frac{\ln(1+x)}{x} must be established independently.
Converting other forms to 0/0 or \infty/\infty
L'Hopital directly handles only 0/0 and \infty/\infty. But many other indeterminate forms can be converted into one of these two:
0 \cdot \infty: If f(x) \to 0 and g(x) \to \infty, rewrite f \cdot g as \frac{f}{1/g} (which is 0/0) or \frac{g}{1/f} (which is \infty/\infty). Choose whichever is easier to differentiate.
\infty - \infty: If f(x) \to \infty and g(x) \to \infty, compute f - g algebraically (find a common denominator, rationalise, factor) to convert it into a 0/0 or \infty/\infty quotient.
1^\infty, 0^0, \infty^0: Take the logarithm. This converts f^g into g \ln f, which is a product, and then use the 0 \cdot \infty technique. The full treatment is in the article on Special Limit Forms.
Repeated application and when to stop
L'Hopital can be applied as many times as needed, as long as each intermediate step produces 0/0 or \infty/\infty. In Example 1, three rounds were needed. In principle, you might need four, five, or more.
But if the form changes after differentiation -- say, the numerator is no longer zero or the denominator is no longer infinite -- you must stop and evaluate directly. Applying L'Hopital to a non-indeterminate form gives a wrong answer.
A practical rule: if after two or three rounds the limit is still 0/0 and the expressions are getting more complicated, switch to the expansion method. Series expansion reveals the answer in one step regardless of the order of vanishing.
L'Hopital at infinity
The rule works seamlessly for limits as x \to \infty. The formal statement is identical, with "x \to a" replaced by "x \to \infty." The proof uses a substitution t = 1/x to convert it to a limit at 0.
For example: \lim_{x \to \infty} \frac{\ln x}{x}. This is \infty/\infty.
Logarithms grow slower than any positive power of x. More generally, \lim_{x \to \infty} \frac{\ln x}{x^p} = 0 for any p > 0 -- a single application of L'Hopital gives \frac{1/(px^p)}{1} \to 0.
The hierarchy of growth rates
L'Hopital's rule, applied repeatedly, reveals a fundamental hierarchy:
Each function in this list grows faster than every function to its left. Specifically:
- \lim_{x \to \infty} \frac{\ln x}{x^p} = 0 for any p > 0 (logarithms lose to polynomials)
- \lim_{x \to \infty} \frac{x^n}{e^x} = 0 for any n (polynomials lose to exponentials)
- \lim_{n \to \infty} \frac{a^n}{n!} = 0 for any fixed a (exponentials lose to factorials)
Each of these is an \infty/\infty limit that L'Hopital resolves. The hierarchy is one of the most important qualitative facts in analysis, and it governs everything from the convergence of series to the running time of algorithms.
Where this leads next
L'Hopital's rule is one tool in a toolkit. The most natural next steps:
- Limits Using Expansion -- the series-expansion method, which is the main alternative to L'Hopital for 0/0 limits. Often faster when multiple rounds of L'Hopital are needed.
- Special Limit Forms -- the 1^\infty, 0^0, and \infty^0 forms, which convert to 0/0 or \infty/\infty via the logarithm and then use L'Hopital.
- Indeterminate Forms -- the full classification of the seven indeterminate forms, with strategies for each.
- Derivative -- the definition and computation of derivatives, which is the prerequisite for this rule.
- Cauchy Mean Value Theorem -- the theorem that powers the proof. A generalisation of the ordinary mean value theorem to ratios.