4.1 l’Hôpital’s Rule: The Limits of Indeterminacy

Story (The Marquis and the Mercenary).

What we call l’Hôpital’s Rule was not actually discovered by the Marquis de l’Hôpital. It was discovered by the brilliant Swiss mathematician Johann Bernoulli. The Marquis, a wealthy French nobleman with a deep passion for the newly invented calculus, effectively hired Bernoulli to be his private tutor and send him mathematical discoveries. In exchange for a handsome salary, Bernoulli agreed to hand over his intellectual property rights. When l’Hôpital published the first-ever textbook on differential calculus in 1696, he included this magical rule for resolving limits. History remembered the publisher, and Bernoulli’s rule has been l’Hôpital’s ever since.

Calculating limits is usually a straightforward affair: we evaluate the function at the point in question. However, we often encounter situations where plugging in the value yields a result that lacks mathematical meaning. These are known as indeterminate forms. Let us quickly recall the primary indeterminate forms from Section 2.10:

  1. 1.
    ​

    00\frac{0}{0} and ∞∞\frac{\infty}{\infty} (The quotients)

  2. 2.
    ​

    0⋅∞0\cdot\infty (The product)

  3. 3.
    ​

    ∞−∞\infty-\infty (The competing infinities)

  4. 4.
    ​

    00,∞0,0^{0},\infty^{0}, and 1∞1^{\infty} (The exponential paradoxes)

Before we deploy heavy machinery, let us remind the basic tools we used back in the day. Consider the limit:

limx→2x2−4x−2.\lim_{x\to 2}\frac{x^{2}-4}{x-2}.

Plugging in x=2x=2 yields 00\frac{0}{0}. This hints us to eliminate the problematic x−2x-2 factor:

limx→2(x−2)⁢(x+2)x−2=limx→2(x+2)=2+2=4.\lim_{x\to 2}\frac{(x-2)(x+2)}{x-2}=\lim_{x\to 2}(x+2)=2+2=4.

Similarly, consider the classical geometric limit:

limx→0sin⁡xx=1.\lim_{x\to 0}\frac{\sin x}{x}=1.

The fraction evaluates to 00\frac{0}{0}. Since we cannot factor out xx from sin⁡x\sin x as in the previous example, establishing the limit originally required a highly sophisticated argument using a geometric argument combining with the Squeeze Theorem, see Corollary 2.9.3. But what if the functions are too complex for simple algebraic factorization or geometric squeezing? This is where Bernoulli’s ingenious insight comes in.

Theorem 4.1.1 (L’Hôpital’s Rule for 00\frac{0}{0}).

Let f⁢(x)f(x) and g⁢(x)g(x) be differentiable at x0x_{0}, and suppose that:

limx→x0f⁢(x)=limx→x0g⁢(x)=0.\lim_{x\to x_{0}}f(x)=\lim_{x\to x_{0}}g(x)=0.

Then,

limx→x0f⁢(x)g⁢(x)=limx→x0f′⁢(x)g′⁢(x),\lim_{x\to x_{0}}\frac{f(x)}{g(x)}=\lim_{x\to x_{0}}\frac{f^{\prime}(x)}{g^{% \prime}(x)},

provided the limit on the right-hand side exists.

Intuition (A Tale of Linear Approximations).

To truly understand why this works, we must look past the symbols and view the functions locally. By Newton’s approximation (or the first-order Taylor expansion), any differentiable function behaves like a straight line near the point of tangency.

Proof Sketch.

Let us utilize the linear approximation of ff and gg near x0x_{0}. Because the functions are differentiable at x0x_{0}, they are continuous, which guarantees f⁢(x0)=0f(x_{0})=0 and g⁢(x0)=0g(x_{0})=0.

We can expand the functions as follows, where o⁢(x−x0)o(x-x_{0}) represents an error term that goes to zero faster than (x−x0)(x-x_{0}) (see Section 3.7):

f⁢(x)=f⁢(x0)+f′⁢(x0)⁢(x−x0)+o⁢(x−x0)g⁢(x)=g⁢(x0)+g′⁢(x0)⁢(x−x0)+o⁢(x−x0)\begin{split}f(x)&{}=f(x_{0})+f^{\prime}(x_{0})(x-x_{0})+o(x-x_{0})\\ g(x)&{}=g(x_{0})+g^{\prime}(x_{0})(x-x_{0})+o(x-x_{0})\end{split}

Since f⁢(x0)=0f(x_{0})=0 and g⁢(x0)=0g(x_{0})=0, substituting these expansions into our limit yields:

limx→x0f⁢(x)g⁢(x)=limx→x0f′⁢(x0)⁢(x−x0)+o⁢(x−x0)g′⁢(x0)⁢(x−x0)+o⁢(x−x0)=limx→x0f′⁢(x0)+o⁢(x−x0)x−x0g′⁢(x0)+o⁢(x−x0)x−x0.\begin{split}\lim_{x\to x_{0}}\frac{f(x)}{g(x)}&{}=\lim_{x\to x_{0}}\frac{f^{% \prime}(x_{0})(x-x_{0})+o(x-x_{0})}{g^{\prime}(x_{0})(x-x_{0})+o(x-x_{0})}\\ &{}=\lim_{x\to x_{0}}\frac{f^{\prime}(x_{0})+\frac{o(x-x_{0})}{x-x_{0}}}{g^{% \prime}(x_{0})+\frac{o(x-x_{0})}{x-x_{0}}}.\end{split}

As x→x0x\to x_{0}, the terms o⁢(x−x0)x−x0\frac{o(x-x_{0})}{x-x_{0}} vanish to 0. Thus, the expression simplifies to:

limx→x0f⁢(x)g⁢(x)=f′⁢(x0)g′⁢(x0)=limx→x0f′⁢(x)g′⁢(x).\lim_{x\to x_{0}}\frac{f(x)}{g(x)}=\frac{f^{\prime}(x_{0})}{g^{\prime}(x_{0})}% =\lim_{x\to x_{0}}\frac{f^{\prime}(x)}{g^{\prime}(x)}.

∎

Geometrically, if two functions cross the origin together, the ratio of their values near the origin is entirely determined by the ratio of the slopes of their tangent lines, see Figure 4.1.

limx→x0f⁢(x)g⁢(x)=slope of ⁢f⁢(x)⁢ at ⁢x0slope of ⁢g⁢(x)⁢ at ⁢x0\lim_{x\to x_{0}}\frac{f(x)}{g(x)}=\frac{\text{slope of }f(x)\text{ at }x_{0}}% {\text{slope of }g(x)\text{ at }x_{0}}
A geometric illustration of L'Hopital's rule for the limit of sin(x)/x as x approaches 0. The plot shows a 2D Cartesian coordinate system with the x and y axes. Two functions are plotted passing through the origin: the green linear function g(x) = x and the blue trigonometric curve f(x) = sin(x). At the origin (0,0), marked with a black dot, the two curves are tangent to each other, both having a slope of 1. Red tick marks on the positive x-axis are shown at x = 1 and x = pi/2. The visual shows that as x approaches 0, the ratio of sin(x) to x is determined by the ratio of their tangent slopes at the origin, which is 1.
Figure 4.1: Geometric illustration of the limit limx→0sin⁡xx=1\lim_{x\to 0}\frac{\sin x}{x}=1 using the tangent slopes of f⁢(x)=sin⁡xf(x)=\sin x and g⁢(x)=xg(x)=x at the origin.

Armed with l’Hôpital’s Rule, let us revisit our earlier examples.

Example 4.1.2.

For f⁢(x)=x2−4f(x)=x^{2}-4 and g⁢(x)=x−2g(x)=x-2, both approach 0 as x→2x\to 2.

limx→2x2−4x−2⁢=l’H⁢limx→2(x2−4)′(x−2)′=limx→22⁢x−01−0=limx→22⁢x=4.\lim_{x\to 2}\frac{x^{2}-4}{x-2}\overset{\text{l'H}}{=}\lim_{x\to 2}\frac{(x^{% 2}-4)^{\prime}}{(x-2)^{\prime}}=\lim_{x\to 2}\frac{2x-0}{1-0}=\lim_{x\to 2}2x=4.
Example 4.1.3.

For the trigonometric limit, f⁢(x)=sin⁡xf(x)=\sin x and g⁢(x)=xg(x)=x:

limx→0sin⁡xx⁢=l’H⁢limx→0(sin⁡x)′(x)′=limx→0cos⁡x1=cos⁡0=1.\lim_{x\to 0}\frac{\sin x}{x}\overset{\text{l'H}}{=}\lim_{x\to 0}\frac{(\sin x% )^{\prime}}{(x)^{\prime}}=\lim_{x\to 0}\frac{\cos x}{1}=\cos 0=1.
Example 4.1.4.

Let us apply the rule to a new function:

limx→1log⁡xx2−1→00.\lim_{x\to 1}\frac{\log x}{x^{2}-1}\to\frac{0}{0}.

Applying l’Hôpital’s Rule:

limx→1(log⁡x)′(x2−1)′=limx→11x2⁢x=limx→112⁢x2=12.\lim_{x\to 1}\frac{(\log x)^{\prime}}{(x^{2}-1)^{\prime}}=\lim_{x\to 1}\frac{% \frac{1}{x}}{2x}=\lim_{x\to 1}\frac{1}{2x^{2}}=\frac{1}{2}.
Caveat (L’Hôpital is NOT the Quotient Rule!).

When applying l’Hôpital, we are taking the derivative of the top and the bottom independently: limf′⁢(x)g′⁢(x)\lim\frac{f^{\prime}(x)}{g^{\prime}(x)}. Do not confuse this with the derivative of the fraction itself:

dd⁢x⁢(f⁢(x)g⁢(x))=f′⁢(x)⁢g⁢(x)−f⁢(x)⁢g′⁢(x)g⁢(x)2.\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{f(x)}{g(x)}\right)=\frac{f^{\prime}(% x)g(x)-f(x)g^{\prime}(x)}{g(x)^{2}}.

They serve different purposes: l’Hôpital rule is for finding limit, quotient rule is for finding derivative.

A sibling of the 00\frac{0}{0} rule is:

Theorem 4.1.5 (L’Hôpital’s Rule for ∞∞\frac{\infty}{\infty}).

Let f⁢(x)f(x) and g⁢(x)g(x) be differentiable at x0x_{0}, and suppose that limx→x0f⁢(x)=∞\lim_{x\to x_{0}}f(x)=\infty and limx→x0g⁢(x)=∞\lim_{x\to x_{0}}g(x)=\infty. Then

limx→x0f⁢(x)g⁢(x)=limx→x0f′⁢(x)g′⁢(x),\lim_{x\to x_{0}}\frac{f(x)}{g(x)}=\lim_{x\to x_{0}}\frac{f^{\prime}(x)}{g^{% \prime}(x)},

provided the last limit exists.

What about the other indeterminate forms? The strategy is to mathematically bend and twist these exotic forms until they look like our comfortable 00\frac{0}{0} or ∞∞\frac{\infty}{\infty} cases.

Example 4.1.6.

Let us evaluate a 0⋅∞0\cdot\infty form using log properties.

limx→∞x⁢log⁡(x+1x−1)→∞⋅0.\lim_{x\to\infty}x\log\left(\frac{x+1}{x-1}\right)\to\infty\cdot 0.

We rewrite the product as a quotient to invoke l’Hôpital for 00\frac{0}{0}:

limx→∞x⁢log⁡(x+1x−1)=limx→∞log⁡(x+1x−1)1x.\lim_{x\to\infty}x\log\left(\frac{x+1}{x-1}\right)=\lim_{x\to\infty}\frac{\log% \left(\frac{x+1}{x-1}\right)}{\frac{1}{x}}.

Now applying l’Hôpital’s Rule. The derivative of the numerator requires the chain rule:

dd⁢x⁢log⁡(x+1x−1)=x−1x+1⋅((x+1)′⁢(x−1)−(x+1)⁢(x−1)′(x−1)2)=x−1x+1⋅−2(x−1)2=−2x2−1.\frac{\mathrm{d}}{\mathrm{d}x}\log\left(\frac{x+1}{x-1}\right)=\frac{x-1}{x+1}% \cdot\left(\frac{(x+1)^{\prime}(x-1)-(x+1)(x-1)^{\prime}}{(x-1)^{2}}\right)=% \frac{x-1}{x+1}\cdot\frac{-2}{(x-1)^{2}}=\frac{-2}{x^{2}-1}.

The derivative of the denominator is −1x2-\frac{1}{x^{2}}. Substituting these back:

limx→∞x⁢log⁡(x+1x−1)=limx→∞−2x2−1−1x2=limx→∞2⁢x2x2−1.\lim_{x\to\infty}x\log\left(\frac{x+1}{x-1}\right)=\lim_{x\to\infty}\frac{% \frac{-2}{x^{2}-1}}{-\frac{1}{x^{2}}}=\lim_{x\to\infty}\frac{2x^{2}}{x^{2}-1}.

Applying l’Hôpital once more (for the ∞∞\frac{\infty}{\infty} form):

limx→∞x⁢log⁡(x+1x−1)==l’H⁢limx→∞4⁢x2⁢x=2.\lim_{x\to\infty}x\log\left(\frac{x+1}{x-1}\right)=\overset{\text{l'H}}{=}\lim% _{x\to\infty}\frac{4x}{2x}=2.
Example 4.1.7 (Factoring out the Infinity: ∞−∞\infty-\infty).

Suppose limx→x0f⁢(x)=∞\lim_{x\to x_{0}}f(x)=\infty and limx→x0g⁢(x)=∞\lim_{x\to x_{0}}g(x)=\infty. The limit limx→x0[f⁢(x)−g⁢(x)]\lim_{x\to x_{0}}[f(x)-g(x)] evaluates to ∞−∞\infty-\infty. We resolve this by forcing a quotient:

limx→x0(f⁢(x)−g⁢(x))=limx→x0f⁢(x)⁢g⁢(x)⁢(1g⁢(x)−1f⁢(x))=limx→x0(1g⁢(x)−1f⁢(x))1f⁢(x)⁢g⁢(x)→00.\lim_{x\to x_{0}}(f(x)-g(x))=\lim_{x\to x_{0}}f(x)g(x)\left(\frac{1}{g(x)}-% \frac{1}{f(x)}\right)=\lim_{x\to x_{0}}\frac{\left(\frac{1}{g(x)}-\frac{1}{f(x% )}\right)}{\frac{1}{f(x)g(x)}}\to\frac{0}{0}.

To illustrate, consider the following limit that requires a little determination and multiple rounds of l’Hôpital:

limx→0(1x2−1sin2⁡x)=limx→0sin2⁡x−x2x2⁢sin2⁡x=limx→02⁢sin⁡x⁢cos⁡x−2⁢x2⁢x⁢sin2⁡x+x2⁢2⁢sin⁡x⁢cos⁡x=limx→0sin⁡2⁢x−2⁢x2⁢x⁢sin2⁡x+x2⁢sin⁡2⁢x=limx→02⁢cos⁡2⁢x−22⁢sin2⁡x+2⁢x⁢2⁢sin⁡x⁢cos⁡x+2⁢x⁢sin⁡2⁢x+2⁢x2⁢cos⁡2⁢x=limx→0cos⁡2⁢x−1sin2⁡x+2⁢x⁢sin⁡2⁢x+x2⁢cos⁡2⁢x=limx→0−2⁢sin⁡2⁢x2⁢sin⁡x⁢cos⁡x+2⁢sin⁡2⁢x+4⁢x⁢cos⁡2⁢x+2⁢x⁢cos⁡2⁢x−2⁢x2⁢sin⁡2⁢x=limx→0−2⁢sin⁡2⁢x(3−2⁢x2)⁢sin⁡2⁢x+6⁢x⁢cos⁡2⁢x=limx→0−4⁢cos⁡2⁢x−4⁢x⁢sin⁡2⁢x+2⁢(3−2⁢x2)⁢cos⁡2⁢x+6⁢cos⁡2⁢x+6⁢x⁢sin⁡2⁢x=−4⋅12⋅3⋅1+6⋅1=−412=−13.\begin{split}\lim_{x\to 0}\left(\frac{1}{x^{2}}-\frac{1}{\sin^{2}x}\right)&{}=% \lim_{x\to 0}\frac{\sin^{2}x-x^{2}}{x^{2}\sin^{2}x}\\ &{}=\lim_{x\to 0}\frac{2\sin x\cos x-2x}{2x\sin^{2}x+x^{2}2\sin x\cos x}\\ &{}=\lim_{x\to 0}\frac{\sin 2x-2x}{2x\sin^{2}x+x^{2}\sin 2x}\\ &{}=\lim_{x\to 0}\frac{2\cos 2x-2}{2\sin^{2}x+2x2\sin x\cos x+2x\sin 2x+2x^{2}% \cos 2x}\\ &{}=\lim_{x\to 0}\frac{\cos 2x-1}{\sin^{2}x+2x\sin 2x+x^{2}\cos 2x}\\ &{}=\lim_{x\to 0}\frac{-2\sin 2x}{2\sin x\cos x+2\sin 2x+4x\cos 2x+2x\cos 2x-2% x^{2}\sin 2x}\\ &{}=\lim_{x\to 0}\frac{-2\sin 2x}{(3-2x^{2})\sin 2x+6x\cos 2x}\\ &{}=\lim_{x\to 0}\frac{-4\cos 2x}{-4x\sin 2x+2(3-2x^{2})\cos 2x+6\cos 2x+6x% \sin 2x}\\ &{}=\frac{-4\cdot 1}{2\cdot 3\cdot 1+6\cdot 1}=-\frac{4}{12}=-\frac{1}{3}.\end% {split}
Example 4.1.8 (The Log Trick: 1∞1^{\infty}, 000^{0}, ∞0\infty^{0}).

Exponential indeterminacies require us to bring the exponent down to the baseline. Suppose limf⁢(x)=1\lim f(x)=1 and limg⁢(x)=∞\lim g(x)=\infty. We are evaluating y=limf⁢(x)g⁢(x)→1∞y=\lim f(x)^{g(x)}\to 1^{\infty}. Take the natural logarithm:

log⁡y=limx→x0g⁢(x)⁢log⁡f⁢(x).\log y=\lim_{x\to x_{0}}g(x)\log f(x).

This transforms 1∞1^{\infty} into the multiplicative form ∞⋅0\infty\cdot 0, which we can then write as:

log⁡f⁢(x)1g⁢(x)→00.\frac{\log f(x)}{\frac{1}{g(x)}}\to\frac{0}{0}.
Exercise 4.1.9.

Find the following limits, paying close attention to which indeterminate form is present:

  1. 1.
    ​

    limx→∞(1+1x)x\displaystyle\lim_{x\to\infty}\left(1+\frac{1}{x}\right)^{x}

  2. 2.
    ​

    limx→0e2⁢x−1x\displaystyle\lim_{x\to 0}\frac{\mathrm{e}^{2x}-1}{x}

  3. 3.
    ​

    limx→−∞x2e−x\displaystyle\lim_{x\to-\infty}\frac{x^{2}}{\mathrm{e}^{-x}}

  4. 4.
    ​

    limx→∞e−x⁢x\displaystyle\lim_{x\to\infty}\mathrm{e}^{-x}\sqrt{x}

A common pitfall for undergraduates is treating l’Hôpital’s Rule as a magical hammer where every limit is a nail. Consider the following seemingly innocent limit:

limx→∞xx+1→∞∞.\lim_{x\to\infty}\frac{\sqrt{x}}{\sqrt{x+1}}\to\frac{\infty}{\infty}.

Let us apply l’Hôpital blindly:

limx→∞(x)′(x+1)′=limx→∞12⁢x−1/212⁢(x+1)−1/2=limx→∞x+1x.\lim_{x\to\infty}\frac{(\sqrt{x})^{\prime}}{(\sqrt{x+1})^{\prime}}=\lim_{x\to% \infty}\frac{\frac{1}{2}x^{-1/2}}{\frac{1}{2}(x+1)^{-1/2}}=\lim_{x\to\infty}% \frac{\sqrt{x+1}}{\sqrt{x}}.

Notice the numerator and denominator swapped. If we apply the rule again:

=l’H⁢limx→∞xx+1.\overset{\text{l'H}}{=}\lim_{x\to\infty}\frac{\sqrt{x}}{\sqrt{x+1}}.

We are trapped in an infinite loop! How do we escape? By remembering our basic algebra.

Moral.

Always simplify your expression first. If we simply rewrite the original limit algebraically, the problem evaporates:

limx→∞xx+1=limx→∞xx+1=limx→∞11+1x=11+0=1.\lim_{x\to\infty}\frac{\sqrt{x}}{\sqrt{x+1}}=\lim_{x\to\infty}\sqrt{\frac{x}{x% +1}}=\lim_{x\to\infty}\sqrt{\frac{1}{1+\frac{1}{x}}}=\sqrt{\frac{1}{1+0}}=1.
Note.

L’Hôpital’s rule also perfectly holds for one-sided limits (e.g., x→0+x\to 0^{+}). Keep this in mind as you work through these problems.

Exercise 4.1.10.

Find the limits of the following indeterminate forms:

  1. 1.
    ​

    limx→1+(1log⁡x−1x−1)\displaystyle\lim_{x\to 1^{+}}\left(\frac{1}{\log x}-\frac{1}{x-1}\right)

  2. 2.
    ​

    limx→0+x⁢log⁡x\displaystyle\lim_{x\to 0^{+}}x\log x

  3. 3.
    ​

    limx→π2−(sec⁡x−tan⁡x)\displaystyle\lim_{x\to\frac{\pi}{2}^{-}}(\sec x-\tan x)

  4. 4.
    ​

    limx→0+xx\displaystyle\lim_{x\to 0^{+}}x^{x}

  5. 5.
    ​

    limx→0+(sin⁡x)x\displaystyle\lim_{x\to 0^{+}}(\sin x)^{x}