# Calculus/L'Hôpital's Rule

## L'Hôpital's Rule

Occasionally, one comes across a limit which results in ${\displaystyle {\frac {0}{0}}}$ or ${\displaystyle {\frac {\infty }{\infty }}}$ , which are called indeterminate limits. However, it is still possible to solve these in many cases due to L'Hôpital's rule. This rule also is vital in explaining how a number of other limits can be derived.

Definition: Indeterminate Limit
If ${\displaystyle {\frac {f(c)}{g(c)}}}$ exists, where ${\displaystyle \lim _{x\to c}f(x)=\lim _{x\to c}g(x)=0}$ or ${\displaystyle \lim _{x\to c}f(x)=\lim _{x\to c}g(x)=\infty }$ , the limit ${\displaystyle \lim _{x\to c}{\frac {f(x)}{g(x)}}}$ is said to be indeterminate.

All of the following expressions are indeterminate forms.

${\displaystyle {\frac {0}{0}},{\frac {\pm \infty }{\pm \infty }},\infty -\infty ,0\cdot \infty ,0^{0},\infty ^{0},1^{\infty }}$

These expressions are called indeterminate because you cannot determine their exact value in the indeterminate form. Depending on the situation, each indeterminate form could evaluate to a variety of values.

### Theorem

If ${\displaystyle \lim _{x\to c}{\frac {f(x)}{g(x)}}}$ is indeterminate of type ${\displaystyle {\frac {0}{0}}}$ or ${\displaystyle {\frac {\pm \infty }{\pm \infty }}}$ ,

then ${\displaystyle \lim _{x\to c}{\frac {f(x)}{g(x)}}=\lim _{x\to c}{\frac {f'(x)}{g'(x)}}}$

In other words, if the limit of the function is indeterminate, the limit equals the derivative of the top over the derivative of the bottom. If that is indeterminate, L'Hôpital's rule can be used again until the limit isn't ${\displaystyle {\frac {0}{0}}}$ or ${\displaystyle {\frac {\infty }{\infty }}}$ .

Note:

${\displaystyle x}$ can approach a finite value c, ${\displaystyle \infty }$ or ${\displaystyle -\infty }$ .

### Proof of the ${\displaystyle {\frac {0}{0}}}$ case

Suppose that for real functions ${\displaystyle f}$ and ${\displaystyle g}$ , ${\displaystyle \lim _{x\to c}f(x)=0}$ and ${\displaystyle \lim _{x\to c}g(x)=0}$ and that ${\displaystyle \lim _{x\to c}{\frac {f'(x)}{g'(x)}}}$ exists. Thus ${\displaystyle f'(x)}$ and ${\displaystyle g'(x)}$ exist in an interval ${\displaystyle (c-\delta ,c+\delta )}$ around ${\displaystyle c}$ , but maybe not at ${\displaystyle c}$ itself. This implies that both ${\displaystyle f}$ and ${\displaystyle g}$ are differentiable (and thus continuous) everywhere in ${\displaystyle (c-\delta ,c+\delta )}$ except perhaps at ${\displaystyle c}$. Thus, for any ${\displaystyle x}$ in ${\displaystyle (c-\delta ,c+\delta )}$ , in any interval ${\displaystyle [c,x]}$ or ${\displaystyle [x,c]}$ , ${\displaystyle f}$ and ${\displaystyle g}$ are continuous and differentiable, with the possible exception of ${\displaystyle c}$ . Define

${\displaystyle F(x)=\left\{{\begin{matrix}f(x),&{\mbox{if }}x\neq c\\\lim \limits _{x\to c}f(x),&{\mbox{if }}x=c\end{matrix}}\right.}$     and    ${\displaystyle G(x)=\left\{{\begin{matrix}g(x),&{\mbox{if }}x\neq c\\\lim \limits _{x\to c}g(x),&{\mbox{if }}x=c\end{matrix}}\right.}$

Note that ${\displaystyle \lim _{x\to c}{\frac {f(x)}{g(x)}}=\lim _{x\to c}{\frac {F(x)}{G(x)}}}$ , ${\displaystyle \lim _{x\to c}{\frac {f'(x)}{g'(x)}}=\lim _{x\to c}{\frac {F'(x)}{G'(x)}}}$ and that ${\displaystyle F(x)}$ and ${\displaystyle G(x)}$ are continuous in any interval ${\displaystyle [c,x]}$ or ${\displaystyle [x,c]}$ and differentiable in any interval ${\displaystyle (c,x)}$ or ${\displaystyle (x,c)}$ when ${\displaystyle x}$ is in ${\displaystyle (c-\delta ,c+\delta )}$ . Cauchy's Mean Value Theorem tells us that ${\displaystyle {\frac {F(x)-F(c)}{G(x)-G(c)}}={\frac {F'(\xi )}{G'(\xi )}}}$ for some ${\displaystyle \xi }$ in ${\displaystyle (c,x)}$ (if ${\displaystyle x>c}$) or ${\displaystyle (x,c)}$ (if ${\displaystyle x). Since ${\displaystyle F(c)=G(c)=0}$ , we have ${\displaystyle {\frac {F(x)}{G(x)}}={\frac {F'(\xi )}{G'(\xi )}}}$ for ${\displaystyle x}$ and ${\displaystyle \xi }$ in ${\displaystyle (c-\delta ,c+\delta )}$ . Note that ${\displaystyle \lim _{x\to c}{\frac {F'(\xi )}{G'(\xi )}}}$ is the same limit as ${\displaystyle \lim _{x\to c}{\frac {F'(x)}{G'(x)}}}$ since both ${\displaystyle x}$ and ${\displaystyle \xi }$ are being squeezed to ${\displaystyle c}$ . So taking the limit as ${\displaystyle x\to c}$ of the last equation gives ${\displaystyle \lim _{x\to c}{\frac {F(x)}{G(x)}}=\lim _{x\to c}{\frac {F'(x)}{G'(x)}}}$ which is equivalent to ${\displaystyle \lim _{x\to c}{\frac {f(x)}{g(x)}}=\lim _{x\to c}{\frac {f'(x)}{g'(x)}}}$ .

## Examples

### Example 1

Find ${\displaystyle \lim _{x\to 0}{\frac {\sin(x)}{x}}}$

Since plugging in 0 for x results in ${\displaystyle {\frac {0}{0}}}$ , use L'Hôpital's rule to take the derivative of the top and bottom, giving:

${\displaystyle \lim _{x\to 0}{\frac {{\frac {d}{dx}}\left(\sin(x)\right)}{{\frac {d}{dx}}(x)}}=\lim _{x\to 0}{\frac {\cos(x)}{1}}}$

Plugging in 0 for x gives 1 here.

### Example 2

Find ${\displaystyle \lim _{x\to 0}x\cot(x)}$

First, you need to rewrite the function into an indeterminate limit fraction:

${\displaystyle \lim _{x\to 0}{\frac {x}{\tan(x)}}}$

Now it's indeterminate. Take the derivative of the top and bottom:

${\displaystyle \lim _{x\to 0}{\frac {1}{\sec ^{2}(x)}}}$

Plugging in 0 for x once again gives 1.

### Example 3

Find ${\displaystyle \lim _{x\to \infty }{\frac {4x+22}{5x+9}}}$

This time, plugging in ${\displaystyle \infty }$ for x gives you ${\displaystyle {\frac {\infty }{\infty }}}$ . You know the drill:

${\displaystyle \lim _{x\to \infty }{\frac {4}{5}}}$

This time, though, there is no x term left! ${\displaystyle {\frac {4}{5}}}$ is the answer.

### Example 4

Sometimes, forms exist where it is not intuitively obvious how to solve them. One might think the value ${\displaystyle 1^{\infty }=1.}$ However, as was noted in the definition of an indeterminate form, this isn't possible to evaluate using the rules learned before now, and we need to use L'Hôpital's rule to solve.

Find ${\displaystyle \lim _{x\to \infty }\left(1+{\frac {1}{x}}\right)^{x}}$

Plugging the value of x into the limit yields

${\displaystyle \lim _{x\to \infty }\left(1+{\frac {1}{x}}\right)^{x}=1^{\infty }}$ (indeterminate form).

Let ${\displaystyle k=\lim _{x\to \infty }\left(1+{\frac {1}{x}}\right)^{x}=1^{\infty }}$

 ${\displaystyle \ln(k)}$ ${\displaystyle =\lim _{x\to \infty }\ln \left(1+{\frac {1}{x}}\right)^{x}}$ ${\displaystyle =\lim _{x\to \infty }x\ln \left(1+{\frac {1}{x}}\right)}$ ${\displaystyle =\lim _{x\to \infty }{\frac {\ln \left(1+{\frac {1}{x}}\right)}{\frac {1}{x}}}={\frac {\ln(1)}{\frac {1}{x}}}={\frac {0}{0}}}$ (indeterminate form)

We now apply L'Hôpital's rule by taking the derivative of the top and bottom with respect to ${\displaystyle x}$ .

${\displaystyle {\frac {d}{dx}}\left[\ln \left(1+{\frac {1}{x}}\right)\right]={\frac {x}{x+1}}\cdot {\frac {-1}{x^{2}}}=-{\frac {1}{x(x+1)}}}$
${\displaystyle {\frac {d}{dx}}\left({\frac {1}{x}}\right)=-{\frac {1}{x^{2}}}}$

Returning to the expression above

 ${\displaystyle \ln(k)}$ ${\displaystyle =\lim _{x\to \infty }{\frac {-(-x^{2})}{x(x+1)}}}$ ${\displaystyle =\lim _{x\to \infty }{\frac {x}{x+1}}={\frac {\infty }{\infty }}}$ (indeterminate form)

We apply L'Hôpital's rule once again

${\displaystyle \ln(k)=\lim _{x\to \infty }{\frac {1}{1}}=1}$

Therefore

${\displaystyle k=e}$

And

${\displaystyle \lim _{x\to \infty }\left(1+{\frac {1}{x}}\right)^{x}=e\neq 1}$

Careful: this does not prove that ${\displaystyle 1^{\infty }=e}$ because

${\displaystyle \lim _{x\to \infty }\left(1+{\frac {2}{x}}\right)^{x}=1^{\infty }\neq e}$

## Exercises

Evaluate the following limits using L'Hôpital's rule:

1. ${\displaystyle \lim _{x\to 0}{\frac {x+\tan(x)}{\sin(x)}}}$

${\displaystyle 2}$

2. ${\displaystyle \lim _{x\to \pi }{\frac {x-\pi }{\sin(x)}}}$

${\displaystyle -1}$

3. ${\displaystyle \lim _{x\to 0}{\frac {\sin(3x)}{\sin(4x)}}}$

${\displaystyle {\frac {3}{4}}}$

4. ${\displaystyle \lim _{x\to \infty }{\frac {x^{5}}{e^{5x}}}}$

${\displaystyle 0}$

5. ${\displaystyle \lim _{x\to 0}{\frac {\tan(x)-x}{\sin(x)-x}}}$

${\displaystyle -2}$

Solutions