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)

You can evaluate indeterminate limits. L’hopital’s rule handles forms like 0/0 or ±∞/±∞. Take the derivative of the numerator. Take the derivative of the denominator. Repeat until direct substitution works. Verify the indeterminate form first. Differentiate top and bottom independently. Simplify the quotient. Re-evaluate the limit.

Formally, if \(\lim_{x \to c} \frac{f(x)}{g(x)}\) produces the indeterminate quotient \(\frac{0}{0}\) or \(\frac{\pm\infty}{\pm\infty}\), and (f) and (g) are differentiable near (c) with \(g'(x) \neq 0\) near (c), then:

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

provided the limit of \(\frac{f'(x)}{g'(x)}\) exists or equals \(\pm\infty\). L’hopital’s rule applies equally to finite limits \((x \to c)\), one-sided limits \((x \to c^+) or (x \to c^-)\), and limits at infinity \((x \to \infty) or (x \to -\infty)\).

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

Applying l'hopital's rule: when and why

L’Hôpital’s rule applies directly only to two fundamental ratio forms. Before attempting to differentiate, you must substitute the limit point into the function to classify the expression for l’hopital’s rule.

Directly valid indeterminate forms

  • Zero over zero \((\frac{0}{0})\): Both numerator and denominator approach zero simultaneously. Example: \(\lim_{x \to 0} \frac{e^x - 1}{\sin x}\).
  • Infinity over infinity \((\frac{\pm\infty}{\pm\infty})\): Both numerator and denominator grow without bound as (x) approaches the target value. For example, consider \(\lim_{x \to \infty} \frac{\ln x}{x}\).

Indirect indeterminate forms (require algebraic conversion)

Other indeterminate expressions cannot accept L’Hôpital’s rule directly. You must first transform them algebraically into a fraction:

  • Indeterminate product \((0 \cdot \infty)\): Rewrite \(f(x) \cdot g(x)\) as \(\frac{f(x)}{1/g(g(x))}\) or \(\frac{g(x)}{1/f(x)}\) to produce \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\).
  • Indeterminate powers \((1^\infty), (0^0), (\infty^0)\): Let (y = f(x)^{g(x)}). Next, take the natural logarithm to obtain (ln y = g(x) ln f(x)) (which is a \(0 \cdot \infty\) product). Then, compute \(\lim \ln y\), and exponentiate the final result ((e^L)).
  • Indeterminate difference \((\infty - \infty)\): Combine expressions over a common denominator or factor out a dominant term to build a single fraction.

Determinate forms (where L’Hôpital’s rule MUST NOT be used)

If direct substitution yields a determinate value, L’Hôpital’s rule is invalid and gives wrong answers:

  • \(\frac{\text{nonzero}}{\text{nonzero}} = \text{a real constant}\) \(e.g., (\frac{1}{2})\)
  • \(\frac{0}{\text{nonzero}} = 0\)
  • \(\frac{\text{nonzero}}{0} = \pm\infty\) or undefined
  • \(\frac{0}{\infty} = 0\)
  • \(\frac{\infty}{0} = \pm\infty\)
  • \(\infty + \infty = \infty\)

How to use L’Hôpital’s rule step by step

  1. Substitute the limit value first. Check whether direct evaluation gives a defined real number or an infinite limit. If it does, stop—do not differentiate.
  2. Verify the indeterminate form. Confirm that the fraction evaluates strictly to \(\frac{0}{0}\) or \(\frac{\pm\infty}{\pm\infty}\). If dealing with \(0 \cdot \infty\), \(\infty - \infty\), or exponential forms, convert to a quotient first.
  3. Differentiate top and bottom separately. Compute (f'(x)) and (g'(x)) independently. Do not apply the quotient rule to \(\frac{f(x)}{g(x)}\).
  4. Simplify the new fraction algebraically. Cancel common terms, combine rational exponents, or rearrange factors before attempting substitution again.
  5. Evaluate the new limit. Substitute (x = c) into \(\frac{f'(x)}{g'(x)}\). If the result is a finite number or \(\pm\infty\), that is your limit. If it is still \(\frac{0}{0}\) or \(\frac{\pm\infty}{\pm\infty}\), verify differentiability and apply the rule again.
  6. Stop if the expression loops or worsens. If successive differentiation leads to endlessly repeating or increasingly complex terms, abandon L’Hôpital’s rule and switch to factoring, trigonometric identities, or series expansions.

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

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

L'hopital's rule: Two notebooks labeled Science and Math

$$f(x) \approx f(c) + f'(c)(x - c) = f'(c)(x - c)$$

$$g(x) \approx g(c) + g'(c)(x - c) = g'(c)(x - c)$$

Dividing the two approximations yields:

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

The ((x – c)) distance factors cancel out. When both functions head toward zero, their ratio near (c) depends entirely on their relative rates of change—their slopes at that point, a concept elegantly addressed by l’hopital’s rule.

A short proof for the simple case

Assume (f(c) = g(c) = 0), both derivatives are continuous at (c), and \(g'(c) \neq 0\). Because (f(c) = 0) and (g(c) = 0), you can subtract them without changing the ratio, then divide both numerator and denominator 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}}$$

Taking the limit as \(x \to c\), the numerator definition of derivative converges to (f'(c)) and the denominator definition converges to (g'(c)):

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

For more general cases—such as \(\frac{\infty}{\infty}\) limits or limits at infinity—a formal proof for l’hopital’s rule relies on Cauchy’s Generalization of the mean value theorem.

Comparing limit evaluation methods

L’Hôpital’s rule is one of several tools for evaluating indeterminate limits. Choosing the most efficient method saves time and avoids algebraic mistakes.

A person writing calculus equations on a blackboard
Method Best Used For Advantages Disadvantages / Pitfalls
L’Hôpital’s Rule Mixed function types \(e.g., (\frac{e^x}{x^2}), (\frac{\ln x}{x}), (\frac{\sin x}{x})\) Systematic; handles exponential, logarithmic, and trigonometric limits easily Can enter infinite loops; fails if derivatives oscillate; requires differentiability
Algebraic Factoring & Rationalization Rational expressions, polynomials, and radical differences \(e.g., (\frac{x^2 - 4}{x - 2})\) Exact; no derivative calculations required; works directly on simple fractions Limited to algebraic expressions; factoring higher-degree polynomials can be tedious
Taylor / Maclaurin Series Complex trigonometric, exponential, or logarithmic combinations near (x = 0) Bypasses multiple derivative rounds; reveals exact dominant behavior immediately Requires remembering standard series expansions; only applicable around expansion points
Dominant Term Analysis Limits at infinity \((x \to \pm\infty)\) for rational functions and polynomials Instant mental calculation; no written steps required for standard ratios Only valid as \(x \to \pm\infty\); unusable for finite point limits

Worked examples of every indeterminate form

1. Basic \(\frac{0}{0}\) form: \(\lim_{x \to 0} \frac{e^x - 1}{\sin x}\)

Direct substitution yields \(\frac{e^0 - 1}{\sin 0} = \frac{0}{0}\). So, apply L’Hôpital’s rule once by differentiating top and bottom:

$$\lim_{x \to 0} \frac{\frac{d}{dx}(e^x - 1)}{\frac{d}{dx}(\sin x)} = \lim_{x \to 0} \frac{e^x}{\cos x} = \frac{e^0}{\cos 0} = \frac{1}{1} = 1$$

2. Repeated \(\frac{0}{0}\) form (two rounds): \(\lim_{x \to 0} \frac{1 - \cos x}{x^2}\)

Direct substitution gives \(\frac{1 - 1}{0} = \frac{0}{0}\). Differentiate once:

$$\lim_{x \to 0} \frac{\sin x}{2x} \quad \left(\text{still } \frac{0}{0}\right)$$

Differentiate a second time:

$$\lim_{x \to 0} \frac{\cos x}{2} = \frac{\cos 0}{2} = \frac{1}{2}$$

3. Basic \(\frac{\infty}{\infty}\) form: \(\lim_{x \to \infty} \frac{\ln x}{x}\)

As \(x \to \infty\), \(\ln x \to \infty\) and \(x \to \infty\), giving \(\frac{\infty}{\infty}\). So, apply L’Hôpital’s rule:

$$\lim_{x \to \infty} \frac{1/x}{1} = \lim_{x \to \infty} \frac{1}{x} = 0$$

This proves that logarithmic growth is slower than linear polynomial growth.

4. Higher-power \(\frac{\infty}{\infty}\) form: \(\lim_{x \to \infty} \frac{x^2}{e^x}\)

Direct evaluation gives \(\frac{\infty}{\infty}\). Round 1:

$$\lim_{x \to \infty} \frac{2x}{e^x} \quad \left(\text{still } \frac{\infty}{\infty}\right)$$

Round 2:

$$\lim_{x \to \infty} \frac{2}{e^x} = \frac{2}{\infty} = 0$$

5. Combining identities with L’Hôpital: \(\lim_{x \to 0} \frac{\tan x - x}{x^3}\)

Direct substitution yields \(\frac{0}{0}\). Apply the rule once:

$$\lim_{x \to 0} \frac{\sec^2 x - 1}{3x^2}$$

Algebraic simplification example

Instead of differentiating (sec^2 x) (which gets messy), use the Pythagorean identity (sec^2 x – 1 = tan^2 x):

$$\lim_{x \to 0} \frac{\tan^2 x}{3x^2} = \frac{1}{3} \left( \lim_{x \to 0} \frac{\tan x}{x} \right)^2 = \frac{1}{3}(1)^2 = \frac{1}{3}$$

Mixing algebraic simplification or standard limits with L’Hôpital’s rule prevents tedious higher derivatives.

6. Three rounds with checking: \(\lim_{x \to 0} \frac{\sin x - x}{x^3}\)

Direct substitution gives \(\frac{0}{0}\). Differentiate three times, confirming \(\frac{0}{0}\) before each step:

$$\lim_{x \to 0} \frac{\cos x - 1}{3x^2} \to \lim_{x \to 0} \frac{-\sin x}{6x} \to \lim_{x \to 0} \frac{-\cos x}{6} = \frac{-1}{6}$$

This result matches the first non-zero term of the Taylor series for \(\sin x = x - \frac{x^3}{6} + \frac{x^5}{120} - \dots\).

7. Indeterminate product \((0 \cdot \infty)\): \(\lim_{x \to 0^+} x \ln x\)

As \(x \to 0^+\), \(x \to 0\) while \(\ln x \to -\infty\). Rewrite the expression as a quotient for l’hopital’s rule by moving (x) to the denominator as \(\frac{1}{x}\):

$$\lim_{x \to 0^+} \frac{\ln x}{1/x} \quad \left(\text{form } \frac{-\infty}{\infty}\right)$$

Now apply L’Hôpital’s rule:

$$\lim_{x \to 0^+} \frac{1/x}{-1/x^2} = \lim_{x \to 0^+} \left( \frac{1}{x} \cdot (-x^2) \right) = \lim_{x \to 0^+} (-x) = 0$$

Note: If you move (ln x) to the denominator instead, you get \(\frac{x}{1/\ln x}\), whose derivatives become progressively more complicated. Keep logarithmic terms in the numerator for L’Hopital’s Rule.

Indeterminate exponential examples

8. Indeterminate exponential \((1^\infty)\): \(\lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x\)

Direct evaluation gives \(1^\infty\). Set \(L = \lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x\) and take the natural log of both sides:

$$\ln L = \lim_{x \to \infty} x \ln\left(1 + \frac{1}{x}\right) = \lim_{x \to \infty} \frac{\ln(1 + 1/x)}{1/x} \quad \left(\text{form } \frac{0}{0}\right)$$

Apply L’Hôpital’s rule to the right side:

$$\lim_{x \to \infty} \frac{\frac{1}{1 + 1/x} \cdot \left(-\frac{1}{x^2}\right)}{-\frac{1}{x^2}} = \lim_{x \to \infty} \frac{1}{1 + 1/x} = \frac{1}{1 + 0} = 1$$

Since (ln L = 1), exponentiate to solve for (L): (L = e^1 = e).

9. Indeterminate exponential ((0^0)): \(\lim_{x \to 0^+} x^x\)

Set \(L = \lim_{x \to 0^+} x^x\). Taking natural logs yields \(\ln L = \lim_{x \to 0^+} x \ln x\). From Example 7, \(\lim_{x \to 0^+} x \ln x = 0\) by l’hopital’s rule. Therefore, (ln L = 0), which means (L = e^0 = 1).

10. Indeterminate difference \((\infty - \infty)\): \(\lim_{x \to 0} \left( \frac{1}{x} - \frac{1}{\sin x} \right)\)

Combine over a common denominator:

$$\lim_{x \to 0} \frac{\sin x - x}{x \sin x} \quad \left(\text{form } \frac{0}{0}\right)$$

First round of L’Hôpital’s rule:

$$\lim_{x \to 0} \frac{\cos x - 1}{\sin x + x \cos x} \quad \left(\text{still } \frac{0}{0}\right)$$

Second round of L’Hôpital’s rule:

$$\lim_{x \to 0} \frac{-\sin x}{\cos x + \cos x - x \sin x} = \frac{-\sin 0}{2\cos 0 - 0\sin 0} = \frac{0}{2} = 0$$

Growth rates: the ranking behind function limits

Many limits at infinity can be evaluated immediately once you understand the relative hierarchy of function growth rates. For example, as \(x \to \infty\):

A person running alone on a red running track

$$\ln x ll x^p ll a^x ll x! ll x^x \qquad (p > 0, a > 1)$$

The notation “(f(x) ll g(x))” means that \(\lim_{x \to \infty} \frac{f(x)}{g(x)} = 0\). L’Hôpital’s rule proves every link in this hierarchy:

  • Logarithmic vs. Polynomial: One application of L’Hôpital’s rule gives \(\lim_{x \to \infty} \frac{\ln x}{x^p} = \lim_{x \to \infty} \frac{1/x}{p x^{p-1}} = \lim_{x \to \infty} \frac{1}{p x^p} = 0\).
  • Polynomial vs. Exponential: For any integer (k), applying L’Hôpital’s rule (k) times reduces (x^k) to the constant (k!), while (a^x) gains a factor of ((ln a)^k), yielding a limit of (0).

Recognizing this ordering lets you answer exam questions at a glance:

  • \(\lim_{x \to \infty} \frac{x^{10}}{e^x} = 0\) (Exponential dominates polynomial)
  • \(\lim_{x \to \infty} \frac{e^x}{x^5} = \infty\) (Exponential grows faster than polynomial)
  • \(\lim_{x \to \infty} \frac{(\ln x)^2}{\sqrt{x}} = 0\) (Square root grows faster than log squared)

When L’Hôpital’s rule fails

L’Hôpital’s rule is conditional. It states that if \(\lim \frac{f'(x)}{g'(x)}\) exists (or equals \(\pm\infty\)), then it equals \(\lim \frac{f(x)}{g(x)}\). If \(\lim \frac{f'(x)}{g'(x)}\) does not exist due to oscillation, the rule provides no information—even if the original limit exists.

Blue dead end road sign against a clear sky

1. Oscillating derivatives

Consider \(\lim_{x \to \infty} \frac{x + \sin x}{x}\). Direct algebraic division gives \(\lim_{x \to \infty} \left(1 + \frac{\sin x}{x}\right) = 1 + 0 = 1\).

However, applying L’Hôpital’s rule gives \(\lim_{x \to \infty} \frac{1 + \cos x}{1}\). Because (cos x) oscillates between (-1) and (1) endlessly as \(x \to \infty\), this derivative limit does not exist. The rule fails to give an answer, but the original limit is still 1.

2. Endless algebraic loops

Evaluate \(\lim_{x \to \infty} \frac{\sqrt{x^2 + 1}}{x}\). Direct substitution gives \(\frac{\infty}{\infty}\). Applying L’Hôpital’s rule:

$$\lim_{x \to \infty} \frac{\frac{2x}{2\sqrt{x^2 + 1}}}{1} = \lim_{x \to \infty} \frac{x}{\sqrt{x^2 + 1}}$$

Applying l’hopital’s rule again returns the inverse quotient \(\frac{\sqrt{x^2 + 1}}{x}\), trapping you in an infinite loop. Instead, divide numerator and denominator by (x) under the square root: \(\lim_{x \to \infty} \sqrt{1 + \frac{1}{x^2}} = 1\).

Similarly, \(\lim_{x \to \infty} \frac{e^x + e^{-x}}{e^x - e^{-x}}\) flips back and forth infinitely under differentiation. Divide top and bottom by (e^x) to get \(\frac{1 + e^{-2x}}{1 - e^{-2x}} \to 1\).

3. Non-differentiable functions

Functions with sharp turns or cusps (like (|x|) at (x = 0)) are not differentiable across the limit point, making L’Hôpital’s rule inapplicable.

4. Circular logic traps

Attempting to prove \(\lim_{x \to 0} \frac{\sin x}{x} = 1\) using l’hopital’s rule is circular reasoning. The derivative of (sin x) is derived using the geometric fact that \(\lim_{x \to 0} \frac{\sin x}{x} = 1\). See limit of sin x / x for a rigorous geometric proof.

Common mistakes to avoid

  • Differentiating using the quotient rule: Taking \(\frac{d}{dx}\left(\frac{f(x)}{g(x)}\right)\) instead of \(\frac{f'(x)}{g'(x)}\) is the most frequent computational error.
  • Applying the rule to non-indeterminate forms: Differentiating \(\lim_{x \to 0} \frac{\cos x}{x + 1}\) (which is simply \(\frac{1}{1} = 1\)) yields \(\frac{-\sin 0}{1} = 0\), which is wrong. Always verify \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\) first.
  • Forgetting to exponentiate logarithmic transformations: For \(1^\infty\), (0^0), or \(\infty^0\) limits, reporting (ln L) as your final answer instead of (L = e^{ln L}).
  • Differentiating repeatedly without checking intermediate forms: If an intermediate step simplifies to a determinate value \(like (\frac{1}{2})\), applying L’Hôpital’s rule again yields an incorrect result.

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

Test your understanding before checking the solutions below.

A red pencil resting on a red notebook
  1. \(\lim_{x \to 0} \frac{e^{2x} - 1}{x}\)
  2. \(\lim_{x \to 1} \frac{\ln x}{x - 1}\)
  3. \(\lim_{x \to \infty} \frac{x^3}{e^{x}}\)
  4. \(\lim_{x \to 0} \frac{e^x - 1 - x}{x^2}\)
  5. \(\lim_{x \to 0^+} \sqrt{x} \ln x\)
  6. \(\lim_{x \to \infty} \left(1 + \frac{2}{x}\right)^x\)

Answers and Solutions:

1. Answer: 2. Form \(\frac{0}{0}\). Differentiate top and bottom: \(\lim_{x \to 0} \frac{2e^{2x}}{1} = 2\).

2. Answer: 1. Form \(\frac{0}{0}\). Differentiate top and bottom: \(\lim_{x \to 1} \frac{1/x}{1} = 1\).

3. Answer: 0. Form \(\frac{\infty}{\infty}\). Three rounds of L’Hôpital yield \(\lim_{x \to \infty} \frac{6}{e^x} = 0\).

4. Answer: \(\frac{1}{2}\). Form \(\frac{0}{0}\). Round 1 gives \(\frac{e^x - 1}{2x}\) \(still (\frac{0}{0})\). Round 2 gives \(\frac{e^x}{2} \to \frac{1}{2}\).

5. Answer: 0. Rewrite as \(\lim_{x \to 0^+} \frac{\ln x}{x^{-1/2}}\) \(form (\frac{-\infty}{\infty})\). Applying l’hopital’s rule, differentiation yields \(\lim_{x \to 0^+} \frac{1/x}{-\frac{1}{2}x^{-3/2}} = \lim_{x \to 0^+} (-2\sqrt{x}) = 0\).

6. Answer: (e^2). Take natural log: \(\ln L = \lim_{x \to \infty} \frac{\ln(1 + 2/x)}{1/x}\). Apply l’hopital’s rule to get (ln L = 2), so (L = e^2).

Frequently asked questions

How do you pronounce L’Hôpital?

It is pronounced “Low-pee-tal.” It is historically spelled as both L’Hôpital and L’Hospital, named after the French mathematician Guillaume de l’Hôpital.

What if the limit of f’/g’ does not exist?

If the limit of \(\frac{f'}{g'}\) fails to exist because of oscillation, L’Hôpital’s rule is inconclusive. The original limit \(\lim \frac{f}{g}\) may still exist and must be evaluated using algebra, squeeze theorem, or series expansion.

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

No. A non-zero numerator over zero is not an indeterminate form. The limit evaluates directly to \(+\infty\), \(-\infty\), or does not exist due to differing one-sided limits.

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

Near the target point, smooth functions approximate their tangent lines. When both functions pass through zero, their ratio reduces to the ratio of their tangent line slopes, which are their derivatives, a concept central to L’Hopital’s Rule.

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

No. The quotient rule calculates the derivative of a ratio \( \frac{d}{dx} \left[ \frac{f(x)}{g(x)} \right] = \frac{f'g - fg'}{g^2} \). L’Hôpital’s rule evaluates the limit of a ratio by taking independent derivatives of the top and bottom \(\frac{f'(x)}{g'(x)}\).

Can I use L’Hôpital’s rule for discrete sequences?

Not directly, because sequences are defined only for integer inputs and cannot be differentiated. To evaluate \(\lim_{n \to \infty} a_n\), replace integer (n) with real variable (x), apply l’hopital’s rule to the continuous function (f(x)), and apply the result back to the sequence.

Further reading

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

Calculators for this topic

Get new calculus guides by email

Free worked examples and new calculators, at most once a day. Unsubscribe with one click.

Leave a comment

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