Consider the limit \[\lim_{x\to a}\, \frac{f(x)}{g(x)}.\] If both the numerator and the denominator are finite at $a$ and $g(a)\neq 0$, then \[\lim_{x\to a}\, \frac{f(x)}{g(x)}=\frac{f(a)}{g(a)}.\]
Example
$\displaystyle\lim_{x\to 3}\, \frac{x^2+1}{x+2}=\frac{10}{5}=2$.
But what happens if both the numerator and the denominator tend to $0$? It is not clear what the limit is. In fact, depending on what functions $f(x)$ and $g(x)$ are, the limit can be anything at all!
Example
$\displaystyle\begin{array}{l@{\qquad\qquad}l} \displaystyle\lim_{x\to 0}\, \frac{x^3}{x^2}=\lim_{x\to 0} x=0. & \displaystyle\lim_{x\to 0}\, \frac{-x}{x^3}=\lim_{x\to 0} \frac{-1}{x^2}=-\infty.\\ \displaystyle\lim_{x\to 0}\, \frac{x}{x^2}=\lim_{x\to 0} \frac{1}{x}=\infty. & \displaystyle\lim_{x\to 0}\, \frac{kx}{x}=\lim_{x\to 0} k=k. \end{array}$
These limits are examples of indeterminate forms of type $\frac{0}{0}$. L’Hôpital’s Rule provides a method for evaluating such limits. We will denote $\displaystyle\lim_{x\to a}, \lim_{x\to a^+}, \lim_{x\to a^-}, \lim_{x\to \infty}, {\small\textrm{ and }} \lim_{x\to -\infty}$ generically by $\lim$ in what follows.
L’Hôpital’s Rule for $\displaystyle\frac{0}{0}$
Suppose $\lim f(x)=\lim g(x)=0$. Then
- If $\displaystyle \lim\, \frac{f'(x)}{g'(x)}=L$, then $\displaystyle \lim\, \frac{f(x)}{g(x)}=\lim \frac{f'(x)}{g'(x)}=L$.
- If $\displaystyle \lim\, \frac{f'(x)}{g'(x)}$ tends to $+\infty$ or $-\infty$ in the limit, then so does $\displaystyle\frac{f(x)}{g(x)}$.
Example
- $\displaystyle \lim_{x\to 0}\, \frac{\sin x}{x}=\lim_{x\to 0}\, \frac{\frac{d}{dx}(\sin x)}{\frac{d}{dx}(x)}=\lim_{x\to 0}\, \frac{\cos x}{1}=1.$
- $\displaystyle \lim_{x\to 1}\, \frac{2\ln x}{x-1}=\lim_{x\to 1}\, \frac{\frac{d}{dx}(2\ln x)}{\frac{d}{dx}(x-1)}=\lim_{x\to 1}\, \frac{~\frac{2}{x}~}{1}=2.$
- $\displaystyle \lim_{x\to 0}\, \frac{e^x-1}{x^2}=\lim_{x\to 0}\, \frac{\frac{d}{dx}(e^x-1)}{\frac{d}{dx}(x^2)}=\lim_{x\to 0}\, \frac{e^x}{2x}=\text{does not exist}.$
If the numerator and the denominator both tend to $\infty$ or $-\infty$, L’Hôpital’s Rule still applies.
L’Hôpital’s Rule for $\displaystyle\frac{\infty}{\infty}$
Suppose $\lim f(x)$ and $\lim g(x)$ are both infinite. Then
- If $\displaystyle \lim\, \frac{f'(x)}{g'(x)}=L$, then $\displaystyle \lim\, \frac{f(x)}{g(x)}=\lim \frac{f'(x)}{g'(x)}=L$.
- If $\displaystyle \lim\, \frac{f'(x)}{g'(x)}$ tends to $+\infty$ or $-\infty$ in the limit, then so does $\displaystyle\frac{f(x)}{g(x)}$.
The proof of this form of L’Hôpital’s Rule requires more advanced analysis.
Here are some examples of indeterminate forms of type $\displaystyle\frac{\infty}{\infty}$.
Example
$\displaystyle\lim_{x\to\infty} \frac{e^x}{x}=\lim_{x\to\infty} \frac{e^x}{1}=\infty.$
Sometimes it is necessary to use L’Hôpital’s Rule several times in the same problem:
Example
$\displaystyle\lim_{x\to 0} \frac{1-\cos x}{x^2}=\lim_{x\to 0}\frac{\sin x}{2x}=\lim_{x\to 0}\frac{\cos x}{2}=\frac{1}{2}.$
Occasionally, a limit can be re-written in order to apply L’Hôpital’s Rule:
Example
$\displaystyle\lim_{x\to 0}\, x\ln x=\lim_{x\to 0}\frac{\ln x}{\frac{1}{x}}=\lim_{x\to 0}\, \frac{~\frac{1}{x}~}{-\frac{1}{x^2}}=\lim_{x\to 0}\, (-x)=0.$
We can use other tricks to apply L’Hôpital’s Rule. In the next example, we use L’Hôpital’s Rule to evaluate an indeterminate form of type $0^0$:
Example
To evaluate $\displaystyle \lim_{x\to 0^+}\, x^x$, we will first evaluate $\displaystyle \lim_{x\to 0^+}\, \ln (x^x)$. \[\lim_{x\to 0^+}\, \ln (x^x)=\lim_{x\to 0^+}\, x\ln (x)=0,\quad {\small\textrm{ by the previous example}}.\] Then since $\displaystyle\lim_{x\to 0^+}\, \ln (x^x)\to 0$ as $x\to 0^+$ and $\ln (u)=0$ if and only if $u=1$, \[x^x\to 1 \quad\textrm{as}\quad x\to 0^+.\] Thus, \[\lim_{x\to 0^+}\, x^x=1.\]
Notice that L’Hôpital’s Rule only applies to indeterminate forms. For the limit in the first example of this tutorial, L’Hôpital’s Rule does not apply and would give an incorrect result of 6. L’Hôpital’s Rule is powerful and remarkably easy to use to evaluate indeterminate forms of type $\frac{0}{0}$ and $\frac{\infty}{\infty}$.
Key Concepts
Suppose $\lim f(x) = \lim g(x) = 0$. Then
- If $\displaystyle\lim \frac{f'(x)}{g'(x)} = L,$ then $\displaystyle\lim \frac{f(x)}{g(x)} = \displaystyle\lim \frac{f'(x)}{g'(x)} = L$.
- If $\displaystyle\lim \frac{f'(x)}{g'(x)}$ tends to $+\infty$ or $-\infty$ in the limit, then so does $\frac{f(x)}{g(x)}$.
L’Hôpital’s Rule for $\frac{\infty}{\infty}$
Suppose $\lim f(x)$ and $\lim g(x)$ are both infinite. Then
- If $\displaystyle\lim \frac{f'(x)}{g'(x)} = L$, then $\displaystyle\lim \frac{f(x)}{g(x)} = \displaystyle\lim \frac{f'(x)}{g'(x)} = L$.
- If $\displaystyle\lim \frac{f'(x)}{g'(x)}$ tends to $+\infty$ or $-\infty$ in the limit, then so does $\frac{f(x)}{g(x)}$.