IB Mathematics: Analysis and Approaches HL — Topic 5 Calculus
L’Hôpital’s Rule
Recognise the indeterminate forms \(0/0\) and \(\infty/\infty\), differentiate numerator and denominator separately, and repeat only when the new quotient is still indeterminate.
Learning goal
Use l’Hôpital’s rule to evaluate limits that initially produce an indeterminate quotient. Decide when the rule applies, when it does not, and how to use it repeatedly.
Syllabus link
AHL 5.13 Limits as \(x\to a\) or \(x\to\infty\), using l’Hôpital’s rule or Maclaurin series; indeterminate forms \(0/0\) and \(\infty/\infty\); repeated use of the rule.
Big idea
When both numerator and denominator approach zero or both become unbounded, the original quotient may be hard to read. l’Hôpital’s rule compares their instantaneous rates of change instead.
Allowed forms
Use the rule only after direct substitution produces \(0/0\) or \(\infty/\infty\).
The problem: a quotient that refuses to give an answer
Substitution is always the first step when evaluating a limit. Sometimes it gives a useful answer immediately. But sometimes it gives an expression such as
which is called an indeterminate form. The word indeterminate matters: it means the form alone does not determine the value of the limit.
A motivating question
Evaluate
Solution
Substitution gives
so the limit is not found by direct substitution. The numerator and denominator both approach zero, but the limit depends on how fast they approach zero.

The slopes shown on the diagram come from the gradients of the tangent lines at \(x=0\). For the numerator, \(N(x)=e^{2x}-1\), so \(N'(x)=2e^{2x}\) and therefore \(N'(0)=2\). For the denominator, \(D(x)=\sin(3x)\), so \(D'(x)=3\cos(3x)\) and therefore \(D'(0)=3\). So, very close to \(x=0\), the numerator behaves approximately like \(2x\) and the denominator behaves approximately like \(3x\). Hence
l’Hôpital’s rule makes this intuition precise.
l’Hôpital’s Rule
Use this video alongside the first part of the lesson for a guided explanation of the idea, method and worked examples.
The rule and its conditions
l’Hôpital’s rule
Suppose \(f\) and \(g\) are differentiable near \(x=a\) (except possibly at \(a\) itself), with \(g'(x)\ne0\) nearby for \(x\ne a\), and suppose
If the derivative quotient has a limit, then
The same idea applies to the indeterminate form \(\frac{\infty}{\infty}\) and to limits as \(x\to\infty\).
Before using the rule, check these points
It must be a quotient: \(\frac{f(x)}{g(x)}\).
Direct substitution must give \(\frac00\) or \(\frac{\infty}{\infty}\).
Differentiate the numerator and denominator separately. Do not use the quotient rule.
If the new quotient is still indeterminate, the rule may be used again.
If substitution does not give an indeterminate form, do not use l’Hôpital’s rule.
A safe method for IB AA HL
Try direct substitution.
State the indeterminate form, for example \(\frac00\) or \(\frac{\infty}{\infty}\).
Differentiate the numerator and denominator separately.
Substitute again.
Repeat only if the new expression is still indeterminate.
Finish with a clear exact answer when possible.
Notation tip
A good line of working is:
The symbol above the equals sign is not required, but it reminds the reader why l’Hôpital’s rule is allowed.
Worked example 1: a basic \(\frac00\) limit
Question. Evaluate
Solution
Direct substitution gives
so l’Hôpital’s rule may be used.
Answer: \(\frac23\)
Worked example 2: repeated use
Question. Evaluate
Solution
Direct substitution gives \(\frac00\), so use l’Hôpital’s rule.
This is still \(\frac00\), so use l’Hôpital’s rule again:
Answer: \(\frac12\)
Worked example 3: a \(\frac{\infty}{\infty}\) limit
Question. Evaluate
Solution
As \(x\to\infty\),
so the expression has form \(\frac{\infty}{\infty}\). Use l’Hôpital’s rule:
Answer: \(0\)
Worked example 4: repeated use with trigonometry
Question. Evaluate
Solution
Direct substitution gives \(\frac00\).
This is still \(\frac00\), so use l’Hôpital’s rule again:
This is still \(\frac00\), so use l’Hôpital’s rule a third time:
Answer: \(\frac13\)
When not to use l’Hôpital’s rule
Common trap
l’Hôpital’s rule is not a magic rule for every limit. It only applies to a quotient with an indeterminate form \(\frac00\) or \(\frac{\infty}{\infty}\).
Worked example 5: a non-example
Question. Explain why l’Hôpital’s rule should not be used directly on
Solution
Direct substitution does not give \(\frac00\) or \(\frac{\infty}{\infty}\):
The numerator approaches \(1\), while the denominator approaches \(0^+\). Therefore
l’Hôpital’s rule is not appropriate because the expression is not indeterminate.
l’Hôpital’s rule and Maclaurin series
The AA HL syllabus also allows some of these limits to be evaluated using Maclaurin series. This is often a useful check.
Worked example 6: using a Maclaurin check
Question. Re-evaluate
using a Maclaurin expansion.
Solution
Since
we have
Therefore
and so
This agrees with the repeated l’Hôpital’s rule result.
Rewriting before using l’Hôpital’s rule
Some limits do not begin as a quotient of the form \(\frac00\) or \(\frac{\infty}{\infty}\). In these cases, the main skill is to rewrite the expression first. Only then can we decide whether l’Hôpital’s rule is useful.
Important idea
Do not force l’Hôpital’s rule immediately. First identify the indeterminate form, then rewrite it into a quotient if possible.
Worked example 7: a product form \(0\cdot\infty\)
Question. Evaluate
Solution
Direct substitution gives the indeterminate product form
This is not a quotient yet, so rewrite \(x\) as \(\frac{1}{1/x}\):
Therefore
This now has form \(\frac{-\infty}{\infty}\), so l’Hôpital’s rule may be used:
Answer: \(0\)
Worked example 8: an \(\infty-\infty\) form
Question. Evaluate
Solution
Direct substitution gives the indeterminate form
Rationalise the expression:
Now divide the numerator and denominator by \(x\):
Therefore
Answer: \(\frac12\)
Note. After rewriting, l’Hôpital’s rule was not needed. The algebra did the work.
Worked example 9: an \(\infty-\infty\) form that leads to l’Hôpital’s rule
Question. Evaluate
Solution
Direct substitution gives the indeterminate form
Combine the two fractions:
So
Substitution now gives \(\frac00\), so l’Hôpital’s rule may be used:
This is still \(\frac00\), so use l’Hôpital’s rule again:
Now substitute \(x=0\):
Answer: \(\frac12\)
Practice questions
Evaluate each limit, or explain why l’Hôpital’s rule is not appropriate.
\(\displaystyle \lim_{x\to0}\frac{\sin(5x)}{2x}\)
\(\displaystyle \lim_{x\to0}\frac{e^{3x}-1}{x}\)
\(\displaystyle \lim_{x\to0}\frac{1-\cos(2x)}{x^2}\)
\(\displaystyle \lim_{x\to\infty}\frac{\ln x}{x}\)
\(\displaystyle \lim_{x\to\infty}\frac{x^2}{e^x}\)
\(\displaystyle \lim_{x\to0}\frac{\tan x-x}{x^3}\)
Explain why l’Hôpital’s rule should not be used directly on \(\displaystyle \lim_{x\to0}\frac{x^2+1}{x}\).
Find the value of \(k\) if
\[\lim_{x\to0}\frac{e^{kx}-1}{\sin(2x)}=3.\]Evaluate \(\displaystyle \lim_{x\to0}\frac{x-\sin x}{x^3}\).
True or false? If \(\displaystyle \lim_{x\to a}\frac{f(x)}{g(x)}\) gives \(\frac00\), then one use of l’Hôpital’s rule always gives the final answer. Explain.
Answer key
Practice answers
Since direct substitution gives \(\frac00\),
\[\lim_{x\to0}\frac{\sin(5x)}{2x}=\lim_{x\to0}\frac{5\cos(5x)}{2}=\frac52.\]- \[\lim_{x\to0}\frac{e^{3x}-1}{x}=\lim_{x\to0}\frac{3e^{3x}}{1}=3.\]
- \[\begin{gathered}\lim_{x\to0}\frac{1-\cos(2x)}{x^2} \\=\lim_{x\to0}\frac{2\sin(2x)}{2x} \\=\lim_{x\to0}\frac{4\cos(2x)}{2}\\=2.\end{gathered}\]
- \[\lim_{x\to\infty}\frac{\ln x}{x} =\lim_{x\to\infty}\frac{1/x}{1}=0.\]
This is \(\frac{\infty}{\infty}\). Use l’Hôpital’s rule twice:
\[\begin{gathered}\lim_{x\to\infty}\frac{x^2}{e^x} \\=\lim_{x\to\infty}\frac{2x}{e^x} \\=\lim_{x\to\infty}\frac{2}{e^x}\\=0.\end{gathered}\]From Worked example 4,
\[\lim_{x\to0}\frac{\tan x-x}{x^3}=\frac13.\]Direct substitution gives
\[\frac{x^2+1}{x}\to \frac{1}{0},\]not \(\frac00\) or \(\frac{\infty}{\infty}\). The expression is not indeterminate, so l’Hôpital’s rule should not be used directly. The two-sided limit does not exist because the expression tends to \(+\infty\) from the right and \(-\infty\) from the left.
Direct substitution gives \(\frac00\). Then
\[\begin{gathered}\lim_{x\to0}\frac{e^{kx}-1}{\sin(2x)} \\=\lim_{x\to0}\frac{ke^{kx}}{2\cos(2x)}\\=\frac{k}{2}.\end{gathered}\]Therefore \(\frac{k}{2}=3\), so \(k=6\).
Direct substitution gives \(\frac00\).
\[\lim_{x\to0}\frac{x-\sin x}{x^3} =\lim_{x\to0}\frac{1-\cos x}{3x^2}.\]This is still \(\frac00\), so
\[\lim_{x\to0}\frac{1-\cos x}{3x^2} =\lim_{x\to0}\frac{\sin x}{6x}.\]This is still \(\frac00\), so
\[\lim_{x\to0}\frac{\sin x}{6x}=\lim_{x\to0}\frac{\cos x}{6}=\frac16.\]False. Sometimes the new quotient is still indeterminate and l’Hôpital’s rule must be used again. For example,
\[\lim_{x\to0}\frac{1-\cos x}{x^2}\]requires two uses of l’Hôpital’s rule.