L'Hopital's Theorem
Introduction
Differential calculus can be of help when evaluating limits of the form \(\frac{0}{0}\), \(\frac{\infty}{\infty}\), \(0\cdot \infty\), \(\infty^0\), and \(0^0\). L’Hopital’s theorem is a result that simplifies calculation of limits of fractions \( \lim_{x\to a}\frac{f(x)}{g(x)}\) where \(f\) and \(g\) are functions such that \( \lim_{x\to a}f(x)=\lim_{x\to a}g(x)=0\).
The limits of the form \( \lim_{x\to a}f(x) g(x)\) where one of \(f\) and \(g\) converges to \(0\) and the other to \(\infty\) can be re-written in the form \( \lim_{x\to a}\frac{f(x)}{\frac1{g(x)}}\) or \( \lim_{x\to a}\frac{g(x)}{\frac1{f(x)}}\), so the main task is to develop a method to tackle the problems of evaluating limits of fractions.
The limits of the form \( \lim f(x)^{g(x)}\) can be treated using \(f(x)^{g(x)}=e^{\ln \left(f(x)^{g(x)}\right)}=e^{g(x)\ln f(x)}\). Thus, evalution of limits of that type also reduces to evaluation of \( g(x)\ln f(x)=\frac{\ln f(x)}{\frac1{g(x)}}\).
This presentation of L’Hopital’s theorem starts with precise statement of the theorem followed by examples on how to use it and how not to use it. In the end we present the proof that relies on a discrete version of L’Hopital’s theorem known as Cesaro-Stolz lemma.
Statement of the theorem and applications
L’Hopital’s theorem
Assume that \(f\) and \(g\) are differentiable functions on an open interval containing real number \(a\). Assume that \(g\neq 0\) on that interval. Assume that \(\displaystyle \lim_{x\to a} \frac{f^{\prime}(x)}{g^{\prime}(x)}=L\) for some real number \(L\) and assume that one of the following two conditions is satisfied:
- (a) \(\displaystyle \lim_{x\to a}g(x)=+\infty\).
- (b) \(\displaystyle \lim_{x\to a}f(x)=\lim_{x\to a}g(x)=0\).
Then \(\displaystyle \lim_{x\to a}\frac{f(x)}{g(x)}=L\).
The proof is presented in the end of the text.
Example 1
Evaluate the limit \(\displaystyle \lim_{x\to 0}\frac{\sin x}{x}\).
Let us take \(f(x)=\sin x\) and \(g(x)=x\). Then we have \(\lim_{x\to 0}f(x)=\lim_{x\to 0}g(x)=0\), \(f^{\prime}(x)=\cos x\), and \(g^{\prime}(x)=1\). Since \[\lim_{x\to 0}\frac{f^{\prime}(x)}{g^{\prime}(x)}=\lim_{x\to 0}\frac{\cos x}{1}=1, \] according to L’Hopital’s theorem we have \[\lim_{x\to 0}\frac{f(x)}{g(x)}=\lim_{x\to 0}\frac{\sin x}{x}=1.\]
Example 2
Evaluate the limit \(\displaystyle \lim_{x\to 0}\frac{1-\cos x}{x^2}\).
Let us take \(f(x)=1-\cos x\) and \(g(x)=x^2\). Then we have \(\lim_{x\to 0}f(x)=\lim_{x\to 0}g(x)=0\), \(f^{\prime}(x)=\sin x\), and \(g^{\prime}(x)=2x\). From example 1 we have that \[\lim_{x\to 0}\frac{f^{\prime}(x)}{g^{\prime}(x)}=\lim_{x\to 0}\frac{\sin x}{2x}=\frac12\lim_{x\to0}\frac{\sin x}{x}. \] According to L’Hopital’s theorem we have \[\lim_{x\to 0}\frac{f(x)}{g(x)}=\lim_{x\to 0}\frac{1-\cos x}{x^2}=\frac12.\]
The preceding two examples are the simplest applications of L’Hopital’s theorem. In the development of the fundamentals of mathematical analysis it is not correct to use l’Hopital’s theorem to establish the previous two limits. Using L’Hopital’s theorem to prove that \(\sin x/x\to 1\) would create a logical error called circular reasoning. Namely, the evaluation of the limit \(\lim_{x\to0}\frac{\sin x}x\) requires us to know that the derivative of \(\sin x\) is equal to \(\cos x\). This result was proved using the fact that \(\lim_{x\to 0}\frac{\sin x}x=1\).
However, if we know that \((\sin x)^{\prime}=\cos x\), then Example 1 is a correct application of L’Hopital’s theorem to prove that \(\displaystyle \lim_{x\to 0}\frac{\sin x}x=1\). The trouble is that all those who know that \((\sin x)^{\prime}=\cos x\) probably already know that \(\frac{\sin x}x\to 1\) as \(x\to 0\).
Example 3
Evaluate the limit \(\displaystyle \lim_{x\to 0}x^x\).
Let us first re-write \(\displaystyle x^x=e^{\ln(x^x)}=e^{x\ln x}\). Since \(f(z)=e^z\) is a continuous function, it suffices to find the limit \(\displaystyle \lim_{x\to 0}x\ln x\).
\begin{eqnarray*}\lim_{x\to 0}x\ln x&=&\lim_{x\to 0}\frac{\ln x}{\frac1x}.
\end{eqnarray*}
The last limit can be found using L’Hopital’s theorem applied to \(g(x)=-\ln x\) and \(h(x)=\frac1x\). Both functions converge to \(+\infty\) and their derivatives satisfy \(g^{\prime}(x)=-\frac1x\) and \(h(x)=-\frac1{x^2}\) hence \(\displaystyle \lim_{x\to 0}\frac{g^{\prime}(x)}{h^{\prime}(x)}=0\). Thus \(\displaystyle \lim_{x\to 0}x^x=\lim_{x\to 0}e^0=1\).
Cases when L’Hopital’s theorem cannot be applied
It is important to verify all the conditions of the L’Hopital’s theorem. The following example shows that it is possible that \(\displaystyle \lim \frac{f^{\prime}(x)}{g^{\prime}(x)}\) does not exist, while \(\displaystyle \lim\frac{f(x)}{g(x)}\) does.
Consider \(f(x)=x+\cos x\) and \(g(x)=x\). Since \(\cos x\in [-1,1]\), we have that \(\displaystyle \frac{f(x)}{g(x)}\in \left[ 1-\frac1x, 1+\frac1x\right]\) for \(x > 0\), and by squeeze theorem the limit of the fraction \(\frac{f(x)}{g(x)}\) is equal to \(1\). However, \(f^{\prime}(x)=-\sin x\) and \(g^{\prime}(x)=1\), hence \(\displaystyle \lim_{x\to 0}\frac{f^{\prime}(x)}{g^{\prime}(x)}\) does not exist.
Proof of L’Hopital’s theorem
We will first prove a discrete version of the L’Hopital’s theorem: the case when instead of functions we are dealing with sequences. We may see a sequence \((a_n)_{n=1}^{\infty}\) as a special case of a function. The finite difference \(\frac{a_{n+1}-a_n}{(n+1)-n}\) plays a role that derivative plays when studying functions.
Cesaro-Stolz’s theorem
Assume that \((x_n)_{n=1}^{\infty}\) and \((y_n)_{n=1}^{\infty}\) are two sequences of real numbers such that \(y_n\) is increasing and \(\lim_{n\to\infty}y_n=+\infty\).
- (a) The following three inequalities hold:
\[ \liminf \frac{x_{n+1}-x_n}{y_{n+1}-y_n}\leq \liminf\frac{x_n}{y_n}\leq \limsup\frac{x_n}{y_n}\leq \limsup \frac{x_{n+1}-x_n}{y_{n+1}-y_n}.\]
- (b) Assume that \(\displaystyle\lim_{n\to\infty}\frac{x_{n+1}-x_n}{y_{n+1}-y_n}=L\). Then the limit \(\displaystyle \lim_{n\to\infty}\frac{x_n}{y_n}\) exists and is equal to \(L\).
Notice that (b) is a consequence of (a), so we will only prove part (a).
The middle inequality is obvious as \(\limsup\) is always bigger than \(\lim\inf\). The leftmost inequality is analogous to the rightmost, so we will only prove one of them: the right-most.
Let \(\gamma\) be any number greater than \(\displaystyle \frac{x_{n+1}-x_n}{y_{n+1}-y_n}\). Since \(\gamma\) is not \(\limsup\) of the sequence, there exists \(N\) such that for all \(n > N\) the following inequality holds \(\displaystyle \frac{x_{n+1}-x_n}{y_{n+1}-y_n} < \gamma\). Let \(m\in\mathbb N\) be any integer greater than \(N\). According to the previouos inequality we have:
\begin{eqnarray*}
x_{N+1}-x_N&< &\gamma\left(y_{N+1}-y_N\right)\newline
x_{N+2}-x_{N+1}&< &\gamma\left(y_{N+2}-y_{N+1}\right)\newline
x_{N+3}-x_{N+2}&< &\gamma\left(y_{N+3}-y_{N+2}\right)\newline
&\vdots&\newline
x_{m}-x_{m-1}&< &\gamma\left(y_{m}-y_{m-1}\right).
\end{eqnarray*}
Adding all of the previous \(m-N\) inequalities yield:
\[x_m-x_N < \gamma\left(y_m-y_N\right) \quad\quad\Rightarrow \quad\quad \frac{x_m}{y_m}-\frac{x_N}{y_m} < \gamma-\gamma\frac{y_N}{y_m}.\]
Since \(y_m\to+\infty\) as \(n\to\infty\) we conclude that \[\limsup \frac{x_m}{y_m}\leq\gamma.\]
This holds for every \(\displaystyle \gamma > \limsup \frac{x_{n+1}-x_n}{y_{n+1}-y_n}\) thus
\[\limsup \frac{x_m}{y_m}\leq\limsup\frac{x_{n+1}-x_n}{y_{n+1}-y_n}.\]
L’Hopital’s theorem
Assume that \(f\) and \(g\) are differentiable functions on an open interval containing real number \(a\). Assume that \(g\neq 0\) and \(g^{\prime}\neq 0\) on that interval. Assume that \(\displaystyle \lim_{x\to a} \frac{f^{\prime}(x)}{g^{\prime}(x)}=L\) for some real number \(L\) and assume that one of the following two conditions is satisfied:
- (a) \(\displaystyle \lim_{x\to a}g(x)=+\infty\).
- (b) \(\displaystyle \lim_{x\to a}f(x)=\lim_{x\to a}g(x)=0\).
Then \(\displaystyle \lim_{x\to a}\frac{f(x)}{g(x)}=L\).
- (a) Since we assumed that \(g^{\prime}\neq 0\), according to Darboux’s mean value theorem we may assume that \(g^{\prime}\) is either positive or negative. That means that \(g\) is monotone. It suffices to prove that for each monotone sequence \(x_n\) such that \(\displaystyle \lim_{n\to \infty}x_n=a\) we have \(\displaystyle\lim_{n\to \infty}\frac{f(x_n)}{g(x_n)}=L\).
The sequence \(g(x_n)\) is increasing and converges to \(+\infty\) hence according to Cesaro-Stolz theorem we have
\[\liminf \frac{f(x_{n+1})-f(x_{n})}{g(x_{n+1})-g(x_n)}\leq \liminf \frac{f(x_n)}{g(x_n)}\leq \limsup \frac{f(x_n)}{g(x_n)}\leq \limsup \frac{f(x_{n+1})-f(x_n)}{g(x_{n+1})-g(x_n)}.\]
According to Cauchy mean-value theorem we have that there exists a sequence of numbers \(\xi_n\in(x_n,x_{n+1})\) such that \[\frac{f(x_{n+1})-f(x_n)}{g(x_{n+1})-g(x_n)}=\frac{f^{\prime}(\xi_n)}{g^{\prime}(\xi_n)}.\]
We must have \(\xi_n\to a\) since \(\xi_n\in(x_n,x_{n+1})\). According to our assumption that \(\displaystyle \lim_{x\to a}\frac{f^{\prime}(x)}{g^{\prime}(x)}=L\) we have: \[
L=\liminf \frac{f’(\xi_n)}{g’(\xi_n)}\leq \liminf \frac{f(x_n)}{g(x_n)}\leq \limsup \frac{f(x_n)}{g(x_n)}\leq \limsup \frac{f’(\xi_n)}{g’(\xi_n)}=L.
\]
This completes the proof in the case (a).
- (b)
Let \(\varepsilon > 0\). There exists a neighborhood \(U\) of \(a\) such that \(x\in U\) implies that \(\displaystyle \left|\frac{f^{\prime}(x)}{g^{\prime}(x)}-L\right| < \varepsilon \). Take any \(x\in U\) and let \(y_n\in U\) be a monotone sequence converging to \(a\). According to Cauchy’s mean value theorem we have that there exists a sequence \((\xi_n)_{n=1}^{\infty}\) such that \(\xi_n\in (x,y_n)\) and \[\frac{f(x)-f(y_n)}{g(x)-g(y_n)}=\frac{f^{\prime}(\xi_n)}{g^{\prime}(\xi_n)}\in (L-\varepsilon, L+\varepsilon).\] Therefore the sequence \(\displaystyle \left(\frac{f(x)-f(y_n)}{g(x)-g(y_n)}\right)_{n=1}^{\infty}\) has all its terms in \((L-\varepsilon, a+\varepsilon)\). It remains to notice that \(\displaystyle\lim_{n\to\infty} \frac{f(x)-f(y_n)}{g(x)-g(y_n)}=\frac{f(x)}{g(x)}\) hence \(\displaystyle \frac{f(x)}{g(x)}\in (L-\varepsilon, L+\varepsilon)\) which completes the proof of the part (b) of the theorem.
Practice problems
Problem 1. Determine the following limit:
\(\displaystyle \lim_{x\to0}\frac{ \sin\left(5x^2\right)}{x^2}\).
Let \(f(x)=\sin\left(5x^2\right)\) and \(g(x)=x^2\). Since \(\displaystyle \lim_{x\to 0}f(x)=\lim_{x\to0}g(x)=0\), and \(f\) and \(g\) are differentiable, we will first evaluate the limit \(\displaystyle \lim_{x\to0}\frac{f^{\prime}(x)}{g^{\prime}(x)}\). If that limit exists, according to l’Hopital’s theorem, the original limit would exist as well, and they would be equal.
We have that \(f^{\prime}(x)=\cos\left(5x^2\right)\cdot 2\cdot 5\cdot x\) and \(g^{\prime}(x)=2x\). Therefore \[ \lim_{x\to 0}\frac{f^{\prime}(x)}{g^{\prime}(x)}=\lim_{x\to 0}\frac{\cos\left(5x^2\right)\cdot 2\cdot 5\cdot x}{2x}=5\cdot\lim_{x\to 0}\cos\left(5x^2\right)=5.\]
Problem 2. Determine the following limit:
\(\displaystyle \lim_{x\to0}\frac{ e^{8x}-1}{x}\).
Let \(f(x)=e^{8x}-1\) and \(g(x)=x\). Since \(\displaystyle \lim_{x\to 0}f(x)=\lim_{x\to0}g(x)=0\), and \(f\) and \(g\) are differentiable, we will first evaluate the limit \(\displaystyle \lim_{x\to0}\frac{f^{\prime}(x)}{g^{\prime}(x)}\). If that limit exists, according to l’Hopital’s theorem, the original limit would exist as well, and they would be equal.
We have that \(f^{\prime}(x)=8e^{8x}\) and \(g^{\prime}(x)=1\). Therefore \[ \lim_{x\to 0}\frac{f^{\prime}(x)}{g^{\prime}(x)}=
8\lim_{x\to 0}e^{8x}
=
8,\] and the original limit is \(8\).
Problem 3. Determine the following limit:
\(\displaystyle \lim_{x\to0}\frac{ 3^{x}-1}{x}\).
Let \(f(x)=3^{x}-1=e^{\ln 3\cdot x}-1\) and \(g(x)=x\). Since \(\displaystyle \lim_{x\to 0}f(x)=\lim_{x\to0}g(x)=0\), and \(f\) and \(g\) are differentiable, we will first evaluate the limit \(\displaystyle \lim_{x\to0}\frac{f^{\prime}(x)}{g^{\prime}(x)}\). If that limit exists, according to l’Hopital’s theorem, the original limit would exist as well, and they would be equal.
_/p_
_p_We have that \(f^{\prime}(x)=\ln 3 e^{\ln 3 \cdot x}\) and \(g^{\prime}(x)=1\). Therefore \[ \lim_{x\to 0}\frac{f^{\prime}(x)}{g^{\prime}(x)}=
\ln 3 \lim_{x\to 0}e^{\ln 3 \cdot x}
=
\ln 3 ,\] and the original limit is \(\ln 3 \).
Problem 4. Determine the real number \(\alpha\) such that the function \(\displaystyle h(x)=\frac{-3x +3\sin x +\alpha x^3}{x^5}\) has a non-zero finite limit as \(x\) approaches \(0\).
Let \(f(x)=-3x +3\sin x +\alpha x^3\) and \(g(x)=x^5\). Since \(\displaystyle \lim_{x\to 0}f(x)=\lim_{x\to0}g(x)=0\), and \(f\) and \(g\) are differentiable, we will first evaluate the limit \(\displaystyle \lim_{x\to0}\frac{f^{\prime}(x)}{g^{\prime}(x)}\). If that limit exists, according to l’Hopital’s theorem, the original limit would exist as well, and they would be equal.
We have that \(f^{\prime}(x)=-3 +3\cos x+3\alpha x^2\) and \(g^{\prime}(x)=5x^4\). We again have \(\displaystyle \lim_{x\to 0}f^{\prime}(x)=\lim_{x\to 0}g^{\prime}(x)=0\) hence if the limit \(\displaystyle \lim_{x\to 0}\frac{f^{\prime\prime}(x)}{g^{\prime\prime}(x)}\) exists then the original limit would exist and they would be equal.
We have \(f^{\prime\prime}(x)=-3\sin x+6\alpha x\) and \(g^{\prime\prime}(x)=20x^3\). Using the similar argument, it suffices to find \(\alpha\) for which the limit \(\displaystyle \lim_{x\to 0}\frac{f^{\prime\prime\prime}(x)}{g^{\prime\prime\prime}(x)}\) exists. Since \(f^{\prime\prime\prime}(x)=-3 \cos x+6\alpha\) and \(g^{\prime\prime\prime}(x)=60x^2\), the limit \(\displaystyle \lim_{x\to 0}\frac{f^{\prime\prime\prime}(x)}{g^{\prime\prime\prime}(x)}\) would not be exist if \(\alpha\neq \frac12\).
We will now prove that if \(\alpha\neq \frac12\) the original limit is not finite. Under the assumption \(\alpha\neq \frac12\) we have that \(\displaystyle\lim_{x\to 0} \frac{g^{\prime\prime\prime}(x)}{f^{\prime\prime\prime}(x)}=0\), hence successive applications of L’Hopital’s theorem imply that \[ \lim_{x\to0}\frac{g^{\prime\prime}(x)}{f^{\prime\prime}(x)}=0\quad\Rightarrow\quad \lim_{x\to0}\frac{g^{\prime}(x)}{f^{\prime}(x)}=0 \quad\Rightarrow\quad \lim_{x\to0}\frac{g(x)}{f(x)}=0.\] This would imply that \(\displaystyle \lim_{x\to0}\frac{f(x)}{g(x)}\) is not finite.
On the other hand, if \(\displaystyle \alpha= \frac12\), then the we can evaluate the limit \(\displaystyle \lim_{x\to 0}\frac{f^{(4)}(x)}{g^{(4)}(x)}=\lim_{x\to 0}\frac{3\sin x}{120 x}=\frac{3}{120}=\frac1{40}.\)
Thus the limit is finite if and only if \(\alpha =\frac12\).
Problem 5. Among the following pairs of functions, determine the pair \((f,g)\) for which \(\displaystyle \lim_{x\to +\infty}\frac{f(x)}{g(x)}\) does exist, but \(\displaystyle \lim_{x\to +\infty}\frac{f^{\prime}(x)}{g^{\prime}(x)}\) does not. This pair can serve as an example where l’Hopital’s theorem cannot be applied.
- (A) \(\displaystyle f(x)=x\cos x\), \(\displaystyle g(x)=3x\)
- (B) \(\displaystyle f(x)=x+\frac{\sin x}x\), \(\displaystyle g(x)=3x\)
- (C) \(\displaystyle f(x)=x^2+3x+5\), \(\displaystyle g(x)=3x^2-17\)
- (D) \(\displaystyle f(x)=x+\sin x\), \(\displaystyle g(x)=3x\)
- (E) Such pair of functions does not exist, according to L’Hopital’s theorem.
This pair of functions is presented in choice D. We will first prove that the limit of the function \(\frac{f(x)}{g(x)}\) exists. Observe that \(\frac{f(x)}{g(x)}=\frac13+\frac{\sin x}{3x}\). We have that \(-1\leq \sin x\leq 1\) hence: \[\frac13-\frac1{3x}\leq \frac{x+\sin x}{3x}\leq \frac13+\frac1{3x}.\] Since \(\displaystyle \lim_{x\to +\infty}\left(\frac13-\frac1{3x}\right)=\lim_{x\to +\infty}\left(\frac13+\frac1{3x}\right)=\frac13\), according to squeeze theorem we have \[\lim_{x\to +\infty}\frac{f(x)}{g(x)}=\frac13.\]
However, since \(f^{\prime}(x)=1+\cos x\) and \(g^{\prime}(x)=3\), the ratio \(\displaystyle \frac{f^{\prime}(x)}{g^{\prime}(x)}=\frac13+\frac{\cos x}3\) oscillates between \(0\) and \(\frac23\) as \(x\to+\infty\) and the limit of that ratio does not exist.
The choice A offers two functions \(f\) and \(g\) for which neither of the limits \(\displaystyle \lim_{x\to+\infty} \frac{f(x)}{g(x)}\) and \(\displaystyle \lim_{x\to+\infty} \frac{f^{\prime}(x)}{g^{\prime}(x)}\) exists.
For the functions in choices B and C both limits \(\displaystyle \lim_{x\to+\infty} \frac{f(x)}{g(x)}\) and \(\displaystyle \lim_{x\to+\infty} \frac{f^{\prime}(x)}{g^{\prime}(x)}\) exist.