Subsection3.7.1L’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
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.
Definition3.7.1.First indeterminate forms.
Let \(a \in \mathbb{R}\) and let \(f(x)\) and \(g(x)\) be functions. If
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.
while, if \(f'(x)\) and \(g'(x)\) exist, with \(g'(x)\) nonzero, on an open interval that contains \(a\text{,}\) except possibly at \(a\) itself, and if the limit
\begin{gather*}
\lim\limits_{x\rightarrow a}\frac{f'(x)}{g'(x)} \text{ exists or is $+\infty$ or is $-\infty$}
\end{gather*}
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
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
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{.}\)
Subsubsection3.7.1.1Optional — 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.
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]\)
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
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.
\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*}
\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*}
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.
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:
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
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.
Subsubsection3.7.3.1Limits 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
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:
Subsubsection3.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{.}\)
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
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.
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
Subsubsection3.7.3.3Optional — 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).
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
Subsubsection3.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:
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{.}\)
Subsubsection3.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
which is then a \(\frac{0}{0}\) or \(\frac{\infty}{\infty}\) form.
Example3.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
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.
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.
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.
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.
Subsubsection3.7.3.6\(1^\infty\) indeterminate form
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.
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
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.
Subsubsection3.7.3.7\(0^0\)indeterminate form
Like the \(1^\infty\) form, this can be treated by considering its logarithm.
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:
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.