Calculus · Unit 1 · Topic 07

L'Hôpital's rule: 0/0 limits, solved with derivatives.

Short answer

If a limit \(\displaystyle\lim_{x \to a}\frac{f(x)}{g(x)}\) gives \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\) when you substitute, differentiate the numerator and denominator separately and try again:

\[\lim_{x \to a}\frac{f(x)}{g(x)} = \lim_{x \to a}\frac{f'(x)}{g'(x)}\]

provided the new limit exists. You can repeat this as long as the form stays \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\).

Engineering Calculus · Unit 1B Tech / BE Semester IBSc
01

The rule

Before you start: you'll need standard derivatives (see the Derivatives guide). The rule itself is proved using Cauchy's mean value theorem.

L'Hôpital's rule

Suppose that, as \(x \to a\),

1. An indeterminate form

\(f(x) \to 0\) and \(g(x) \to 0\), or \(f(x) \to \pm\infty\) and \(g(x) \to \pm\infty\);

2. Differentiability

\(f\) and \(g\) are differentiable near \(a\), with \(g'(x) \ne 0\) near \(a\) (except possibly at \(a\) itself);

3. The new limit exists

\(\displaystyle\lim_{x \to a}\frac{f'(x)}{g'(x)}\) exists (or is \(\pm\infty\)).

Conclusion

\[\lim_{x \to a}\frac{f(x)}{g(x)} = \lim_{x \to a}\frac{f'(x)}{g'(x)}\]

The rule also works when \(a\) is \(\infty\) or \(-\infty\), and for one-sided limits.

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

02

Why it works

Take the \(\tfrac{0}{0}\) case with \(f(a) = g(a) = 0\). By Cauchy's mean value theorem on \([a, x]\),

\[\frac{f(x)}{g(x)} = \frac{f(x) - f(a)}{g(x) - g(a)} = \frac{f'(c)}{g'(c)} \quad \text{for some } c \text{ between } a \text{ and } x\]

As \(x \to a\), \(c\) is squeezed towards \(a\) too, so \(\dfrac{f(x)}{g(x)}\) and \(\dfrac{f'(c)}{g'(c)}\) have the same limit.

Intuitively: near \(a\), both functions are almost straight lines through zero, \(f(x) \approx f'(a)(x - a)\) and \(g(x) \approx g'(a)(x - a)\). Their ratio is then just the ratio of their slopes.

03

The method

  1. Substitute first. If you get an ordinary number, that's the answer. Use the rule only for \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\).
  2. Differentiate the numerator and the denominator separately.
  3. Substitute again. If it's still \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\), repeat. Check the form every time.
  4. Simplify between steps where you can, using trig identities or standard limits such as \(\dfrac{\sin x}{x} \to 1\). Repeated differentiation can grow messy.

For the other indeterminate forms (\(0\cdot\infty\), \(\infty - \infty\), \(1^\infty\), \(0^0\), \(\infty^0\)), first rewrite them as \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\). That's the next lesson: indeterminate forms.

04

Solved examples

Example 1: The classic

Easy

Evaluate \(\displaystyle\lim_{x \to 0}\frac{\sin x}{x}\).

  1. At \(x = 0\) the form is \(\tfrac{0}{0}\).
  2. Differentiate top and bottom: \(\dfrac{\cos x}{1}\).
  3. Substitute: \(\cos 0 = 1\).

Answer\(1\)

Example 2: Applying the rule twice

Easy

Evaluate \(\displaystyle\lim_{x \to 0}\frac{e^x - 1 - x}{x^2}\).

  1. Form \(\tfrac{0}{0}\). Differentiate: \(\dfrac{e^x - 1}{2x}\), still \(\tfrac{0}{0}\).
  2. Differentiate again: \(\dfrac{e^x}{2}\).
  3. Substitute: \(\dfrac{1}{2}\).

Answer\(\dfrac{1}{2}\)

Example 3: Three times

Medium

Evaluate \(\displaystyle\lim_{x \to 0}\frac{x - \sin x}{x^3}\).

  1. \(\tfrac{0}{0}\): differentiate to get \(\dfrac{1 - \cos x}{3x^2}\), still \(\tfrac{0}{0}\).
  2. Again: \(\dfrac{\sin x}{6x}\), still \(\tfrac{0}{0}\).
  3. Again: \(\dfrac{\cos x}{6} \to \dfrac{1}{6}\). (Or stop one step earlier and use \(\dfrac{\sin x}{x} \to 1\).)

Answer\(\dfrac{1}{6}\)

Example 4: An ∞/∞ limit

Easy

Evaluate \(\displaystyle\lim_{x \to \infty}\frac{\log x}{x}\).

  1. Form \(\tfrac{\infty}{\infty}\). Differentiate: \(\dfrac{1/x}{1} = \dfrac{1}{x}\).
  2. As \(x \to \infty\), \(\dfrac{1}{x} \to 0\).

Answer\(0\). Logarithms grow more slowly than any power of \(x\).

Example 5: Exponentials beat powers

Medium

Evaluate \(\displaystyle\lim_{x \to \infty}\frac{x^3}{e^x}\).

  1. \(\tfrac{\infty}{\infty}\). Differentiate three times: \(\dfrac{3x^2}{e^x}\), then \(\dfrac{6x}{e^x}\), then \(\dfrac{6}{e^x}\).
  2. \(\dfrac{6}{e^x} \to 0\).

Answer\(0\)

Example 6: Simplify along the way

Exam level

Evaluate \(\displaystyle\lim_{x \to 0}\frac{\tan x - x}{x - \sin x}\).

  1. \(\tfrac{0}{0}\). Differentiate: \(\dfrac{\sec^2 x - 1}{1 - \cos x} = \dfrac{\tan^2 x}{1 - \cos x}\).
  2. Instead of differentiating again, simplify: \(\dfrac{\tan^2 x}{1 - \cos x} = \dfrac{\sin^2 x}{\cos^2 x\,(1 - \cos x)} = \dfrac{(1 - \cos x)(1 + \cos x)}{\cos^2 x\,(1 - \cos x)} = \dfrac{1 + \cos x}{\cos^2 x}\).
  3. Substitute \(x = 0\): \(\dfrac{2}{1}\).

Answer\(2\)

Example 7: When the rule says nothing

Exam level

Evaluate \(\displaystyle\lim_{x \to \infty}\frac{x + \sin x}{x}\).

  1. Form \(\tfrac{\infty}{\infty}\). Differentiating gives \(\dfrac{1 + \cos x}{1}\), which keeps oscillating between 0 and 2. It has no limit, so condition 3 fails and the rule tells us nothing.
  2. Divide by \(x\) instead: \(1 + \dfrac{\sin x}{x}\). Since \(|\sin x| \le 1\), \(\dfrac{\sin x}{x} \to 0\).

Answer\(1\). The limit exists even though L'Hôpital's rule couldn't find it.

05

Common mistakes

1. Using the rule when the form isn't indeterminate

\(\displaystyle\lim_{x \to 1}\frac{x^2 + 1}{x + 1} = \frac{2}{2} = 1\) by direct substitution. Wrongly differentiating gives \(\dfrac{2x}{1} \to 2\). Always substitute first.

2. Using the quotient rule

L'Hôpital's rule differentiates top and bottom separately: \(\dfrac{f'}{g'}\), not \(\left(\dfrac{f}{g}\right)'\).

3. Not re-checking the form after each step

After one differentiation you might already have an ordinary number. Differentiating again then gives a wrong answer.

4. Concluding the limit doesn't exist when \(\dfrac{f'}{g'}\) has no limit

As Example 7 shows, the original limit can still exist. The rule simply doesn't apply.

06

How it's asked in exams

  • Evaluate a limit of the form \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\), often needing two or three applications.
  • Find constants \(a\), \(b\) so that a limit has a given value.
  • Combined with other forms: \(0\cdot\infty\), \(\infty - \infty\) and exponential forms first rewritten into \(\tfrac{0}{0}\). See indeterminate forms.
Exam tip

Write the form, \(\left(\tfrac{0}{0}\right)\) or \(\left(\tfrac{\infty}{\infty}\right)\), next to every step. It shows the examiner you checked, and it stops you differentiating one step too many.

07

Practice questions

Try each one on paper before you open the answer.

Q1\(\displaystyle\lim_{x \to 0}\frac{1 - \cos x}{x^2}\)

\(\tfrac{0}{0}\) → \(\dfrac{\sin x}{2x} \to \dfrac{1}{2}\).

Q2\(\displaystyle\lim_{x \to 0}\frac{e^x - e^{-x}}{\sin x}\)

\(\tfrac{0}{0}\) → \(\dfrac{e^x + e^{-x}}{\cos x} \to \dfrac{2}{1} = 2\).

Q3\(\displaystyle\lim_{x \to 0}\frac{\log(1 + x)}{x}\)

\(\tfrac{0}{0}\) → \(\dfrac{1/(1 + x)}{1} \to 1\).

Q4\(\displaystyle\lim_{x \to \pi/2}\frac{1 - \sin x}{\cos x}\)

\(\tfrac{0}{0}\) → \(\dfrac{-\cos x}{-\sin x} \to \dfrac{0}{1} = 0\).

Q5\(\displaystyle\lim_{x \to 0}\frac{a^x - b^x}{x}\)

\(\tfrac{0}{0}\) → \(\dfrac{a^x\log a - b^x\log b}{1} \to \log a - \log b = \log\dfrac{a}{b}\).

Q6\(\displaystyle\lim_{x \to 0}\frac{\sin x - x\cos x}{x^3}\)

\(\tfrac{0}{0}\) → \(\dfrac{\cos x - \cos x + x\sin x}{3x^2} = \dfrac{\sin x}{3x} \to \dfrac{1}{3}\).

Q7\(\displaystyle\lim_{x \to \infty}\frac{x^2}{e^{2x}}\)

\(\tfrac{\infty}{\infty}\) → \(\dfrac{2x}{2e^{2x}}\) → \(\dfrac{2}{4e^{2x}} \to 0\).

Q8Challenge. \(\displaystyle\lim_{x \to 0}\frac{x e^x - \log(1 + x)}{x^2}\)

\(\tfrac{0}{0}\) → \(\dfrac{e^x + xe^x - \frac{1}{1 + x}}{2x}\), still \(\tfrac{0}{0}\).

Again → \(\dfrac{2e^x + xe^x + \frac{1}{(1 + x)^2}}{2} \to \dfrac{2 + 0 + 1}{2} = \dfrac{3}{2}\).

Stuck on a question?

Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.

08

Frequently asked questions

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

Only when direct substitution gives \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\). Other indeterminate forms must be rewritten into one of these first.

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

No. You differentiate the numerator and denominator separately and divide. The quotient rule finds the derivative of a fraction, which is a different thing.

How many times can I apply it?

As many times as needed, provided the form is still \(\tfrac{0}{0}\) or \(\tfrac{\infty}{\infty}\) each time.

Why is it sometimes spelled L'Hospital?

Both spellings refer to the same French mathematician, Guillaume de l'Hôpital. “L'Hospital” is the older spelling, and many Indian textbooks still use it.

Where L'Hôpital's rule leads next

← All 33 Calculus topics
Vipul Sir
Written by Vipul Sir

Vipul Sir has taught mathematics for over 15 years to HSC, CBSE, ICSE, IGCSE/IB, Diploma, Engineering and BSc students at VVS Classes in Goregaon and Vile Parle, Mumbai. He teaches every class himself, concepts first and exam technique second.

First-year Engineering Calculus

Get the whole course right, with Vipul Sir beside you.

Concept-first coaching in small batches in Goregaon and Vile Parle, from the mean value theorems to Gauss's divergence theorem.

WhatsApp↗