Limits

L’Hôpital’s Rule: When and How to Use It (with Examples)

L’Hôpital’s Rule: When and How to Use It (with Examples) — CalculusCalc cover image

L’Hôpital’s rule: if \( \lim_{x\to c}\frac{f(x)}{g(x)} \) has the form \( \frac00 \) or \( \frac{\pm\infty}{\pm\infty} \), and \( f \) and \( g \) are differentiable near \( c \) with \( g'(x)\neq0 \) there, then

$$\lim_{x\to c}\frac{f(x)}{g(x)} = \lim_{x\to c}\frac{f'(x)}{g'(x)}$$

provided the right-hand limit exists (or is \( \pm\infty \)). The rule also works for \( x \to \pm\infty \) and one-sided limits.

Important: differentiate the top and bottom separately. This is not the quotient rule.

L’Hôpital’s rule is the most powerful shortcut for limits that algebra alone can’t crack. Below you’ll find why it works, a step-by-step method, worked examples of every indeterminate form, the cases where it fails, and practice problems with answers.

Why it works

Suppose \( f(c) = g(c) = 0 \). Near \( c \), each function is close to its tangent line (its linear approximation):

$$f(x) \approx f'(c)(x - c), \qquad g(x) \approx g'(c)(x - c)$$

Divide, and the \( (x - c) \) factors cancel, leaving \( \frac{f'(c)}{g'(c)} \). In words: when both top and bottom are heading to zero, what decides the ratio is how fast each one is heading there, and speed is exactly what the derivative measures.

For a quick check with algebra, take \( \lim_{x\to2}\frac{x^2 - 4}{x - 2} \). Factoring gives \( x + 2 \to 4 \), and the rule gives \( \frac{2x}{1} \to 4 \). Same answer.

A short proof (the simple case)

Assume \( f(c) = g(c) = 0 \), both derivatives are continuous at \( c \), and \( g'(c) \neq 0 \). Since \( f(c) \) and \( g(c) \) are zero, you can subtract them without changing anything, then divide top and bottom by \( x - c \):

$$\frac{f(x)}{g(x)} = \frac{f(x) - f(c)}{g(x) - g(c)} = \frac{\dfrac{f(x) - f(c)}{x - c}}{\dfrac{g(x) - g(c)}{x - c}}$$

As \( x \to c \), the top difference quotient tends to \( f'(c) \) and the bottom one to \( g'(c) \). So the ratio tends to \( \frac{f'(c)}{g'(c)} \). The full version, which also covers \( \frac\infty\infty \) and limits at infinity, uses Cauchy’s generalization of the mean value theorem.

How to use it, step by step

  1. Substitute first. If you get a real number or a nonzero number over zero, you’re done (or the limit is infinite). Don’t use the rule.
  2. Identify the form. Only \( \frac00 \) or \( \frac{\pm\infty}{\pm\infty} \) qualify directly. Other forms must be rewritten as a fraction first.
  3. Differentiate top and bottom separately and form the new quotient.
  4. Simplify, then substitute again. If it’s still indeterminate, repeat.
  5. Stop if it isn’t getting simpler. Some limits cycle; switch to algebra or series.

Always check the form first

L’Hôpital only applies to \( \frac00 \) or \( \frac\infty\infty \). For example, \( \lim_{x\to0}\frac{\cos x}{x + 1} \) is simply \( \frac11 = 1 \). Blindly differentiating would give \( \frac{-\sin 0}{1} = 0 \), which is wrong.

Worked examples

1. \( \lim_{x\to0}\frac{e^x - 1}{\sin x} \) (form \( \frac00 \)):

$$\lim_{x\to0}\frac{e^x}{\cos x} = \frac11 = 1$$

2. \( \lim_{x\to0}\frac{1-\cos x}{x^2} \): apply the rule twice.

$$\frac00 \to \lim\frac{\sin x}{2x} \;\left(\tfrac00\text{ again}\right) \to \lim\frac{\cos x}{2} = \frac12$$

3. \( \lim_{x\to\infty}\frac{\ln x}{x} \) (form \( \frac\infty\infty \)): \( \lim\frac{1/x}{1} = 0 \). Logs grow slower than any power of \( x \).

4. \( \lim_{x\to\infty}\frac{x^2}{e^x} \): twice gives \( \lim\frac{2}{e^x} = 0 \). Exponentials beat polynomials.

5. \( \lim_{x\to0}\frac{\tan x - x}{x^3} \): three rounds (or use Taylor series) gives \( \frac13 \). You can shorten it with an identity. After one round you have

$$\lim_{x\to0}\frac{\sec^2x - 1}{3x^2} = \lim_{x\to0}\frac{\tan^2x}{3x^2}$$

using \( \sec^2x - 1 = \tan^2x \). Since \( \frac{\tan x}{x} \to 1 \), the limit is \( \frac13 \). Mixing the rule with known limits is often faster than differentiating again and again.

6. \( \lim_{x\to0}\frac{\sin x - x}{x^3} \): three rounds, checking the form each time.

$$\frac{\cos x - 1}{3x^2} \;\to\; \frac{-\sin x}{6x} \;\to\; \frac{-\cos x}{6}$$

The first two quotients are still \( \frac00 \); the last one can be evaluated at 0, giving \( -\frac16 \). This matches the Taylor series \( \sin x = x - \frac{x^3}{6} + \cdots \).

Other indeterminate forms

Rewrite them as a fraction first.

\( 0\cdot\infty \): \( \lim_{x\to0^+}x\ln x = \lim\frac{\ln x}{1/x} \) (now \( \frac{-\infty}{\infty} \)) \( = \lim\frac{1/x}{-1/x^2} = \lim(-x) = 0 \).

The choice of which factor to move to the denominator matters. Moving \( \ln x \) down instead gives \( \frac{x}{1/\ln x} \), whose derivatives get worse. Usually you keep the log on top.

\( 1^\infty \), \( 0^0 \), \( \infty^0 \): take the log. For \( L = \lim_{x\to\infty}\left(1 + \frac1x\right)^x \):

$$\ln L = \lim_{x\to\infty}x\ln\left(1 + \tfrac1x\right) = \lim\frac{\ln(1 + 1/x)}{1/x} = 1$$

so \( L = e \).

The same recipe handles \( 0^0 \). For \( L = \lim_{x\to0^+}x^x \), take logs: \( \ln L = \lim x\ln x = 0 \), which you found above. So \( L = e^0 = 1 \). For \( \infty^0 \), such as \( \lim_{x\to\infty}x^{1/x} \), the log is \( \frac{\ln x}{x} \to 0 \), so again the limit is 1. Remember the last step: you found \( \ln L \), so exponentiate to get \( L \).

\( \infty - \infty \): combine into one fraction, e.g. with a common denominator. For \( \lim_{x\to0}\left(\frac1x - \frac{1}{\sin x}\right) \), combine to get \( \frac{\sin x - x}{x\sin x} \), which is \( \frac00 \). Two rounds of the rule give \( \frac{-\sin x}{2\cos x - x\sin x} \to \frac02 = 0 \).

Growth rates: the ranking behind many exam questions

Examples 3 and 4 are special cases of a ranking you can use without any calculation once you’ve seen why it holds. As \( x \to \infty \):

$$\ln x \;\ll\; x^p \;\ll\; e^x \qquad (p > 0)$$

Here “\( \ll \)” means the ratio of the left function to the right one goes to 0. For logs versus powers, one round of the rule gives \( \frac{\ln x}{x^p} \to \frac{1/x}{p\,x^{p-1}} = \frac{1}{p\,x^p} \to 0 \). For powers versus exponentials, each round lowers the power of \( x \) by one while \( e^x \) stays the same, so after enough rounds the top is a constant and the limit is 0.

This ranking answers a whole family of limits at a glance: \( \frac{x^{10}}{e^x} \to 0 \), \( \frac{e^x}{x^5} \to \infty \), \( \frac{(\ln x)^2}{\sqrt x} \to 0 \). On a test, it’s often enough to name the dominant term and justify it with one application of the rule.

When L’Hôpital’s rule fails

The rule says: if the limit of \( \frac{f'}{g'} \) exists, it equals the original limit. It says nothing when that limit doesn’t exist.

  • Oscillating derivatives. \( \lim_{x\to\infty}\frac{x + \sin x}{x} = 1 \), since the quotient is \( 1 + \frac{\sin x}{x} \). But the rule gives \( \frac{1 + \cos x}{1} \), which oscillates forever. The original limit exists anyway.
  • Endless loops. \( \lim_{x\to\infty}\frac{\sqrt{x^2 + 1}}{x} \) turns into \( \frac{x}{\sqrt{x^2+1}} \), then back again. Dividing top and bottom by \( x \) gives 1 immediately.

In both cases, algebra (or limits at infinity techniques) is the way out.

Common mistakes

  • Using the quotient rule instead of differentiating separately.
  • Applying the rule when the form isn’t indeterminate.
  • Going in circles: \( \lim\frac{e^x + e^{-x}}{e^x - e^{-x}} \) as \( x\to\infty \) just flips back and forth. Divide by \( e^x \) instead (the answer is 1).
  • Forgetting to exponentiate at the end of a \( 1^\infty \) or \( 0^0 \) problem, and reporting \( \ln L \) as the answer.
  • Proving \( \lim\frac{\sin x}{x} = 1 \) with the rule. That’s circular, as explained in limit of sin x / x.

L’Hôpital’s rule calculator

Enter the top and bottom separately. The gadget checks the form at each round and differentiates until it can substitute:

Series & Limits#18

L'Hôpital's Rule Evaluator

Resolves \(\tfrac{0}{0}\) and \(\tfrac{\infty}{\infty}\) forms by differentiating top and bottom.

The full L’Hôpital’s rule calculator page has more examples, and the limit calculator handles limits that don’t need the rule.

Practice problems

Try these before checking the answers.

  1. \( \lim_{x\to0}\frac{e^{2x} - 1}{x} \)
  2. \( \lim_{x\to1}\frac{\ln x}{x - 1} \)
  3. \( \lim_{x\to\infty}\frac{x^3}{e^{x}} \)
  4. \( \lim_{x\to0}\frac{e^x - 1 - x}{x^2} \)
  5. \( \lim_{x\to0^+}\sqrt{x}\,\ln x \)
  6. \( \lim_{x\to\infty}\left(1 + \frac2x\right)^x \)

Answers: (1) \( 2 \); (2) \( 1 \); (3) \( 0 \); (4) \( \frac12 \), after two rounds; (5) \( 0 \), writing it as \( \frac{\ln x}{x^{-1/2}} \); (6) \( e^2 \), since the log of the limit is \( \lim\frac{\ln(1 + 2/x)}{1/x} = 2 \).

FAQ

How do you pronounce L’Hôpital?

“Low-pee-tal.” It’s also spelled L’Hospital.

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

Then the rule tells you nothing. The original limit may still exist; try another method.

Can I use L’Hôpital’s rule on 1/0?

No. A nonzero number over zero is not indeterminate. The limit is infinite or doesn’t exist, depending on the signs from each side.

Why does L’Hôpital’s rule work?

Near the point, top and bottom behave like their tangent lines, so their ratio behaves like the ratio of their slopes. The proof uses the mean value theorem.

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

No. The quotient rule finds the derivative of a fraction. L’Hôpital’s rule finds the limit of a fraction by taking the derivative of the top and the derivative of the bottom separately, with no cross terms.

Can I use it for sequences?

Not directly, because sequences aren’t differentiable. Replace \( n \) with a real variable \( x \), apply the rule to the function, and the sequence has the same limit.

Further reading

Related: limit of sin x / x, limits at infinity.

Calculators for this topic

Leave a comment

Your email address will not be published. Required fields are marked *