Check the form and conditions for L'Hôpital's rule
A quotient that has no value at 0
Substitute \(x=0\) into \(\dfrac{\sin 3x}{2x}\). The top is 0 and the bottom is 0, so the quotient is \(\frac{0}{0}\), which has no value.
The upper panel shows the top, \(f(x)=\sin 3x\), as a solid curve and the bottom, \(g(x)=2x\), as a dashed line. The orange bars show their heights at the marked \(x\).
Zoom in on \(x=0\). Both bars shrink toward 0, and each curve becomes almost a straight line. Show the tangent lines at 0, which have slopes 3 and 2.
Near 0 the top is close to \(3x\) and the bottom is close to \(2x\), so their quotient is close to \(\frac{3x}{2x}=\frac32\).
The lower panel shows the quotient, with a hole at \(x=0\). Show the limit. The curve approaches the orange line at height \(\frac32\) from both sides of the hole.
Two functions that are both 0 at a
The functions \(f\) and \(g\) are both 0 at \(x=a\), so \(\frac{f(x)}{g(x)}\) has the form \(\frac{0}{0}\) there.
Near \(a\), each function is close to its tangent line. Because \(f(a)=0\) and \(g(a)=0\), \(f(x)\) is close to \(\cy{f'(a)}\,(x-a)\) and \(g(x)\) is close to \(\cy{g'(a)}\,(x-a)\).
The factor \(x-a\) cancels, so the quotient is close to \(\frac{\cy{f'(a)}}{\cy{g'(a)}}\), the ratio of the slopes. This needs \(g'(a)\neq0\), because you cannot divide by 0.
Drag the slider to tilt g. The orange line in the lower panel moves to the new ratio, and the quotient still approaches it at a.
Notation
First find the form of the limit, which says what the top and the bottom approach. It is \(\frac{0}{0}\) if both approach 0, and \(\frac{\infty}{\infty}\) if both grow without bound. These forms are indeterminate, because the form alone does not decide the limit.
\[\begin{gathered} \lim_{x\to a} f(x)=0,\ \lim_{x\to a} g(x)=0 \\ \text{or} \\ \lim_{x\to a} |f(x)|=\infty,\ \lim_{x\to a} |g(x)|=\infty \end{gathered}\]The functions \(f\) and \(g\) must be differentiable near \(a\). Also, \(g'(x)\) must not be 0 near \(a\), so that the quotient of the derivatives, \(\frac{f'(x)}{g'(x)}\), is defined.
If these conditions hold and the limit on the right exists, L'Hôpital's rule states that the two limits are equal.
\[\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{\cy{f'(x)}}{\cy{g'(x)}}\]The limit on the right may be \(\infty\) or \(-\infty\). The rule also holds for one-sided limits and for \(x\to\infty\).
When it fails
As \(x\to\infty\), both \(x+\sin x\) and \(x\) grow without bound, so the form is \(\frac{\infty}{\infty}\). The solid curve below is their quotient, which approaches 1. The dashed curve is the quotient of the derivatives, \(1+\cos x\), which oscillates between 0 and 2 and approaches no number.
The rule gives no answer, because the limit on the right does not exist, but the original limit exists. Algebra finds it: \(\frac{x+\sin x}{x}=1+\frac{\sin x}{x}\), and \(\frac{\sin x}{x}\) approaches 0.
Example 1: A limit at 1
Find \(\displaystyle\lim_{x\to 1}\frac{\ln x}{x^2-1}\).
Substitute \(x=1\) into the top and the bottom. Both are 0, so the form is \(\frac{0}{0}\).
\[\ln 1=0,\qquad 1^2-1=0\]Both functions are differentiable near 1, because \(\ln x\) is differentiable for \(x>0\) and \(x^2-1\) is a polynomial. The bottom's derivative, \(2x\), is not 0 near 1.
\[(x^2-1)'=2x\]The rule applies. The derivatives are \(\frac1x\) and \(2x\), and at \(x=1\) their quotient is \(\frac12\), which is the limit.
\[\lim_{x\to1}\frac{\ln x}{x^2-1}=\lim_{x\to1}\frac{1/x}{2x}=\frac12\]
Example 2: A limit that is not 0 over 0
Find \(\displaystyle\lim_{x\to 0}\frac{e^x-1}{x+3}\).
Substitute \(x=0\) into the top and the bottom. The top is 0 and the bottom is 3.
\[e^0-1=0,\qquad 0+3=3\]A tempting wrong move: The top is 0, so the form is \(\frac{0}{0}\). Differentiate the top and the bottom.
\[\lim_{x\to0}\frac{e^x}{1}=1\]The bottom is 3, not 0, so the form is not \(\frac{0}{0}\). At \(x=0.1\) the quotient is about 0.034, far below the red line at height 1.
The rule does not apply. Because the bottom is not 0 at 0, the quotient is continuous there, so substitution gives the limit.
\[\lim_{x\to0}\frac{e^x-1}{x+3}=\frac{0}{3}=0\]
Practice
Decide whether L'Hôpital's rule applies to \(\displaystyle\lim_{x\to\pi}\frac{\sin x}{x-\pi}\). If it does, find the limit.
Find the top and the bottom at \(x=\pi\). Then compare the slopes of the two curves there.
Solution
At \(x=\pi\), the top is \(\sin\pi=0\) and the bottom is \(\pi-\pi=0\). The form is \(\frac{0}{0}\).
\[\sin\pi=0,\qquad \pi-\pi=0\]Both functions are differentiable, and the derivative of the bottom is 1, which is never 0, so the rule applies.
The derivatives are \(\cos x\) and 1. At \(x=\pi\) their quotient is \(\cos\pi=-1\), so the limit is \(-1\).
\[\lim_{x\to\pi}\frac{\sin x}{x-\pi}=\lim_{x\to\pi}\frac{\cos x}{1}=-1\]
Questions
Questions 1 and 2 use \(f(x)=x^2-4\), the solid curve, and \(g(x)=x-2\), the dashed line.
Both graphs cross the x-axis at \(x=2\). What is the form of \(\displaystyle\lim_{x\to2}\frac{f(x)}{g(x)}\)?
- \(\frac{0}{0}\)
- \(\frac{\infty}{\infty}\)
- A number that is not 0, over 0
- 0, over a number that is not 0
Answer
\(\frac{0}{0}\)
At \(x=-2\) the solid curve is at height 0, but the dashed line is not. Can the rule be used on \(\displaystyle\lim_{x\to-2}\frac{f(x)}{g(x)}\)?
- No, because the bottom approaches \(-4\), not 0.
- Yes, because the top is 0.
- Yes, because \(g'(x)=1\) is not 0.
- No, because \(g'(-2)\) is 0.
Answer
No, because the bottom approaches \(-4\), not 0.
For which limit, as \(x\to0\), can L'Hôpital's rule be used?
- \(\dfrac{e^x+1}{x}\)
- \(\dfrac{\ln(1+x)}{\cos x}\)
- \(\dfrac{1-\cos 2x}{x^2}\)
- \(\dfrac{x^2+2}{e^x}\)
Answer
\(\dfrac{1-\cos 2x}{x^2}\)
Summary
You use L'Hôpital's rule only on \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\), when \(g'\) is not 0 near the point and the limit of \(\frac{f'}{g'}\) exists.
Near the point, each function is close to its tangent line, so the quotient is close to the ratio of the slopes.
If substitution gives a number, that number is the limit and the rule is not needed.
This is one of four skills in topic 4.7 of Which & Why: AP Calculus.