Skip to main content

CLP-1 Differential Calculus

Section 3.7 L’Hôpital’s Rule, Indeterminate Forms

Subsection 3.7.1 L’Hôpital’s Rule and Indeterminate Forms

Let us return to limits (Chapter 1) and see how we can use derivatives to simplify certain families of limits called indeterminate forms. We know, from Theorem 1.4.3 on the arithmetic of limits, that if
\begin{align*} \lim_{x\rightarrow a}f(x) &= F & \lim_{x\rightarrow a}g(x) &= G\\ \end{align*}

and \(G\ne 0\text{,}\) then

\begin{align*} \lim_{x\rightarrow a}\frac{f(x)}{g(x)} &= \frac{F}{G} \end{align*}
The requirement that \(G\ne 0\) is critical — we explored this in Example 1.4.7. Please reread that example.
Of course
 1 
Now it is not so surprising, but perhaps back when we started limits, this was not so obvious.
it is not surprising that if \(F\ne 0\) and \(G= 0\text{,}\) then
\begin{align*} \lim_{x\to a}\frac{f(x)}{g(x)} &= DNE \end{align*}
and if \(F=0\) but \(G\neq 0\) then
\begin{align*} \lim_{x\to a}\frac{f(x)}{g(x)} &= 0 \end{align*}
However when both \(F,G=0\) then, as we saw in Example 1.4.7, almost anything can happen
\begin{align*} f(x)&=x & g(x)&=x^2 & \lim_{x\to0} \frac{x}{x^2} &= \lim_{x\to0} \frac{1}{x} = DNE\\ f(x)&=x^2 & g(x)&=x & \lim_{x\to0} \frac{x^2}{x} &= \lim_{x\to0} x = 0\\ f(x)&=x & g(x)&=x & \lim_{x\to0} \frac{x}{x} &= \lim_{x\to0} 1 = 1\\ f(x)&=7x^2 & g(x)&=3x^2 & \lim_{x\to0} \frac{7x^2}{3x^2} &= \lim_{x\to0} \frac{7}{3} = \frac{7}{3} \end{align*}
Indeed after exploring Example 1.4.12 and 1.4.14 we gave ourselves the rule of thumb that if we found \(0/0\text{,}\) then there must be something that cancels.
Because the limit that results from these \(0/0\) situations is not immediately obvious, but also leads to some interesting mathematics, we should give it a name.

Definition 3.7.1. First indeterminate forms.

Let \(a \in \mathbb{R}\) and let \(f(x)\) and \(g(x)\) be functions. If
\begin{align*} \lim_{x\to a} f(x) &= 0 & \text{and } && \lim_{x\to a} g(x) &= 0 \end{align*}
then the limit
\begin{gather*} \lim_{x\to a} \dfrac{f(x)}{g(x)} \end{gather*}
is called a \(\frac{0}{0}\) indeterminate form.
There are quite a number of mathematical tools for evaluating such indeterminate forms — Taylor series for example. A simpler method, which works in quite a few cases, is L’Hôpital’s rule
 2 
Named for the 17th century mathematician, Guillaume de l’Hôpital, who published the first textbook on differential calculus. The eponymous rule appears in that text, but is believed to have been developed by Johann Bernoulli. The book was the source of some controversy since it contained many results by Bernoulli, which l’Hôpital acknowledged in the preface, but Bernoulli felt that l’Hôpital got undue credit.
\begin{equation*} \mbox{ } \end{equation*}
Note that around that time l’Hôpital’s name was commonly spelled l’Hospital, but the spelling of silent s in French was changed subsequently; many texts spell his name l’Hospital. If you find yourself in Paris, you can hunt along Boulevard de l’Hôpital for older street signs carved into the sides of buildings which spell it “l’Hospital” — though arguably there are better things to do there.
.

Proof.

We only give the proof for part (a). The proof of part (b) is not very difficult, but uses the Generalised Mean–Value Theorem (Theorem 3.4.38), which is optional and most readers have not seen it.
  • First note that we must have \(f(a)=g(a)=0\text{.}\) To see this note that since derivative \(f'(a)\) exists, we know that the limit
    \begin{align*} \lim_{x\to a} \frac{f(x)-f(a)}{x-a} & \text{ exists} \end{align*}
    Since we know that the denominator goes to zero, we must also have that the numerator goes to zero (otherwise the limit would be undefined). Hence we must have
    \begin{align*} \lim_{x\to a} (f(x)-f(a)) &= \left( \lim_{x\to a} f(x) \right) - f(a) = 0 \end{align*}
    We are told that \(\ds \lim_{x\to a} f(x) =0\) so we must have \(f(a)=0\text{.}\) Similarly we know that \(g(a)=0\text{.}\)
  • Now consider the indeterminate form
    \begin{align*} \lim_{x\to a} \frac{f(x)}{g(x)} &= \lim_{x\to a} \frac{f(x) - 0 }{g(x) - 0 } & \text{use }0=f(a)=g(a)\\ &= \lim_{x\to a} \frac{f(x) - f(a) }{g(x) - g(a) } & \text{multiply by } 1=\frac{(x-a)^{-1}}{(x-a)^{-1}}\\ &= \lim_{x\to a} \frac{f(x) - f(a) }{g(x) - g(a) }\cdot\frac{(x-a)^{-1}}{(x-a)^{-1}} & \text{rearrange}\\ &= \lim_{x\to a} \left[ \frac{ \dfrac{f(x) - f(a)}{x-a} }{ \dfrac{g(x) - g(a)}{x-a}} \right] & \text{use arithmetic of limits}\\ &= \dfrac{\ds \lim_{x\to a} \frac{f(x) - f(a)}{x-a} } {\ds \lim_{x\to a} \frac{g(x) - g(a)}{x-a}} = \dfrac{f'(a)}{g'(a)} \end{align*}
    We can justify this step and apply Theorem 1.4.3, since the limits in the numerator and denominator exist, because they are just \(f'(a)\) and \(g'(a)\text{.}\)

Subsubsection 3.7.1.1 Optional — Proof of Part (b) of l’Hôpital’s Rule

To prove part (b) we must work around the possibility that \(f'(a)\) and \(g'(a)\) do not exist or that \(f'(x)\) and \(g'(x)\) are not continuous at \(x=a\text{.}\) To do this, we make use of the Generalised Mean-Value Theorem (Theorem 3.4.38) that was used to prove Equation 3.4.33. We recommend you review the GMVT before proceeding.
For simplicity we consider the limit
\begin{gather*} \lim_{x\to a^+} \frac{f(x)}{g(x)} \end{gather*}
By assumption, we know that
\begin{gather*} \lim_{x\to a^+} f(x) = \lim_{x\to a^+} g(x) = 0 \end{gather*}
For simplicity, we also assume that \(f(a)=g(a)=0\text{.}\) This allows us to write
\begin{align*} \frac{f(x)}{g(x)} &= \frac{f(x)-f(a)}{g(x)-g(a)} \end{align*}
which is the right form for an application of the GMVT.
By assumption \(f'(x)\) and \(g'(x)\) exist, with \(g'(x)\) nonzero, in some open interval around \(a\text{,}\) except possibly at \(a\) itself. So we know that they exist, with \(g'(x)\ne 0\text{,}\) in some interval \((a,b]\) with \(b \gt a\text{.}\) Then the GMVT (Theorem 3.4.38) tells us that for \(x\in (a,b]\)
\begin{align*} \frac{f(x)}{g(x)} = \frac{f(x)-f(a)}{g(x)-g(a)} &= \frac{f'(c)}{g'(c)} \end{align*}
where \(c \in (a,x)\text{.}\) As we take the limit as \(x\to a\text{,}\) we also have that \(c\to a\text{,}\) and so
\begin{align*} \lim_{x\to a^+}\frac{f(x)}{g(x)} &= \lim_{x\to a^+} \frac{f'(c)}{g'(c)} = \lim_{c \to a^+} \frac{f'(c)}{g'(c)} \end{align*}
as required.

Subsection 3.7.2 Standard Examples

Here are some simple examples using L’Hôpital’s rule.

Example 3.7.3. Find \(\ds \lim_{x\to 0} \frac{\sin x}{x}\).

Consider the limit
\begin{gather*} \lim_{x\to 0} \frac{\sin x}{x} \end{gather*}
  • Notice that
    \begin{align*} \lim_{x\to 0} \sin x &= 0\\ \lim_{x\to 0} x &= 0 \end{align*}
    so this is a \(\frac00\) indeterminate form, and suggests we try l’Hôpital’s rule.
  • To apply the rule we must first check the limits of the derivatives.
    \begin{align*} f(x)&= \sin x & f'(x) & =\cos x & \text{and} && f'(0)=1\\ g(x) &= x & g'(x) & = 1 & \text{and} && g'(0)=1 \end{align*}
  • So by l’Hôpital’s rule
    \begin{align*} \lim_{x\to 0} \frac{\sin x}{x} &= \frac{f'(0)}{g'(0)} = \frac{1}{1} = 1. \end{align*}

Example 3.7.4. Compute \(\ds \lim_{x\to 0} \frac{\sin(x)}{\sin(2x)}\).

Consider the limit
\begin{gather*} \lim_{x\to 0} \frac{\sin(x)}{\sin(2x)} \end{gather*}
  • First check
    \begin{align*} \lim_{x\to 0} \sin 2x &= 0\\ \lim_{x\to 0} \sin x &= 0 \end{align*}
    so we again have a \(\frac00\) indeterminate form.
  • Set \(f(x)=\sin x\) and \(g(x)=\sin 2x\text{,}\) then
    \begin{align*} f'(x) &= \cos x & f'(0)= 1\\ g'(x) &= 2\cos 2x & g'(0)= 2 \end{align*}
  • And by l’Hôpital’s rule
    \begin{align*} \lim_{x\to 0} \frac{\sin x}{\sin 2x} &= \frac{f'(0)}{g'(0)} = \frac{1}{2}. \end{align*}

Example 3.7.5. \(\ds \lim_{x \to0} \frac{q^x - 1}{x}\).

Let \(q \gt 1\) and compute the limit
\begin{gather*} \lim_{x \to0} \frac{q^x - 1}{x} \end{gather*}
This limit arose in our discussion of exponential functions in Section 2.7.
  • First check
    \begin{align*} \lim_{x \to 0} (q^x-1) & = 1-1 = 0\\ \lim_{x \to 0} x & = 0 \end{align*}
    so we have a \(\frac00\) indeterminate form.
  • Set \(f(x)= q^x-1\) and \(g(x)=x\text{,}\) then (maybe after a quick review of Section 2.7)
    \begin{align*} f'(x) &= \diff{}{x}\left(q^x-1\right) = q^x \cdot \log q & f'(0) &= \log q\\ g'(x) &= 1 & g'(0) &= 1 \end{align*}
  • And by l’Hôpital’s rule
     3 
    While it might not be immediately obvious, this example relies on circular reasoning. In order to apply l’Hôpital’s rule, we need to compute the derivative of \(q^x\text{.}\) However in order to compute that limit (see Section 2.7) we needed to evaluate this limit.
    \begin{equation*} \mbox{ } \end{equation*}
    A more obvious example of this sort of circular reasoning can be seen if we use l’Hôpital’s rule to compute the derivative of \(f(x)=x^n\) at \(x=a\) using the limit
    \begin{equation*} f'(a) = \lim_{x \to a} \frac{x^n -a^n}{x-a} = \lim_{x \to a} \frac{n x^{n-1}-0}{1-0} = n a^{n-1}. \end{equation*}
    We have used the result \(\diff{}{x} x^n = nx^{n-1}\) to prove itself!
    \begin{align*} \lim_{h \to0} \frac{q^h - 1}{h} &= \log q. \end{align*}
In this example, we shall apply L’Hôpital’s rule twice before getting the answer.

Example 3.7.6. Double L’Hôpital.

Compute the limit
\begin{gather*} \lim_{x\to 0} \frac{\sin(x^2)}{1-\cos x} \end{gather*}
  • Again we should check
    \begin{align*} \lim_{x\to 0} \sin(x^2) &= \sin 0 = 0\\ \lim_{x\to 0}(1-\cos x) &= 1-\cos 0 = 0 \end{align*}
    and we have a \(\frac00\) indeterminate form.
  • Let \(f(x) = \sin(x^2)\) and \(g(x)=1-\cos x\) then
    \begin{align*} f'(x) &= 2x\cos(x^2) & f'(0)&=0\\ g'(x) &= \sin x & g'(0) &=0 \end{align*}
    So if we try to apply l’Hôpital’s rule naively we will get
    \begin{align*} \lim_{x\to 0} \frac{\sin(x^2)}{1-\cos x} &= \frac{f'(0)}{g'(0)} = \frac{0}{0}. \end{align*}
    which is another \(\frac00\) indeterminate form.
  • It appears that we are stuck until we remember that l’Hôpital’s rule (as stated in Theorem 3.7.2) has a part (b) — now is a good time to reread it.
  • It says that
    \begin{align*} \lim_{x\to 0} \frac{f(x)}{g(x)} &= \lim_{x\to 0} \frac{f'(x)}{g'(x)} \end{align*}
    provided this second limit exists. In our case this requires us to compute
    \begin{gather*} \lim_{x \to 0} \frac{2x \cos(x^2)}{\sin(x)} \end{gather*}
    which we can do using l’Hôpital’s rule again. Now
    \begin{align*} h(x) &= 2x\cos(x^2) & h'(x) &= 2\cos(x^2) - 4x^2\sin(x^2) & h'(0) &=2\\ \ell(x) &= \sin(x) & \ell'(x) &= \cos(x) & \ell'(0) &= 1 \end{align*}
    By l’Hôpital’s rule
    \begin{align*} \lim_{x \to 0} \frac{2x \cos(x^2)}{\sin(x)} &= \frac{h'(0)}{\ell'(0)} = 2 \end{align*}
  • Thus our original limit is
    \begin{align*} \lim_{x\to 0} \frac{\sin(x^2)}{1-\cos x} &=\lim_{x \to 0} \frac{2x \cos(x^2)}{\sin(x)} = 2. \end{align*}
  • We can succinctly summarise the two applications of L’Hôpital’s rule in this example by
    \begin{align*} \lim_{x\to 0}\underbrace{\frac{\sin(x^2)}{1-\cos x}}_{\atp {\mathrm{num}\to 0} {\mathrm{den}\to 0}} &=\lim_{x\to 0}\underbrace{\frac{2x\cos(x^2)}{\sin x}}_{\atp {\mathrm{num}\to 0} {\mathrm{den}\to 0}} =\lim_{x\to 0}\underbrace{\frac{2\cos(x^2)-4x^2\sin(x^2)}{\cos x}}_{\atp {\mathrm{num}\to 2} {\mathrm{den}\to 1}} =2 \end{align*}
    Here “num” and “den” are used as abbreviations of “numerator” and “denominator” respectively."
One must be careful to ensure that the hypotheses of l’Hôpital’s rule are satisfied before applying it. The following “warnings” show the sorts of things that can go wrong.

Warning 3.7.7. Denominator limit nonzero.

If
\begin{align*} \lim\limits_{x\rightarrow a}f(x)&=0 & \text{but}&& \lim\limits_{x\rightarrow a}g(x)&\ne 0 \end{align*}
then
\begin{align*} \lim\limits_{x\rightarrow a}\frac{f(x)}{g(x)} && \text{need not be the same as} && \frac{f'(a)}{g'(a)} \text{ or } \lim\limits_{x\rightarrow a}\frac{f'(x)}{g'(x)}. \end{align*}
Here is an example. Take
\begin{gather*} a=0\qquad f(x)=3x \qquad g(x)=4+5x \end{gather*}
Then
\begin{align*} \lim_{x\rightarrow 0}\frac{f(x)}{g(x)} &=\lim_{x\rightarrow 0}\frac{3x}{4+5x} & &=\frac{3\times 0}{4+5\times 0} =0\\ \lim_{x\rightarrow 0}\frac{f'(x)}{g'(x)} &= \frac{f'(0)}{g'(0)} =\frac{3}{5} \end{align*}

Warning 3.7.8. Numerator limit nonzero.

If
\begin{align*} \lim\limits_{x\rightarrow a}g(x)&=0 &\text{but}&& \lim\limits_{x\rightarrow a}f(x)&\ne 0 \end{align*}
then
\begin{align*} \lim\limits_{x\rightarrow a}\frac{f(x)}{g(x)} && \text{need not be the same as} && \lim\limits_{x\rightarrow a}\frac{f'(x)}{g'(x)}. \end{align*}
Here is an example. Take
\begin{gather*} a=0\qquad \qquad f(x)=4+5x \qquad g(x)=3x \end{gather*}
Then
\begin{align*} \lim_{x\rightarrow 0}\frac{f(x)}{g(x)} &=\lim_{x\rightarrow 0}\frac{4+5x}{3x} & &=\text{DNE}\\ \lim_{x\rightarrow 0}\frac{f'(x)}{g'(x)} &=\lim_{x\rightarrow 0}\frac{5}{3} =\frac{5}{3} \end{align*}
This next one is more subtle; the limits of the original numerator and denominator functions both go to zero, but the limit of the ratio their derivatives does not exist.

Warning 3.7.9. Limit of ratio of derivatives DNE.

If
\begin{align*} \lim\limits_{x\rightarrow a}f(x)&=0 & \text{and}&& \lim\limits_{x\rightarrow a}g(x) &= 0 \end{align*}
but
\begin{align*} \lim\limits_{x\rightarrow a}\frac{f'(x)}{g'(x)} & \text{ does not exist} \end{align*}
then it is still possible that
\begin{align*} \lim\limits_{x\rightarrow a}\frac{f(x)}{g(x)} & \text{ exists.} \end{align*}
Here is an example. Take
\begin{gather*} a=0\qquad \qquad f(x)=x^2\sin\frac{1}{x} \qquad g(x)= x \end{gather*}
Then (with an application of the squeeze theorem)
\begin{align*} \lim_{x\to 0} f(x) &= 0 & \text{and}&& \lim_{x\to 0} g(x) &= 0. \end{align*}
If we attempt to apply l’Hôptial’s rule then we have \(g'(x)=1\) and
\begin{align*} f'(x)&=2x\sin\frac{1}{x} -\cos\frac{1}{x}\\ \end{align*}

and we then try to compute the limit

\begin{align*} \lim_{x\to 0} \frac{f'(x)}{g'(x)} &= \lim_{x\to 0} \left( 2x\sin\frac{1}{x} -\cos\frac{1}{x}\right) \end{align*}
However, this limit does not exist. The first term converges to 0 (by the squeeze theorem), but the second term \(\cos(1/x)\) just oscillates wildly between \(\pm 1\text{.}\) All we can conclude from this is
Since the limit of the ratio of derivatives does not exist, we cannot apply l’Hôpital’s rule.
Instead we should go back to the original limit and apply the squeeze theorem:
\begin{align*} \lim_{x\rightarrow 0}\frac{f(x)}{g(x)} &=\lim_{x\rightarrow 0}\frac{x^2\sin\frac{1}{x} }{x} =\lim_{x\rightarrow 0} x\sin\frac{1}{x} = 0, \end{align*}
since \(|x\sin(1/x)| \lt |x|\) and \(|x| \to 0\) as \(x\to 0\text{.}\)
It is also easy to construct an example in which the limits of numerator and denominator are both zero, but the limit of the ratio and the limit of the ratio of the derivatives do not exist. A slight change of the previous example shows that it is possible that
\begin{align*} \lim\limits_{x\rightarrow a}f(x) &=0 & \text{and}&& \lim\limits_{x\rightarrow a}g(x) &= 0 \end{align*}
but neither of the limits
\begin{align*} \lim\limits_{x\rightarrow a}\frac{f(x)}{g(x)} && \text{or}&& \lim\limits_{x\rightarrow a}\frac{f'(x)}{g'(x)} \end{align*}
exist. Take
\begin{gather*} a=0\qquad \qquad f(x)=x\sin\frac{1}{x} \qquad g(x)= x \end{gather*}
Then (with a quick application of the squeeze theorem)
\begin{align*} \lim_{x\to 0} f(x) &= 0 & \text{and}&& \lim_{x\to 0} g(x) &= 0. \end{align*}
However,
\begin{align*} \lim_{x\rightarrow 0}\frac{f(x)}{g(x)} &=\lim_{x\rightarrow 0}\frac{x\sin\frac{1}{x} }{x} =\lim_{x\rightarrow 0} \sin\frac{1}{x} \end{align*}
does not exist. And similarly
\begin{align*} \lim_{x\rightarrow 0}\frac{f'(x)}{g'(x)} &= \lim_{x\to 0} \frac{\sin\frac{1}{x} - \frac{1}{x}\cos\frac{1}{x} }{x^2} \end{align*}
does not exist.

Subsection 3.7.3 Variations

Theorem 3.7.2 is the basic form of L’Hôpital’s rule, but there are also many variations. Here are a bunch of them.

Subsubsection 3.7.3.1 Limits at \(\pm \infty\)

L’Hôpital’s rule also applies when the limit of \(x \to a\) is replaced by \(\lim\limits_{x\rightarrow a+}\) or by \(\lim\limits_{x\rightarrow a-}\) or by \(\lim\limits_{x\rightarrow +\infty}\) or by \(\lim\limits_{x\rightarrow -\infty}\text{.}\)
We can justify adapting the rule to the limits to \(\pm \infty\) via the following reasoning
\begin{align*} \lim_{x\to \infty} \frac{f(x)}{g(x)} &= \lim_{y \to 0^+} \frac{ f(1/y) }{ g(1/y) } & \text{substitute } x=1/y\\ &= \lim_{y \to 0^+} \frac{ -\frac{1}{y^2} f'(1/y) } { -\frac{1}{y^2}g'(1/y)}, \end{align*}
where we have used l’Hôpital’s rule (assuming this limit exists) and the fact that \(\diff{}{y} f(1/y) = -\frac{1}{y^2} f'(1/y)\) (and similarly for \(g\)). Cleaning this up and substituting \(y=1/x\) gives the required result:
\begin{align*} \lim_{x\to \infty} \frac{f(x)}{g(x)} & =\lim_{y \to 0^+} \frac{f'(1/y)} {g'(1/y)} =\lim_{x\to\infty} \frac{f'(x)}{g'(x)}. \end{align*}
Example 3.7.10. L’Hôpital at infinity.
Consider the limit
\begin{gather*} \lim_{x\to\infty} \frac{\arctan x - \frac{\pi}{2}}{ \frac{1}{x} } \end{gather*}
Both numerator and denominator go to \(0\) as \(x \to\infty\text{,}\) so this is an \(\frac00\) indeterminate form. We find
\begin{gather*} \lim_{x\rightarrow+\infty}\underbrace{\frac{\arctan x-\frac{\pi}{2}} {\frac{1}{x}}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} =\lim_{x\rightarrow +\infty}\frac{\frac{1}{1+x^2}} {-\frac{1}{x^2}} =-\lim_{x\rightarrow +\infty}\underbrace{\frac{1}{1+\frac{1}{x^2}}}_{\atp {\mathrm{num}\rightarrow 1} {\mathrm{den}\rightarrow 1}} =-1 \end{gather*}
We have applied L’Hôpital’s rule with
\begin{align*} f(x) &= \arctan x -\frac{\pi}{2}\qquad& g(x) &=\frac{1}{x}\\ f'(x)&=\frac{1}{1+x^2}& g'(x)&=-\frac{1}{x^2} \end{align*}

Subsubsection 3.7.3.2 \(\frac{\infty}{\infty}\) indeterminate form

L’Hôpital’s rule also applies when \(\lim\limits_{x\rightarrow a}f(x)=0\text{,}\) \(\lim\limits_{x\rightarrow a}g(x)=0\) is replaced by \(\lim\limits_{x\rightarrow a}f(x)=\pm\infty\text{,}\) \(\lim\limits_{x\rightarrow a}g(x)=\pm\infty\text{.}\)
Example 3.7.11. Compute \(\ds \lim_{x \to \infty} \frac{\log x}{x}\).
Consider the limit
\begin{gather*} \lim_{x \to \infty} \frac{\log x}{x} \end{gather*}
The numerator and denominator both blow up towards infinity so this is an \(\frac\infty\infty\) indeterminate form. An application of l’Hôpital’s rule gives
\begin{align*} \lim_{x \to \infty} \underbrace{\frac{\log x}{x}}_{\atp {\mathrm{num}\rightarrow \infty}{\mathrm{den}\rightarrow \infty}} &= \lim_{x \to \infty} \frac{1/x}{1}\\ &= \lim_{x \to \infty} \frac{1}{x} = 0 \end{align*}
Example 3.7.12. Find \(\ds \lim_{x \to \infty} \frac{5x^2+3x-3}{x^2+1}\).
Consider the limit
\begin{gather*} \lim_{x \to \infty} \frac{5x^2+3x-3}{x^2+1} \end{gather*}
Then by two applications of l’Hôpital’s rule we get
\begin{align*} \lim_{x \to \infty} \underbrace{\frac{5x^2+3x-3}{x^2+1}}_{\atp {\mathrm{num}\rightarrow \infty}{\mathrm{den}\rightarrow \infty}} &= \lim_{x \to \infty} \underbrace{\frac{10x+3}{2x}}_{\atp {\mathrm{num}\rightarrow \infty}{\mathrm{den}\rightarrow \infty}} = \lim_{x \to \infty} \frac{10}{2} = 5. \end{align*}
Example 3.7.13. A messier double l’Hôpital.
Compute the limit
\begin{gather*} \lim_{x\rightarrow 0+} \frac{\log x}{\tan\big(\frac{\pi}{2}-x\big)} \end{gather*}
We can compute this using l’Hôpital’s rule twice:
\begin{align*} \lim_{x\rightarrow 0+}\underbrace{\frac{\log x} {\tan\big(\frac{\pi}{2}-x\big)}}_{\atp {\mathrm{num}\rightarrow -\infty} {\mathrm{den}\rightarrow +\infty}} & =\lim_{x\rightarrow 0+}\frac{\frac{1}{x}} {-\sec^2(\frac{\pi}{2}-x)} =-\lim_{x\rightarrow 0+}\underbrace{\frac{\cos^2(\frac{\pi}{2}-x)}{x}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}}\\ &=-\lim_{x\rightarrow 0+}\underbrace{\frac {2\cos(\frac{\pi}{2}-x)\sin(\frac{\pi}{2}-x)}{1}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 1}} =0 \end{align*}
The first application of L’Hôpital’s was with
\begin{align*} f(x) &= \log x & g(x) &=\tan\Big(\frac{\pi}{2}-x\Big)\\ f'(x)&=\frac{1}{x}\qquad& g'(x)&=-\sec^2\Big(\frac{\pi}{2}-x\Big) \end{align*}
and the second time with
\begin{align*} f(x) &= \cos^2\Big(\frac{\pi}{2}-x\Big) & g(x) &=x\\ f'(x)&=2\cos\Big(\frac{\pi}{2}-x\Big) \Big[-\sin\Big(\frac{\pi}{2}-x\Big)\Big](-1)\qquad& g'(x)&=1 \end{align*}
Sometimes things don’t quite work out as we would like and l’Hôpital’s rule can get stuck in a loop. Remember to think about the problem before you apply any rule.
Example 3.7.14. Stuck in a loop.
Consider the limit
\begin{gather*} \lim_{x\to\infty} \frac{ e^x + e^{-x} }{e^x - e^{-x}} \end{gather*}
Clearly both numerator and denominator go to \(\infty\text{,}\) so we have a \(\frac\infty\infty\) indeterminate form. Naively applying l’Hôpital’s rule gives
\begin{align*} \lim_{x\to\infty} \frac{ e^x + e^{-x} }{e^x - e^{-x}} &= \lim_{x\to\infty} \frac{ e^x - e^{-x} }{e^x + e^{-x}} \end{align*}
which is again a \(\frac\infty\infty\) indeterminate form. So apply l’Hôpital’s rule again:
\begin{align*} \lim_{x\to\infty} \frac{ e^x - e^{-x} }{e^x + e^{-x}} &= \lim_{x\to\infty} \frac{ e^x + e^{-x} }{e^x - e^{-x}} \end{align*}
which is right back where we started!
The correct approach to such a limit is to apply the methods we learned in Chapter 1 and rewrite
\begin{align*} \frac{e^x+e^{-x}}{e^x-e^{-x}} &= \frac{e^x(1+e^{-2x})}{e^x(1-e^{-2x})} = \frac{1+e^{-2x}}{1-e^{-2x}} \end{align*}
and then take the limit.
A similar sort of l’Hôpital-rule-loop will occur if you naively apply l’Hôpital’s rule to the limit
\begin{gather*} \lim_{x\to\infty} \frac{\sqrt{4x^2+1}}{5x-1} \end{gather*}
which appeared in Example 1.5.6.

Subsubsection 3.7.3.3 Optional — Proof of l’Hôpital’s Rule for \(\frac\infty\infty\)

We can justify this generalisation of l’Hôpital’s rule with some careful manipulations. Since the derivatives \(f',g'\) exist in some interval around \(a\text{,}\) we know that \(f,g\) are continuous in some interval around \(a\text{;}\) let \(x,t\) be points inside that interval. Now rewrite
 4 
This is quite a clever argument, but it is not immediately obvious why one rewrites things this way. After the fact it becomes clear that it is done to massage the expression into the form where we can apply the generalised mean-value theorem (Theorem 3.4.38).
\begin{align*} \frac{f(x)}{g(x)} &= \frac{f(x)}{g(x)} +\underbrace{\left( \frac{f(t)}{g(x)} - \frac{f(t)}{g(x)}\right)}_{=0} + \underbrace{\left(\frac{f(x)-f(t)}{g(x)-g(t)} - \frac{f(x)-f(t)}{g(x)-g(t)}\right)}_{=0}\\ &= \underbrace{\frac{f(x)-f(t)}{g(x)-g(t)}}_\text{ready for GMVT} + \frac{f(t)}{g(x)} + \underbrace{\left( \frac{f(x)}{g(x)} - \frac{f(t)}{g(x)} - \frac{f(x)-f(t)}{g(x)-g(t)} \right)}_\text{we can clean it up}\\ &= \frac{f(x)-f(t)}{g(x)-g(t)} + \frac{f(t)}{g(x)} + \left( \frac{f(x)-f(t)}{g(x)} - \frac{f(x)-f(t)}{g(x)-g(t)} \right)\\ &= \frac{f(x)-f(t)}{g(x)-g(t)} + \frac{f(t)}{g(x)} + \left( \frac{1}{g(x)} - \frac{1}{g(x)-g(t)} \right)\cdot (f(x)-f(t))\\ &= \frac{f(x)-f(t)}{g(x)-g(t)} + \frac{f(t)}{g(x)} + \left( \frac{g(x)-g(t) - g(x)}{g(x)(g(x)-g(t))} \right)\cdot (f(x)-f(t))\\ &= \underbrace{\frac{f(x)-f(t)}{g(x)-g(t)}}_\text{ready for GMVT} + \frac{f(t)}{g(x)} - \frac{g(t)}{g(x)}\cdot \underbrace{\frac{f(x)-f(t)}{g(x)-g(t)}}_\text{ready for GMVT} \end{align*}
Oof! Now the generalised mean-value theorem (Theorem 3.4.38) tells us there is a \(c\) between \(x\) and \(t\) so that
\begin{align*} \frac{f(x)-f(t)}{g(x)-g(t)} &= \frac{f'(c)}{g'(c)} \end{align*}
Now substitute this into the large expression we derived above:
\begin{align*} \frac{f(x)}{g(x)} &= \frac{f'(c)}{g'(c)} + \frac{1}{g(x)}\left(f(t) - \frac{f'(c)}{g'(c)}\cdot g(t) \right) \end{align*}
At first glance this does not appear so useful, however if we fix \(t\) and take the limit as \(x \rightarrow a\text{,}\) then it becomes
\begin{align*} \lim_{x\to a}\frac{f(x)}{g(x)} &= \lim_{x\to a} \frac{f'(c)}{g'(c)} + \lim_{x\to a} \frac{1}{g(x)}\left(f(t) - \frac{f'(c)}{g'(c)}\cdot g(t) \right)\\ \end{align*}

Since \(g(x) \to \infty\) as \(x \to a\text{,}\) this last term goes to zero

\begin{align*} &= \lim_{x\to a} \frac{f'(c)}{g'(c)} + 0 \end{align*}
Now take the limit as \(t\to a\text{.}\) The left-hand side is unchanged since it is independent of \(t\text{.}\) The right-hand side, however, does change; the number \(c\) is trapped between \(x\) and \(t\text{.}\) Since we have already taken the limit \(x\to a\text{,}\) so when we take the limit \(t \to a\text{,}\) we are effectively taking the limit \(c \to a\text{.}\) Hence
\begin{align*} \lim_{x\to a}\frac{f(x)}{g(x)} &= \lim_{c\to a} \frac{f'(c)}{g'(c)} \end{align*}
which is the desired result.

Subsubsection 3.7.3.4 \(0\cdot\infty\) indeterminate form

When \(\ds \lim_{x\to a}f(x) = 0\) and \(\ds \lim_{x\to a} g(x) = \infty\text{.}\) We can use a little algebra to manipulate this into either a \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\) form:
\begin{align*} \lim_{x \to a} \frac{f(x)}{1/g(x)} && \lim_{x \to a} \frac{g(x)}{1/f(x)} \end{align*}
Example 3.7.15. \(\ds \lim_{x\to 0^+} x \cdot \log x\).
Consider the limit
\begin{gather*} \lim_{x\to 0^+} x \cdot \log x \end{gather*}
Here the function \(f(x)=x\) goes to zero, while \(g(x)=\log x\) goes to \(-\infty\text{.}\) If we rewrite this as the fraction
\begin{align*} x \cdot \log x &= \frac{\log x}{1/x} \end{align*}
then the \(0 \cdot \infty\) form has become an \(\frac\infty\infty\) form.
The result is then
\begin{align*} \lim_{x\rightarrow 0+}\underbrace{x}_{\rightarrow 0} \underbrace{\log x}_{\rightarrow-\infty} & =\lim_{x\rightarrow 0+}\underbrace{\frac{\log x} {\frac{1}{x}}}_{\atp {\mathrm{num}\rightarrow-\infty} {\mathrm{den}\rightarrow\infty}} =\lim_{x\rightarrow 0+}\frac{\frac{1}{x}}{-\frac{1}{x^2}} =-\lim_{x\rightarrow 0+}x =0 \end{align*}
Example 3.7.16. Computing \(\lim\limits_{x\rightarrow +\infty} x^n e^{-x}\).
In this example we’ll evaluate \(\lim\limits_{x\rightarrow +\infty} x^n e^{-x}\text{,}\) for all natural numbers \(n\text{.}\) We’ll start with \(n=1\) and \(n=2\) and then, using what we have learned from those cases, move on to general \(n\text{.}\)
\begin{align*} \lim_{x\rightarrow +\infty}\underbrace{x}_{\rightarrow \infty} \underbrace{e^{-x}}_{\rightarrow 0} & =\lim_{x\rightarrow +\infty}\underbrace{\frac{x} {e^x}}_{\atp {\mathrm{num}\rightarrow+\infty} {\mathrm{den}\rightarrow+\infty}} =\lim_{x\rightarrow +\infty}\underbrace{\frac{1} {e^x}}_{\atp {\mathrm{num}\rightarrow 1} {\mathrm{den}\rightarrow+\infty}} =\lim_{x\rightarrow +\infty}e^{-x} =0 \end{align*}
Applying l’Hôpital twice,
\begin{align*} \lim_{x\rightarrow +\infty}\underbrace{x^2}_{\rightarrow \infty} \underbrace{e^{-x}}_{\rightarrow 0} & =\lim_{x\rightarrow +\infty}\underbrace{\frac{x^2} {e^x}}_{\atp {\mathrm{num}\rightarrow+\infty} {\mathrm{den}\rightarrow+\infty}} =\lim_{x\rightarrow +\infty}\underbrace{\frac{2x} {e^x}}_{\atp {\mathrm{num}\rightarrow \infty} {\mathrm{den}\rightarrow+\infty}} =\lim_{x\rightarrow +\infty}\underbrace{\frac{2} {e^x}}_{\atp {\mathrm{num}\rightarrow 2} {\mathrm{den}\rightarrow+\infty}} =\lim_{x\rightarrow +\infty}2e^{-x}\\ \amp=0 \end{align*}
Indeed, for any natural number \(n\text{,}\) applying l’Hôpital \(n\) times gives
\begin{align*} \lim_{x\rightarrow +\infty}\underbrace{x^n}_{\rightarrow \infty} \underbrace{e^{-x}}_{\rightarrow 0} & =\lim_{x\rightarrow +\infty}\hskip-5pt\underbrace{\frac{x^n} {e^x}}_{\atp {\mathrm{num}\rightarrow+\infty} {\mathrm{den}\rightarrow+\infty}}\\ & =\lim_{x\rightarrow +\infty}\underbrace{\frac{nx^{n-1}} {e^x}}_{\atp {\mathrm{num}\rightarrow \infty} {\mathrm{den}\rightarrow+\infty}}\\ & =\lim_{x\rightarrow +\infty}\underbrace{\frac{n(n-1)x^{n-2}} {e^x}}_{\atp {\mathrm{num}\rightarrow \infty} {\mathrm{den}\rightarrow+\infty}}\\ &=\cdots =\lim_{x\rightarrow +\infty}\underbrace{\frac{n!} {e^x}}_{\atp {\mathrm{num}\rightarrow n!} {\mathrm{den}\rightarrow+\infty}} =0 \end{align*}

Subsubsection 3.7.3.5 \(\infty-\infty\) indeterminate form

When \(\ds \lim_{x\to a}f(x) = \infty\) and \(\ds \lim_{x\to a} g(x) = \infty\text{.}\) We rewrite the difference as a fraction using a common denominator
\begin{align*} f(x) - g(x) &= \frac{h(x)}{\ell(x)} \end{align*}
which is then a \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\) form.
Example 3.7.17. Compute \(\ds \lim_{x\to \frac{\pi}{2}^-} \left( \sec x - \tan x\right)\).
Consider the limit
\begin{gather*} \lim_{x\to \frac{\pi}{2}^-} \left( \sec x - \tan x\right) \end{gather*}
Since the limit of both \(\sec x\) and \(\tan x\) is \(+\infty\) as \(x \to \frac{\pi}{2}^-\text{,}\) this is an \(\infty-\infty\) indeterminate form. However we can rewrite this as
\begin{align*} \sec x - \tan x &= \frac{1}{\cos x} - \frac{\sin x}{\cos x} = \frac{1-\sin x}{\cos x} \end{align*}
which is then a \(\frac00\) indeterminate form. This then gives
\begin{align*} \lim_{x\rightarrow \frac{\pi}{2}^-}\Big( \underbrace{\sec x}_{\rightarrow +\infty} - \underbrace{\tan x}_{\rightarrow+\infty}\Big) & =\lim_{x\rightarrow \frac{\pi}{2}^-}\underbrace{\frac{1-\sin x} {\cos x}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} =\lim_{x\rightarrow \frac{\pi}{2}^-}\underbrace{\frac{-\cos x} {-\sin x}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow -1}} =0 \end{align*}
In the last example, Example 3.7.17, we converted an \(\infty-\infty\) indeterminate form into a \(\frac{0}{0}\) indeterminate form by exploiting the fact that the two terms, \(\sec x\) and \(\tan x\text{,}\) in the \(\infty-\infty\) indeterminate form shared a common denominator, namely \(\cos x\text{.}\) In the “real world” that will, of course, almost never happen. However as the next couple of examples show, you can often massage these expressions into suitable forms.
Here is another, much more complicated, example, where it doesn’t happen.
Example 3.7.18. A complicated \(\infty-\infty\) example.
In this example, we evaluate the \(\infty-\infty\) indeterminate form
\begin{gather*} \lim_{x\rightarrow 0}\Big( \underbrace{\frac{1}{x}}_{\rightarrow \pm\infty} - \underbrace{\frac{1}{\log(1+x)}}_{\rightarrow\pm\infty}\Big) \end{gather*}
We convert it into a \(\frac{0}{0}\) indeterminate form simply by putting the two fractions, \(\frac{1}{x}\) and \(\frac{1}{\log(1+x)}\) over a common denominator.
\begin{equation*} \lim_{x\rightarrow 0}\Big( \underbrace{\frac{1}{x}}_{\rightarrow \pm\infty} - \underbrace{\frac{1}{\log(1+x)}}_{\rightarrow\pm\infty}\Big) =\lim_{x\rightarrow 0}\underbrace{\frac{\log(1+x)-x}{x\log(1+x)}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} \tag{E1} \end{equation*}
Now we apply L’Hôpital’s rule, and simplify
\begin{align*} \lim_{x\rightarrow 0}\underbrace{\frac{\log(1+x)-x}{x\log(1+x)}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} &=\lim_{x\rightarrow 0}\frac{\frac{1}{1+x}-1} {\log(1+x)+\frac{x}{1+x}}\\ \amp=\lim_{x\rightarrow 0}\frac{1-(1+x)} {(1+x)\log(1+x)+x}\\ &=-\lim_{x\rightarrow 0}\underbrace{\frac{x} {(1+x)\log(1+x)+x}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 1\times 0+0=0}} \tag{E2} \end{align*}
Then we apply L’Hôpital’s rule a second time
\begin{align*} -\lim_{x\rightarrow 0}\underbrace{\frac{x} {(1+x)\log(1+x)+x}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 1\times 0+0=0}} \amp=-\lim_{x\rightarrow 0}\underbrace{\frac{1} {\log(1+x)+\frac{1+x}{1+x}+1}}_{\atp {\mathrm{num}\rightarrow 1} {\mathrm{den}\rightarrow 0+1+1=2}}\\ \amp=-\frac{1}{2} \tag{E3} \end{align*}
Combining (E1), (E2) and (E3) gives our final answer
\begin{gather*} \lim_{x\rightarrow 0}\Big(\frac{1}{x} - \frac{1}{\log(1+x)}\Big) =-\frac{1}{2} \end{gather*}
The following example can be done by l’Hôpital’s rule, but it is actually far simpler to multiply by the conjugate and take the limit using the tools of Chapter 1.
Example 3.7.19. Compute \(\ds \lim_{x\to \infty} \sqrt{x^2+4x}-\sqrt{x^2-3x}\).
Consider the limit
\begin{gather*} \lim_{x\to \infty} \sqrt{x^2+4x}-\sqrt{x^2-3x} \end{gather*}
Neither term is a fraction, but we can write
\begin{align*} \sqrt{x^2+4x}-\sqrt{x^2-3x} &= x\sqrt{1+4/x}-x\sqrt{1-3/x} & \text{assuming } x \gt 0\\ &= x \left( \sqrt{1+4/x}-\sqrt{1-3/x} \right)\\ &= \frac{\sqrt{1+4/x}-\sqrt{1-3/x}}{1/x} \end{align*}
which is now a \(\frac00\) form with \(f(x)=\sqrt{1+4/x}-\sqrt{1-3/x}\) and \(g(x)=1/x\text{.}\) Then
\begin{align*} f'(x) &= \frac{-4/x^2}{2\sqrt{1+4/x}} - \frac{3/x^2}{2\sqrt{1-3/x}} & g'(x) &= - \frac{1}{x^2} \end{align*}
Hence
\begin{align*} \frac{f'(x)}{g'(x)} &= \frac{4}{2\sqrt{1+4/x}} + \frac{3}{\sqrt{1-3/x}} \end{align*}
And so in the limit as \(x\to \infty\)
\begin{align*} \lim_{x\to \infty} \frac{f'(x)}{g'(x)} &= \frac{4}{2}+\frac{3}{2} = \frac{7}{2} \end{align*}
and so our original limit is also \(7/2\text{.}\)
By comparison, if we multiply by the conjugate we have
\begin{align*} \sqrt{x^2\!+\!4x}-\sqrt{x^2\!-\!3x} &= \left( \sqrt{x^2\!+\!4x}-\sqrt{x^2\!-\!3x}\right) \cdot \frac{\sqrt{x^2\!+\!4x}+\sqrt{x^2\!-\!3x}}{\sqrt{x^2\!+\!4x}+\sqrt{x^2\!-\!3x}}\\ &= \frac{ x^2+4x - (x^2-3x)}{\sqrt{x^2+4x}+\sqrt{x^2-3x}}\\ &= \frac{ 7x}{\sqrt{x^2+4x}+\sqrt{x^2-3x}}\\ &= \frac{7}{\sqrt{1+4/x}+\sqrt{1-3/x}} \qquad \text{assuming } x \gt 0 \end{align*}
Now taking the limit as \(x\to\infty\) gives \(7/2\) as required. Just because we know l’Hôpital’s rule, it does not mean we should use it everywhere it might be applied.

Subsubsection 3.7.3.6 \(1^\infty\) indeterminate form

We can use l’Hôpital’s rule on limits of the form
\begin{align*} \lim_{x\to a} f(x)^{g(x)} & \text{ with }\\ \lim_{x\to a} f(x) &= 1 & \text{ and } && \lim_{x \to a} g(x) &= \infty \end{align*}
by considering the logarithm of the limit
 5 
We are using the fact that the logarithm is a continuous function and Theorem 1.6.10.
:
\begin{align*} \log\left( \lim_{x\to a} f(x)^{g(x)} \right) &= \lim_{x\to a} \log\left( f(x)^{g(x)} \right) = \lim_{x\to a} \log\left( f(x) \right) \cdot g(x) \end{align*}
which is now an \(0 \cdot \infty\) form. This can be further transformed into a \(\frac00\) or \(\frac\infty\infty\) form:
\begin{align*} \log\left( \lim_{x\to a} f(x)^{g(x)} \right) &=\lim_{x\to a} \log\left( f(x) \right) \cdot g(x)\\ &= \lim_{x\to a} \frac{\log\left( f(x) \right)}{1/g(x)}. \end{align*}
Example 3.7.20. Find \(\ds \lim_{x\rightarrow 0}(1+x)^{\frac{a}{x}}\).
The following limit appears quite naturally when considering systems which display exponential growth or decay.
\begin{gather*} \lim_{x\rightarrow 0}(1+x)^{\frac{a}{x}} \qquad\text{with the constant } a\ne 0 \end{gather*}
Since \((1+x) \to 1\) and \(a/x \to \infty\) this is an \(1^\infty\) indeterminate form.
By considering its logarithm we have
\begin{align*} \log\left( \lim_{x\to 0}(1+x)^{\frac{a}{x}}\right) &= \lim_{x\to 0}\log\left( (1+x)^{\frac{a}{x}}\right)\\ &= \lim_{x\to 0} \frac{a}{x} \log(1+x)\\ &= \lim_{x\to 0} \frac{a\log (1+x)}{x} \end{align*}
which is now a \(\frac00\) form. Applying l’Hôpital’s rule gives
\begin{gather*} \lim_{x\rightarrow 0}\underbrace{\frac{a\log(1+x)}{x}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} =\lim_{x\rightarrow 0}\underbrace{\frac{\frac{a}{1+x}}{1}}_{\atp {\mathrm{num}\rightarrow a} {\mathrm{den}\rightarrow 1}} =a \end{gather*}
Since \((1 + x)^{a/x} = \exp\left[\log\Big((1 + x)^{a/x}\Big)\right]\) and the exponential function is continuous, our original limit is \(e^a\text{.}\)
Here is a more complicated example of a \(1^\infty\) indeterminate form.
Example 3.7.21. A more complicated example.
In the limit
\begin{gather*} \lim_{x\rightarrow 0}\Big(\frac{\sin x}{x}\Big)^{\frac{1}{x^2}} \end{gather*}
the base, \(\frac{\sin x}{x}\text{,}\) converges to \(1\) (see Example 3.7.3) and the exponent, \(\frac{1}{x^2}\text{,}\) goes to \(\infty\text{.}\) But if we take logarithms then
\begin{gather*} \log \Big(\frac{\sin x}{x}\Big)^{\frac{1}{x^2}} = \frac{\log\frac{\sin x}{x}}{x^2} \end{gather*}
then, in the limit \(x\rightarrow 0\text{,}\) we have a \(\frac{0}{0}\) indeterminate form. One application of l’Hôpital’s rule gives
\begin{align*} \lim_{x\rightarrow 0}\underbrace{\frac{\log\frac{\sin x}{x}}{x^2}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} & =\lim_{x\rightarrow 0} \frac {\frac{x}{\sin x}\frac{x\cos x -\sin x}{x^2} }{2x} =\lim_{x\rightarrow 0} \frac{ \frac{x\cos x -\sin x}{x\sin x} }{2x} =\lim_{x\rightarrow 0} \frac{x\cos x -\sin x}{2x^2\sin x} \end{align*}
which is another \(\frac00\) form. Applying l’Hôpital’s rule again gives:
\begin{align*} \lim_{x\rightarrow 0}\underbrace{ \frac{x\cos x -\sin x}{2x^2\sin x} }_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} &=\lim_{x\rightarrow 0} \frac{\cos x -x\sin x-\cos x}{4x\sin x+2x^2\cos x}\\ &=-\lim_{x\rightarrow 0} \frac{x\sin x}{4x\sin x+2x^2\cos x} =-\lim_{x\rightarrow 0} \frac{\sin x}{4\sin x+2x\cos x} \end{align*}
which is yet another \(\frac00\) form. Once more with l’Hôpital’s rule:
\begin{align*} -\lim_{x\rightarrow 0}\underbrace{ \frac{\sin x}{4\sin x+2x\cos x} }_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 0}} &=-\lim_{x\rightarrow 0}\underbrace{ \frac{\cos x}{4\cos x+2\cos x-2x\sin x} }_{\atp {\mathrm{num}\rightarrow 1} {\mathrm{den}\rightarrow 6}}\\ &=-\frac{1}{6} \end{align*}
Oof! We have just shown that the logarithm of our original limit is \(-\frac{1}{6}\text{.}\) Hence the original limit itself is \(e^{-1/6}\text{.}\)
This was quite a complicated example. However it does illustrate the importance of cleaning up your algebraic expressions. This will both reduce the amount of work you have to do and will also reduce the number of errors you make.

Subsubsection 3.7.3.7 \(0^0\)indeterminate form

Like the \(1^\infty\) form, this can be treated by considering its logarithm.
Example 3.7.22. Compute \(\ds \lim_{x\rightarrow 0+}x^x\).
For example, in the limit
\begin{gather*} \lim_{x\rightarrow 0+}x^x \end{gather*}
both the base, \(x\text{,}\) and the exponent, also \(x\text{,}\) go to zero. But if we consider the logarithm then we have
\begin{gather*} \log x^x = x\log x \end{gather*}
which is a \(0\cdot\infty\) indeterminate form, which we already know how to treat. In fact, we already found, in Example 3.7.15, that
\begin{gather*} \lim_{x\rightarrow 0+} x\log x=0 \end{gather*}
Since the exponential is a continuous function
\begin{gather*} \lim_{x\rightarrow 0+}x^x =\lim_{x\rightarrow 0+}\exp\big(x\log x\big) =\exp\Big(\lim_{x\rightarrow 0+}x\log x\Big) =e^0 =1 \end{gather*}

Subsubsection 3.7.3.8 \(\infty^0\) indeterminate form

Again, we can treat this form by considering its logarithm.
Example 3.7.23. Find \(\ds \lim_{x\rightarrow +\infty}x^{\frac{1}{x}}\).
For example, in the limit
\begin{gather*} \lim_{x\rightarrow +\infty}x^{\frac{1}{x}} \end{gather*}
the base, \(x\text{,}\) goes to infinity and the exponent, \(\frac{1}{x}\text{,}\) goes to zero. But if we take logarithms
\begin{gather*} \log x^{\frac{1}{x}} =\frac{\log x}{x} \end{gather*}
which is an \(\frac\infty\infty\) form, which we know how to treat.
\begin{gather*} \lim_{x\rightarrow +\infty}\underbrace{\frac{\log x}{x}}_{\atp {\mathrm{num}\rightarrow \infty} {\mathrm{den}\rightarrow \infty}} =\lim_{x\rightarrow +\infty}\underbrace{\frac{\frac{1}{x}}{1}}_{\atp {\mathrm{num}\rightarrow 0} {\mathrm{den}\rightarrow 1}} =0 \end{gather*}
Since the exponential is a continuous function
\begin{gather*} \lim_{x\rightarrow +\infty}x^{\frac{1}{x}} =\lim_{x\rightarrow +\infty}\exp\Big(\frac{\log x}{x}\Big) =\exp\Big(\lim_{x\rightarrow \infty}\frac{\log x}{x}\Big) =e^0 =1 \end{gather*}

Exercises 3.7.4 Exercises

Exercises — Stage 1 .

In Questions 3.7.4.1 to 3.7.4.3, you are asked to give pairs of functions that combine to make indeterminate forms. Remember that an indeterminate form is indeterminate precisely because its limit can take on a number of values.
1.
Give two functions \(f(x)\) and \(g(x)\) with the following properties:
  1. \(\displaystyle \ds\lim_{x \to \infty} f(x)=\infty\)
  2. \(\displaystyle \ds\lim_{x \to \infty} g(x)=\infty\)
  3. \(\displaystyle \ds\lim_{x \to \infty} \dfrac{f(x)}{g(x)}=2.5\)
2.
Give two functions \(f(x)\) and \(g(x)\) with the following properties:
  1. \(\displaystyle \ds\lim_{x \to \infty} f(x)=\infty\)
  2. \(\displaystyle \ds\lim_{x \to \infty} g(x)=\infty\)
  3. \(\displaystyle \ds\lim_{x \to \infty} \dfrac{f(x)}{g(x)}=0\)
3.
Give two functions \(f(x)\) and \(g(x)\) with the following properties:
  1. \(\displaystyle \ds\lim_{x \to \infty} f(x)=1\)
  2. \(\displaystyle \ds\lim_{x \to \infty} g(x)=\infty\)
  3. \(\displaystyle \ds\lim_{x \to \infty} [f(x)]^{g(x)}=5\)

Exercises — Stage 2 .

4. (✳).
Evaluate \(\lim\limits_{x\rightarrow 1}\dfrac{x^3-e^{x-1}}{\sin(\pi x)}\text{.}\)
5. (✳).
Evaluate \(\lim\limits_{x\rightarrow 0+}\dfrac{\log x}{x}\text{.}\) (Remember: in these notes, \(\log\) means logarithm base \(e\text{.}\))
6. (✳).
Evaluate \(\lim\limits_{x\rightarrow\infty}(\log x)^2e^{-x}\text{.}\)
7. (✳).
Evaluate \(\lim\limits_{x\rightarrow\infty}x^2e^{-x}\text{.}\)
8. (✳).
Evaluate \(\lim\limits_{x\rightarrow 0}\dfrac{x-x\cos x}{x-\sin x}\text{.}\)
9.
Evaluate \(\ds\lim_{x \to 0}\dfrac{\sqrt{x^6+4x^4}}{x^2\cos x}\text{.}\)
10. (✳).
Evaluate \(\lim\limits_{x\rightarrow\infty}\dfrac{(\log x)^2}{x}\text{.}\)
11. (✳).
Evaluate \(\lim\limits_{x\rightarrow0}\dfrac{1-\cos x}{\sin^2 x}\text{.}\)
12.
Evaluate \(\ds\lim_{x \to 0}\dfrac{x}{\sec x}\text{.}\)
13.
Evaluate \(\ds\lim_{x\to0}\dfrac{\csc x\cdot \tan x\cdot (x^2+5)}{e^x}\text{.}\)
14.
Evaluate \(\ds\lim_{x \to \infty}\sqrt{2x^2+1}-\sqrt{x^2+x}\text{.}\)
15. (✳).
Evaluate \(\lim\limits_{x\rightarrow 0}\dfrac{\sin(x^3+3x^2)}{\sin^2x}\text{.}\)
16. (✳).
Evaluate \(\lim\limits_{x\rightarrow1}\dfrac{\log(x^3)}{x^2-1}\text{.}\)
17. (✳).
Evaluate \(\lim\limits_{x\rightarrow 0}\dfrac{e^{-1/x^2}}{x^4}\text{.}\)
18. (✳).
Evaluate \(\lim\limits_{x\rightarrow 0} \dfrac{xe^x}{\tan (3x)}\text{.}\)
19.
Evaluate \(\lim\limits_{x \to 0}\sqrt[x^2]{\sin^2 x}\text{.}\)
20.
Evaluate \(\lim\limits_{x \to 0}\sqrt[x^2]{\cos x}\text{.}\)
21.
Evaluate \(\ds\lim_{x \to 0^+} e^{x \log x}\text{.}\)
22.
Evaluate \(\ds\lim_{x \rightarrow 0} \left[-\log(x^2)\right]^x\text{.}\)
23. (✳).
Find \(c\) so that \(\lim\limits_{x\rightarrow 0} \dfrac{1+cx-\cos x}{ e^{x^2}-1}\) exists.
24. (✳).
Evaluate \(\lim\limits_{x\rightarrow 0}\dfrac{e^{k\sin(x^2)}-(1+2x^2)}{x^4}\text{,}\) where \(k\) is a constant.

Exercises — Stage 3 .

25.
Suppose an algorithm, given an input with with \(n\) variables, will terminate in at most \(S(n)=5n^4-13n^3-4n+\log (n)\) steps. A researcher writes that the algorithm will terminate in roughly at most \(A(n)=5n^4\) steps. Show that the percentage error involved in using \(A(n)\) instead of \(S(n)\) tends to zero as \(n\) gets very large. What happens to the absolute error?
Remark: this is a very common kind of approximation. When people deal with functions that give very large numbers, often they don’t care about the exact large number--they only want a ballpark. So, a complicated function might be replaced by an easier function that doesn’t give a large relative error. If you would like to know more about the ways people describe functions that give very large numbers, you can read about “Big O Notation” in Section 3.6.3 of the CLP2 textbook.