Home / Articles / Calculus
Calculus · 4 min read

L'Hôpital's Rule: When and How to Use It

Learn when L'Hôpital's Rule applies, how to use it on 0/0 and ∞/∞ limits, and how to handle other indeterminate forms, with fully worked examples.

Some limits refuse to give an answer when you simply substitute the value: you get \( \frac{0}{0} \) or \( \frac{\infty}{\infty} \), which tell you nothing. L'Hôpital's Rule is a powerful shortcut that lets you replace a difficult quotient with the quotient of derivatives. Used correctly it saves pages of algebra; used carelessly it produces wrong answers, so let's learn both the "when" and the "how".

What the Rule Says

Suppose \( f \) and \( g \) are differentiable near \( a \) (except possibly at \( a \) itself), \( g'(x) \neq 0 \) near \( a \), and

$$ \lim_{x \to a} \frac{f(x)}{g(x)} \text{ gives } \frac{0}{0} \text{ or } \frac{\pm\infty}{\pm\infty}. $$

Then

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

provided the limit on the right exists (or is \( \pm\infty \)). The rule also works when \( a \) is \( \infty \) or \( -\infty \), and for one-sided limits.

Notice the key point: you differentiate the numerator and the denominator separately. This is not the quotient rule.

When You Can Use It

Before applying the rule, always check the form by direct substitution:

  1. \( \frac{0}{0} \) – rule applies directly.
  2. \( \frac{\infty}{\infty} \) – rule applies directly.
  3. \( 0 \cdot \infty \) – rewrite as a fraction first.
  4. \( \infty - \infty \) – combine into a single fraction first.
  5. \( 1^\infty, \ 0^0, \ \infty^0 \) – take logarithms first, then rewrite as a fraction.

If substitution gives an actual number, such as \( \frac{3}{5} \) or \( \frac{2}{0} \), the rule does not apply. A form like \( \frac{2}{0} \) signals a vertical asymptote, not an indeterminate form.

Worked Example 1: Applying the Rule Twice

Evaluate

$$ \lim_{x \to 0} \frac{e^x - 1 - x}{x^2}. $$

Step 1: Check the form. At \( x = 0 \): numerator \( e^0 - 1 - 0 = 0 \), denominator \( 0 \). So we have \( \frac{0}{0} \).

Step 2: Differentiate top and bottom.

$$ \lim_{x \to 0} \frac{e^x - 1}{2x}. $$

Step 3: Check again. At \( x = 0 \): \( \frac{1 - 1}{0} = \frac{0}{0} \). Still indeterminate, so apply the rule a second time.

Step 4: Differentiate again.

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

So the limit is \( \frac{1}{2} \). This agrees with the Maclaurin series \( e^x = 1 + x + \frac{x^2}{2} + \cdots \), which is a nice way to double-check.

Worked Example 2: The Form \( 0 \cdot \infty \)

Evaluate

$$ \lim_{x \to 0^+} x \ln x. $$

Step 1: Check the form. As \( x \to 0^+ \), \( x \to 0 \) and \( \ln x \to -\infty \). This is \( 0 \cdot (-\infty) \), which is indeterminate but not a quotient.

Step 2: Rewrite as a fraction. Move \( x \) to the denominator as \( \frac{1}{x} \):

$$ x \ln x = \frac{\ln x}{1/x}. $$

Now the form is \( \frac{-\infty}{\infty} \), so the rule applies.

Step 3: Differentiate.

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

So \( \lim_{x \to 0^+} x \ln x = 0 \).

Tip: choose which factor goes to the denominator wisely. Writing it as \( \frac{x}{1/\ln x} \) also works in theory, but the derivatives become messy.

Worked Example 3: An Exponential Form \( 0^0 \)

Evaluate

$$ \lim_{x \to 0^+} x^x. $$

Step 1: Check the form. Base \( \to 0 \), exponent \( \to 0 \): the form \( 0^0 \).

Step 2: Take logarithms. Let \( y = x^x \). Then

$$ \ln y = x \ln x. $$

Step 3: Use Example 2. We already found \( \lim_{x \to 0^+} x \ln x = 0 \). So \( \ln y \to 0 \).

Step 4: Undo the logarithm.

$$ \lim_{x \to 0^+} x^x = e^0 = 1. $$

The same strategy proves the famous result \( \lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x = e \).

Common Mistakes

  • Using the quotient rule. You differentiate \( f \) and \( g \) separately, never \( \left(\frac{f}{g}\right)' \).
  • Not checking the form. For example, \( \lim_{x \to 0} \frac{x + 1}{x + 2} = \frac{1}{2} \) by substitution. Wrongly applying the rule gives \( \frac{1}{1} = 1 \), which is false.
  • Forgetting to recheck after each step. Apply the rule again only if the new limit is still \( \frac{0}{0} \) or \( \frac{\infty}{\infty} \).
  • Skipping the rewrite. Forms like \( 0 \cdot \infty \) and \( \infty - \infty \) must be turned into a single fraction first.
  • Forgetting the final exponent step. After taking logs, remember the answer is \( e^{L} \), not \( L \).

Tips for Exams

  • If repeated differentiation keeps making the expression more complicated (for example \( \frac{\sqrt{x^2+1}}{x} \) cycles back on itself), stop and use algebra instead, such as dividing by the highest power of \( x \).
  • Standard limits like \( \lim_{x \to 0} \frac{\sin x}{x} = 1 \) can often be quoted directly, which is faster.
  • In FSc and A Level papers, show the indeterminate form explicitly in your working. Examiners give marks for it.

Key Takeaways

  • L'Hôpital's Rule applies only to the indeterminate forms \( \frac{0}{0} \) and \( \frac{\infty}{\infty} \).
  • Differentiate the numerator and denominator separately, then take the limit again.
  • Convert \( 0 \cdot \infty \) and \( \infty - \infty \) into fractions, and use logarithms for \( 1^\infty \), \( 0^0 \) and \( \infty^0 \).
  • Recheck the form after every application and stop as soon as substitution gives a number.

Stuck on a tricky limit in your homework or assignment? Send it to Amathify on WhatsApp or through the "Ask a Question" form, and our subject experts and PhD scholars will give you a clear, step-by-step solution.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles