Unit 4 · Topic 4.7

Use L’Hôpital’s rule carefully

Builds on indeterminate forms, the definition of the derivative and tangent-line approximation. 13 minutes.

  1. Example 1Check the form and conditions for L'Hôpital's rule
  2. Example 2Differentiate numerator and denominator separately
  3. Example 3Check the form again after each step
  4. Example 4Rewrite other indeterminate forms

A limit of a quotient,

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

has the indeterminate form \(\frac00\) when the numerator \(f(x)\) and the denominator \(g(x)\) both approach 0. It has the indeterminate form \(\frac{\infty}{\infty}\) when both grow without bound in size. Neither form decides the limit (topics 1.6 and 1.15), and the rewrites of topic 1.6 need a common factor that algebra can expose. This topic finds such limits from the derivatives of \(f\) and \(g\), and then turns other indeterminate forms into quotients.

The ratio of the slopes

Two graphs, one above the other, with no numbers on the axes. Above, a solid curve f that bends upward and a dashed curve g that bends downward cross the horizontal axis at the point a, where f rises and g falls, and an orange tangent line touches each curve there. Below, the quotient f over g has an open ring at a and approaches an orange dashed line at the height f prime of a over g prime of a. A slider narrows the window around a: the curves straighten onto their tangent lines, and the quotient flattens onto the orange line. A toggle lifts the graph of f so that it no longer crosses the axis at a. The quotient then leaves the lower graph on both sides of a, and the dashed line turns red.

Figure 1The solid curve is the numerator \(f\) and the dashed curve is the denominator \(g\), with their orange tangent lines at \(a\). Below, the quotient \(f/g\) has an open ring at \(a\), and the orange dashed line is at the height \(f'(a)/g'(a)\). The line turns red when the graph of \(f\) is lifted, because the quotient then no longer approaches it.

In Figure 1, the solid curve is the graph of the numerator \(f\), and the dashed curve is the graph of the denominator \(g\). Both cross the horizontal axis at \(a\), so \(f(a)=0\) and \(g(a)=0\). The lower graph plots the quotient \(f(x)/g(x)\), which has no value at \(a\).

Zoom in on \(a\) with the slider or the button. Both curves straighten onto their orange tangent lines, because each function is close to its tangent line near the point of tangency (topic 4.6). The tangent lines pass through \((a,0)\) with slopes \(\cy{f'(a)}\) and \(\cy{g'(a)}\), so their heights at \(x\) are \(\cy{f'(a)}\,(x-a)\) and \(\cy{g'(a)}\,(x-a)\). In the quotient of these heights, the factor \(x-a\) cancels and leaves the ratio of the slopes. In the lower graph, the curve of \(f/g\) flattens onto the orange dashed line at that height.

The argument becomes a proof when \(f\) and \(g\) are differentiable at \(a\), \(f(a)=g(a)=0\) and \(g'(a)\neq0\). For \(x\neq a\), write \(f(x)\) as \(f(x)-f(a)\) and \(g(x)\) as \(g(x)-g(a)\), which changes nothing because \(f(a)=g(a)=0\). Then divide the numerator and the denominator by \(x-a\), which is not 0:

\[\frac{f(x)}{g(x)}=\frac{\dfrac{f(x)-f(a)}{x-a}}{\dfrac{g(x)-g(a)}{x-a}}\]

As \(x\to a\), the two difference quotients approach \(\cy{f'(a)}\) and \(\cy{g'(a)}\), because \(f\) and \(g\) are differentiable at \(a\) (topic 2.2). Near \(a\), the values of the difference quotient of \(g\) are close to \(g'(a)\), which is not 0, so they are not 0 either. Neither is \(g(x)\) for \(x\neq a\), because it equals this difference quotient times \(x-a\). The denominator of the fraction above approaches \(g'(a)\), which is not 0, so the quotient law (topic 1.5) gives

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

If \(f'\) and \(g'\) are continuous at \(a\), then \(f'(a)\) and \(g'(a)\) are the limits of \(f'(x)\) and \(g'(x)\) as \(x\to a\). The limit of \(f(x)/g(x)\) is therefore the limit of \(f'(x)/g'(x)\). This result is a case of L’Hôpital’s rule, which the AP exam and some books spell L’Hospital’s rule. It differentiates the numerator and the denominator separately. It is not the quotient rule. The quotient rule gives the derivative of \(f/g\), which is the slope of the lower graph, not the height that the graph approaches.

The rule holds under weaker hypotheses, which the box lists. The functions need to be differentiable only near \(a\), not necessarily at \(a\), and \(g'(x)\) must not be 0 near \(a\), except possibly at \(a\). The limit of \(f'(x)/g'(x)\) must exist, or be \(\infty\) or \(-\infty\). The form may be \(\frac{\infty}{\infty}\), the limit may be one-sided, and \(x\) may approach \(\infty\) or \(-\infty\) instead of \(a\). The general rule is proved with Cauchy’s Mean Value Theorem, which extends the Mean Value Theorem of Unit 5. This page proves only the case above.

If \(f'(x)/g'(x)\) has no limit, not even \(\infty\) or \(-\infty\), the rule gives no answer. As \(x\to\infty\), the quotient \(\frac{x+\sin x}{x}\) has the form \(\frac{\infty}{\infty}\). It equals \(1+\frac{\sin x}{x}\), which approaches 1 by the Squeeze Theorem (topics 1.8 and 1.15). The quotient of the derivatives, \(1+\cos x\), oscillates between 0 and 2 and approaches no number.

The rule needs the form \(\frac00\) or \(\frac{\infty}{\infty}\). Use the toggle under Figure 1 to lift the graph of \(f\). The figure zooms back out, \(f(a)\) becomes positive, and the tangent lines keep their slopes. Near \(a\), the numerator is now close to \(f(a)\) while the denominator is close to 0, so the quotient grows without bound in size. Its curve leaves the lower graph on both sides of \(a\), and the limit does not exist. The ratio of the slopes, now on the red line, is a wrong answer.

Repeating the rule

If \(f'(x)/g'(x)\) again has the form \(\frac00\) or \(\frac{\infty}{\infty}\), and \(f'\) and \(g'\) meet the hypotheses, apply the rule to it. The next quotient is \(f''/g''\), and the rule can be applied again in the same way. Find the form of each new quotient before you differentiate again. Stop at the first quotient whose form is not indeterminate. Find its limit with the limit laws. For a nonzero number over 0, each one-sided limit is \(\infty\) or \(-\infty\), with the sign of the quotient on that side (topic 1.14).

In a chain such as \(\lim\frac{f}{g}=\lim\frac{f'}{g'}=\lim\frac{f''}{g''}\), the equal signs hold from the end. The last limit exists, so the rule gives the equal sign before it, and so on back to the first. If the form at some step is 0 over a nonzero number, or a nonzero number over 0, the rule no longer applies. Another differentiation can then give a wrong answer.

Other indeterminate forms

A product \(u\,v\) in which \(u\to0\) and \(|v|\to\infty\) has the indeterminate form \(0\cdot\infty\). As a quotient, \(u\,v=\frac{u}{1/v}\) has the form \(\frac00\), and \(u\,v=\frac{v}{1/u}\) has the form \(\frac{\infty}{\infty}\). Each rewrite keeps every value where it is defined, so the limit is the same. Choose the quotient whose derivatives are simpler.

A difference of two expressions that both approach \(\infty\) has the form \(\infty-\infty\). Write it as one fraction, over a common denominator or with a conjugate (topic 1.6). Then find the form of the result.

A power \(y=b^{p}\) with a base \(b>0\) has the form \(1^{\infty}\), \(0^{0}\) or \(\infty^{0}\) when its base and its exponent \(p\) approach these values. In each case its logarithm, \(\ln y=p\ln b\), is a product of the form \(0\cdot\infty\), which you rewrite as a quotient. If \(\ln y\) approaches a number \(L\), then \(y=e^{\ln y}\) approaches \(e^{L}\), because a limit passes through the continuous function \(e^x\) (topics 1.5 and 1.12).

Example 1

Check the form and conditions for L'Hôpital's rule

Let \(q(x)=\dfrac{3^x-1}{x^2-x}\). Find \(\displaystyle\lim_{x\to 0}q(x)\) and \(\displaystyle\lim_{x\to 1}q(x)\).

Solution

The numerator and the denominator are differentiable everywhere, so they are continuous. As \(x\to0\), they approach their values at 0, \(3^0-1=0\) and \(0^2-0=0\), so the form is \(\frac00\). The derivative of the denominator, \(2x-1\), is 0 only at \(x=\frac12\), so it is not 0 near 0. The rule applies:

\[\begin{aligned}\lim_{x\to 0}\frac{3^x-1}{x^2-x}&=\lim_{x\to 0}\frac{3^x\ln 3}{2x-1}\\&=\frac{\ln 3}{-1}=-\ln 3\end{aligned}\]

At \(x=1\), the numerator approaches \(3^1-1=2\), but the denominator approaches 0. The form \(\frac20\) is not indeterminate, so the rule does not apply. The denominator \(x(x-1)\) is negative for \(0<x<1\) and positive for \(x>1\). The numerator is near 2, so \(q(x)\to-\infty\) as \(x\to1^-\) and \(q(x)\to\infty\) as \(x\to1^+\). The limit at 1 does not exist.

Example 2

Differentiate numerator and denominator separately

Find \(\displaystyle\lim_{x\to\infty}\frac{\ln\left(x^2+1\right)}{\ln x}\).

Solution

As \(x\to\infty\), the numerator and the denominator both grow without bound, so the form is \(\frac{\infty}{\infty}\). For \(x>1\), both are differentiable, and the derivative of the denominator, \(\frac1x\), is not 0. Differentiate each one separately, the numerator with the chain rule:

\[\begin{aligned}\frac{d}{dx}\ln\left(x^2+1\right)&=\frac{2x}{x^2+1}\\\frac{d}{dx}\ln x&=\frac1x\end{aligned}\]

The new quotient simplifies to a quotient of polynomials of equal degree, whose limit is the ratio of the leading coefficients (topic 1.15):

\[\lim_{x\to\infty}\frac{2x/\left(x^2+1\right)}{1/x}=\lim_{x\to\infty}\frac{2x^2}{x^2+1}=2\]

As a check by another route, \(\ln\left(x^2+1\right)=2\ln x+\ln\left(1+\frac{1}{x^2}\right)\), so the quotient equals \(2+\ln\left(1+\frac{1}{x^2}\right)/\ln x\), which approaches \(2+0=2\).

Example 3

Check the form again after each step

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

Solution

At \(x=0\), the numerator is \(0-\sin 0=0\) and the denominator is \(e^{0}-1-0=0\), so the form is \(\frac00\). Both are differentiable everywhere, and the derivative of the denominator, \(2e^{2x}-2\), is 0 only at \(x=0\). Differentiating gives \(\frac{1-\cos x}{2e^{2x}-2}\), whose form at 0 is \(\frac00\) again. The derivative of its denominator, \(4e^{2x}\), is never 0, so the rule applies once more:

\[\begin{aligned}\lim_{x\to 0}\frac{x-\sin x}{e^{2x}-1-2x}&=\lim_{x\to 0}\frac{1-\cos x}{2e^{2x}-2}\\&=\lim_{x\to 0}\frac{\sin x}{4e^{2x}}\end{aligned}\]

At 0, \(\frac{\sin x}{4e^{2x}}\) has the form \(\frac04\), which is not indeterminate, so the quotient law gives its limit, \(\frac04=0\). This last limit exists, so both equal signs hold, and the limit is 0.

Example 4

Rewrite other indeterminate forms

Find \(\displaystyle\lim_{x\to 0^+}(1+2x)^{3/x}\).

Solution

As \(x\to0^+\), the base approaches 1 and the exponent grows without bound, so the form is \(1^\infty\). Let \(y=(1+2x)^{3/x}\). The base is positive, so \(\ln y\) is defined, and it is a product of the form \(\infty\cdot0\). Write it as a quotient of the form \(\frac00\):

\[\ln y=\frac{3}{x}\,\ln(1+2x)=\frac{3\ln(1+2x)}{x}\]

The numerator and the denominator are differentiable for \(x>-\frac12\), and the derivative of the denominator is 1. By the rule, with the chain rule for the numerator,

\[\lim_{x\to 0^+}\ln y=\lim_{x\to 0^+}\frac{6/(1+2x)}{1}=6\]

Because \(e^x\) is continuous, \(y=e^{\ln y}\) approaches \(e^6\):

\[\lim_{x\to 0^+}(1+2x)^{3/x}=e^{6}\]

Each example is one of the four skills of topic 4.7 in Which & Why: AP Calculus.