# Serlo: EN: L'Hôspital's rule

* ↳ Project "Serlo"
* ↳ Real Analysis Contents "Real Analysis" Help Introduction  Complex numbers  Supremum and infimum  Sequences  Convergence and divergence  Subsequences, Accumulation points and Cauchy sequences  Series  Convergence criteria for series  Exponential and Logarithm functions  Trigonometric and Hyperbolic functions  Continuity  Differential Calculus  Derivatives  Computing derivatives  Computing derivatives - special  Derivative - inverse function  Examples for derivatives  Derivatives of higher order  Rolle's theorem  Mean value theorem  Constant functions  Monotone functions  Derivative and local extrema  L'Hôspital's rule  Overview: continuity and differentiability  Exercises 1  Exercises 2  Exercises 3  Exercises 4
As a final application of the mean value theorem, more precisely the second mean value theorem, we want to derive L'Hospital's rule. This is a practical way to determine the limit of a quotient by separately differentiating numerator and denominator. The rule is named after the French mathematician Guillaume de l'Hôpital, but was first derived by the Swiss mathematician Johann Bernoulli.

## L’Hospital's rule

Theorem (L’Hospital's rule)
Let ${\tilde {x}}\in \mathbb {R} \cup \lbrace -\infty ,\infty \rbrace$ and $I:={(a,{\tilde {x}})}$ with $a<{\tilde {x}}$ or $I:={({\tilde {x}},b)}$ with $b>{\tilde {x}}$. Let $f,g:I\to \mathbb {R}$ be two differentiable functions where $g'(x)\neq 0$ for all $x\in I$. Further, suppose that the limit $\lim _{x\to {\tilde {x}}}{\tfrac {f'(x)}{g'(x)}}=:q$ exists and one of the following two statements is true:
* $\lim _{x\to {\tilde {x}}}{f(x)}=0$ and $\lim _{x\to {\tilde {x}}}{g(x)}=0$
* $\lim _{x\to {\tilde {x}}}{f(x)},\lim _{x\to {\tilde {x}}}{g(x)}\in \lbrace -\infty ,\infty \rbrace$.
Then, there is $\lim _{x\to {\tilde {x}}}{\tfrac {f(x)}{g(x)}}=q$.
Proof (L’Hospital's rule)
We first look at the case with ${\tilde {x}}\in \mathbb {R}$. Because $\lim _{x\to {\tilde {x}}}{f(x)}=0$ and $\lim _{x\to {\tilde {x}}}{g(x)}=0$ we can continue the functions $f$ and $g$ continuously. We obtain the functions ${\hat {f}},{\hat {g}}:I\cup \lbrace {\tilde {x}}\rbrace \to \mathbb {R}$ with ${\hat {f}}(x):=f(x)$ and ${\hat {g}}(x):=g(x)$ for all $x\in I$. Further we set ${\hat {f}}({\tilde {x}}):=0$ and ${\hat {g}}({\tilde {x}}):=0$.
We now look at any sequence $(x_{n})_{n\in \mathbb {N} }$ which converges towards ${\tilde {x}}$. Since the functions ${\hat {f}}$ and ${\hat {g}}$ are continuous, we can apply the generalized mean value theorem. So there is a sequence $(z_{n})_{n\in \mathbb {N} }$, such that for all $n\in \mathbb {N}$ we have $z_{n}\in {({\tilde {x}},x_{n})}$ or $z_{n}\in {(x_{n},{\tilde {x}})}$ and
${\begin{aligned}&{\frac {f(x_{n})}{g(x_{n})}}\\[0.3em]&{\color {Gray}\left\downarrow \ f(x_{n})={\hat {f}}(x_{n}){\text{ and }}g(x_{n})={\hat {g}}(x_{n}){\text{ for all }}n\in \mathbb {N} {\text{, since }}x_{n}\in I,{\hat {f}}({\tilde {x}})=0={\hat {g}}({\tilde {x}})\right.}\\[0.3em]=\ &{\frac {{\hat {f}}(x_{n})-{\hat {f}}({\tilde {x}})}{{\hat {g}}(x_{n})-{\hat {g}}({\tilde {x}})}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{generalized mean value theorem}}\right.}\\[0.3em]=\ &{\frac {{\hat {f}}'(z_{n})}{{\hat {g}}'(z_{n})}}\\[0.3em]=\ &{\frac {f'(z_{n})}{g'(z_{n})}}\\[0.3em]\end{aligned}}$
Somit folgt
${\begin{aligned}&\lim _{n\to \infty }{\frac {f(x_{n})}{g(x_{n})}}\\[0.3em]=\ &\lim _{n\to \infty }{\frac {f'(z_{n})}{g'(z_{n})}}\\[0.3em]=\ &\lim _{x\to {\tilde {x}}}{\frac {f'(x)}{g'(x)}}\\[0.3em]=\ &q\end{aligned}}$
Since this does even hold for every arbitrary sequence $(x_{n})_{n\in \mathbb {N} }$, there is in total $\lim _{x\to {\tilde {x}}}{\tfrac {f(x)}{g(x)}}=q$.
case 2
Now let us consider the case ${\tilde {x}}\in \lbrace -\infty ,\infty \rbrace$. To do this, we define the auxiliary functions ${\tilde {f}},{\tilde {g}}:J\to \mathbb {R}$ choosing a $c\in I$ with $c>0$ for ${\tilde {x}}=\infty$ or $c<0$ for ${\tilde {x}}=-\infty$. We set $J:={(0,{\tfrac {1}{c}})}$ or $J:={({\tfrac {1}{c}},0)}$. For all $x\in J$ we set ${\tilde {f}}(x):=f({\tfrac {1}{x}})$ and ${\tilde {g}}(x):=g({\tfrac {1}{x}})$.
In the sequencesden we consider only the case ${\tilde {x}}=\infty$, because the proof for ${\tilde {x}}=-\infty$ is analogous. There is:
${\begin{aligned}&\lim _{x\to \infty }{f(x)}=\lim _{x\to \infty }{{\tilde {f}}({\tfrac {1}{x}})}=\lim _{x\to 0}{{\tilde {f}}(x)}\\[0.3em]&\lim _{x\to \infty }{g(x)}=\lim _{x\to \infty }{{\tilde {g}}({\tfrac {1}{x}})}=\lim _{x\to 0}{{\tilde {g}}(x)}\end{aligned}}$
We can therefore apply L'Hospital's rule for the case ${\tilde {x}}=0$, which we have already proved. There is:
${\begin{aligned}&\lim _{x\to \infty }{\frac {f(x)}{g(x)}}\\[0.3em]&{\color {Gray}\left\downarrow \ \lim _{x\to \infty }{f(x)}=\lim _{x\to 0}{{\tilde {f}}(x)}{\text{ and }}\lim _{x\to \infty }{g(x)}=\lim _{x\to 0}{{\tilde {g}}(x)}\right.}\\[0.3em]=\ &\lim _{x\to 0}{\frac {{\tilde {f}}(x)}{{\tilde {g}}(x)}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{L’Hospital's rule}}\right.}\\[0.3em]=\ &\lim _{x\to 0}{\frac {{\tilde {f}}'(x)}{{\tilde {g}}'(x)}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{chain rule in enumerator and denominator, }}{\tilde {f}}(x)=f({\tfrac {1}{x}}),{\tilde {g}}(x)=g({\tfrac {1}{x}}){\text{ for all }}x{\text{ with }}{\tfrac {1}{x}}\in J\right.}\\[0.3em]=\ &\lim _{x\to 0}{\frac {-f'({\tfrac {1}{x}})x^{2}}{-g'({\tfrac {1}{x}})x^{2}}}\\[0.3em]=\ &\lim _{x\to 0}{\frac {f'({\tfrac {1}{x}})}{g'({\tfrac {1}{x}})}}\\[0.3em]=\ &\lim _{x\to \infty }{\frac {f'(x)}{g'(x)}}\\[0.3em]=\ &q\end{aligned}}$
theorem fertig schreiben

## Examples and applications
### Standard types ${\tfrac {0}{0}}$ and ${\tfrac {\pm \infty }{\pm \infty }}$

First, we will deal with the types where the rules can be applied directly.
Example (Limits via L’Hospital 1)
First, some commonly found application: find
$\lim _{x\to 0}{\frac {\sin(x)}{x}}$
There is $\lim _{x\to 0}\sin(x)=\lim _{x\to 0}x=0$. In addition, $f(x)=\sin(x)$ and $g(x)=x$ are differentiable on $(0,\infty )$ , and there is $g'(0)=1\neq 0$. Since further
$\lim _{x\to 0}{\frac {f'(x)}{g'(x)}}=\lim _{x\to 0}{\frac {\cos(x)}{1}}={\frac {\cos(0)}{1}}=1$
exists, there is by the theorem von L’Hospital
$\lim _{x\to 0}{\frac {\sin(x)}{x}}=1$
In general we do not write this down in such detail. We check the requirements in our heads and write down the result as follows:
$\lim _{x\to 0}{\frac {\sin(x)}{x}}\ {\underset {\text{L.H.}}{\overset {\frac {0}{0}}{=}}}\ \lim _{x\to 0}{\frac {\cos(x)}{1}}=1$
Hint
With the rule of L'Hospital the limit value $\lim _{x\to 0}{\tfrac {\sin(x)}{x}}$ can be calculated within "one line". We would like to point out, however, that when applying the rule, we use the derivative
$\sin '(x)=\lim _{h\to 0}{\frac {\sin(x+h)-\sin(x)}{h}}=\ldots =\sin(x)\cdot \underbrace {\lim _{h\to 0}{\frac {\cos(h)-1}{h}}} _{=0}+\cos(x)\cdot \underbrace {\lim _{h\to 0}{\frac {\sin(h)}{h}}} _{=1}=\cos(x)$
It was therefore precisely this limit value that was needed to calculate it. Since we assume that the derivatives of the basic functions are known once they have been calculated, this is not a problem.
Exercise (Limits via L’Hospital)
Determine the following limits:
* $\lim _{x\to 0}{\frac {e^{x}-1}{x}}$
* $\lim _{x\to 0}{\frac {\ln(1+x)}{x}}$
Solution (Limits via L’Hospital)
Part 1:
$\lim _{x\to 0}{\frac {e^{x}-1}{x}}\ {\underset {\text{L.H.}}{\overset {\frac {0}{0}}{=}}}\ \lim _{x\to 0}{\frac {e^{x}}{1}}=e^{0}=1$
Part 2:
$\lim _{x\to 0}{\frac {\ln(1+x)}{x}}\ {\underset {\text{L.H.}}{\overset {\frac {0}{0}}{=}}}\ \lim _{x\to 0}{\frac {\frac {1}{1+x}}{1}}={\frac {1}{1}}=1$
Example (Limits via L’Hospital 2)
Next, we determine
$\lim _{x\to \infty }{\frac {\ln(x)}{x}}$
There is $\lim _{x\to \infty }\ln(x)=\infty =\lim _{x\to \infty }x$. Since also the other conditions for the theorem of L'Hospital are fulfilled, there is
$\lim _{x\to \infty }{\frac {\ln(x)}{x}}\ {\overset {\text{L'H}}{=}}\ \lim _{x\to \infty }{\frac {\frac {1}{x}}{1}}=\lim _{x\to \infty }{\frac {1}{x}}=0$
This limit value can be generalized for $\alpha >0$ to
$\lim _{x\to \infty }{\frac {\ln(x)}{x^{\alpha }}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {\frac {1}{x}}{\alpha x^{\alpha -1}}}=\lim _{x\to \infty }{\frac {1}{\alpha x^{\alpha }}}=0$
Exercise (Limits via L’Hospital 2)
Determine for $\alpha >0$ the limit
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x}}$
Solution (Limits via L’Hospital 2)
There is
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {\alpha e^{\alpha x}}{1}}=\lim _{x\to \infty }\alpha e^{\alpha x}=\infty$
Sometimes it is also necessary to apply the rules of L'Hospital several times in a row before we reach the desired result.
Example (Limits via L’Hospital 3)
Next, we determine
$\lim _{x\to 0}{\frac {1-\cos(x)}{x^{2}}}$
There is $\lim _{x\to 0}1-\cos(x)=0=\lim _{x\to 0}x^{2}$. Using L’Hospital, we obtain
$\lim _{x\to 0}{\frac {1-\cos(x)}{x^{2}}}\ {\overset {\text{L'H}}{=}}\ \lim _{x\to 0}{\frac {\sin(x)}{2x}}$
Now again, $\lim _{x\to 0}\sin(x)=0=\lim _{x\to 0}2x$. Using L’Hospital again, we finally obtain
$\lim _{x\to 0}{\frac {\sin(x)}{2x}}\ {\overset {\text{L'H}}{=}}\ \lim _{x\to 0}{\frac {\cos(x)}{2}}={\frac {1}{2}}$
So all in all, there is
$\lim _{x\to 0}{\frac {1-\cos(x)}{x^{2}}}={\frac {1}{2}}$
Exercise (Limits via L’Hospital 3)
Determine the limits
* $\lim _{x\to \infty }{\frac {e^{x}-x-1}{x^{2}}}$
* $\lim _{x\to 0}{\frac {x^{3}}{\sin(x)-x}}$
Solution (Limits via L’Hospital 3)
Part 1:
$\lim _{x\to \infty }{\frac {e^{x}-1-x}{x^{2}}}\ {\underset {\text{L.H.}}{\overset {\frac {\infty }{\infty }}{=}}}\ \lim _{x\to \infty }{\frac {e^{x}-1}{2x}}\ {\underset {\text{L.H.}}{\overset {\frac {\infty }{\infty }}{=}}}\ \lim _{x\to \infty }{\frac {e^{x}}{2}}=\infty$
Part 2:
$\lim _{x\to 0}{\frac {x^{3}}{\sin(x)-x}}\ {\underset {\text{L.H.}}{\overset {\frac {0}{0}}{=}}}\ \lim _{x\to 0}{\frac {3x^{2}}{\cos(x)-1}}\ {\underset {\text{L.H.}}{\overset {\frac {0}{0}}{=}}}\ \lim _{x\to 0}{\frac {6x}{-\sin(x)}}\ {\underset {\text{L.H.}}{\overset {\frac {0}{0}}{=}}}\ \lim _{x\to 0}{\frac {6}{-\cos(x)}}={\frac {6}{-1}}=-6$

### Type $0\cdot (\pm \infty )$

Here, the rules of L'Hospital are not directly applicable. The "trick" is therefore to create a fraction by forming reciprocal values, and thus to obtain a limit value in the standard form ${\tfrac {0}{0}}$ or ${\tfrac {\pm \infty }{\pm \infty }}$.
Example (Limits via L’Hospital 4)
A standard example is the limit
$\lim _{x\to 0+}x\ln(x)$
There is $\lim _{x\to 0+}x=0$ and $\lim _{x\to 0+}\ln(x)=-\infty$. We take the reciprocal value
$\lim _{x\to 0+}x\ln(x)=\lim _{x\to 0+}{\frac {\ln(x)}{\frac {1}{x}}}$
Since there is $\lim _{x\to 0+}{\tfrac {1}{x}}=\infty$, we can indeed apply L’Hospital and obtain
$\lim _{x\to 0+}{\frac {\ln(x)}{\frac {1}{x}}}\ {\overset {\text{L'H}}{=}}\ \lim _{x\to 0+}{\frac {\frac {1}{x}}{-{\frac {1}{x^{2}}}}}=\lim _{x\to 0+}-x=0$
Warning
The following term shift
$\lim _{x\to 0+}x\ln(x)=\lim _{x\to 0+}{\frac {x}{\frac {1}{\ln(x)}}}$
renders an expression ${\tfrac {0}{0}}$. However, by applying the rule of L'Hospital,
$\lim _{x\to 0+}{\frac {x}{\frac {1}{\ln(x)}}}{\overset {\text{L'H}}{=}}\lim _{x\to 0+}{\frac {1}{-{\frac {1}{\ln(x)^{2}}}\cdot {\frac {1}{x}}}}=\lim _{x\to 0+}-x\ln(x)^{2}$
This expression is now again of the type $0\cdot \infty$, but has a more complicated form than the original one. So the trick does not always lead to success!
Hint
For two arbitrary functions $f$ and $g$ with respective properties, the re-formulation trick reads:
$\lim _{x\to x_{0}}f(x)\cdot g(x)=\lim _{x\to x_{0}}{\frac {f(x)}{\frac {1}{g(x)}}}$
or
$\lim _{x\to x_{0}}f(x)\cdot g(x)=\lim _{x\to x_{0}}{\frac {g(x)}{\frac {1}{f(x)}}}$
Depending on which of the two forms is used, the limit value can then be calculated more easily.
Exercise (Limits via L’Hospital 4)
Compute
* $\lim _{x\to 0+}x^{2}\ln(x)$
* $\lim _{x\to 0+}x(\ln(x))^{2}$
* $\lim _{x\to -\infty }xe^{x}$
Solution (Limits via L’Hospital 4)
Part 1:
$\lim _{x\to 0+}x^{2}\ln(x)=\lim _{x\to 0+}{\frac {\ln(x)}{\frac {1}{x^{2}}}}\ {\underset {\text{L'H.}}{\overset {\frac {-\infty }{\infty }}{=}}}\ \lim _{x\to 0+}{\frac {\frac {1}{x}}{-{\frac {2}{x^{3}}}}}=\lim _{x\to 0+}-{\frac {1}{2}}x^{2}=0$
Part 2:
$\lim _{x\to 0+}x(\ln(x))^{2}=\lim _{x\to 0+}{\frac {(\ln(x))^{2}}{\frac {1}{x}}}\ {\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\ \lim _{x\to 0+}{\frac {2\ln(x)\cdot {\frac {1}{x}}}{-{\frac {1}{x^{2}}}}}=\lim _{x\to 0+}{\frac {2\ln(x)}{-{\frac {1}{x}}}}\ {\underset {\text{L'H.}}{\overset {\frac {-\infty }{-\infty }}{=}}}\ \lim _{x\to 0+}{\frac {\frac {2}{x}}{\frac {1}{x^{2}}}}=\lim _{x\to 0+}2x=0$
Part 3:
$\lim _{x\to -\infty }xe^{x}=\lim _{x\to -\infty }{\frac {x}{\frac {1}{e^{x}}}}=\lim _{x\to -\infty }{\frac {x}{e^{-x}}}\ {\underset {\text{L'H.}}{\overset {\frac {-\infty }{\infty }}{=}}}\ \lim _{x\to -\infty }{\frac {1}{-e^{-x}}}=\lim _{x\to -\infty }-e^{x}=0$

### Type $\infty -\infty$

Next, we will deal with differences of limit values, both of which converge improperly towards $\infty$. These are often differences of fractional terms. By forming the principal denominator and grouping them into a fractional term, the expression can often be transformed such that the rules of L'Hospital are applicable.
Example (Limits via L’Hospital 5)
Consider the limit
$\lim _{x\to 0+}{\frac {1}{\sin(x)}}-{\frac {1}{x}}$
Here we have $\lim _{x\to 0+}{\tfrac {1}{\sin(x)}}=\lim _{x\to 0}{\tfrac {1}{x}}=\infty$. So the limit value is of the described type $\infty -\infty$. By forming the principal denominator we obtain
$\lim _{x\to 0+}{\frac {1}{\sin(x)}}-{\frac {1}{x}}=\lim _{x\to 0+}{\frac {x-\sin(x)}{x\sin(x)}}$
Since $\lim _{x\to 0+}x\sin(x)=0=\lim _{x\to 0+}x-\sin(x)$ we are able to apply L’Hospital and obtain
$\lim _{x\to 0+}{\frac {x-\sin(x)}{x\sin(x)}}\ {\overset {\text{L'H.}}{=}}\ \lim _{x\to 0+}{\frac {1-\cos(x)}{\sin(x)+x\cos(x)}}\ {\overset {\frac {0}{0}}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to 0+}{\frac {\sin(x)}{\cos(x)+\cos(x)-x\sin(x)}}={\frac {0}{1+1-0}}=0$
Hint
For two arbitrary functions $f$ and $g$ , the re-formulation trick reads:
$\lim _{x\to x_{0}}{\frac {1}{f(x)}}-{\frac {1}{g(x)}}=\lim _{x\to x_{0}}{\frac {g(x)-f(x)}{f(x)g(x)}}$
Exercise (Limits via L’Hospital 5)
Determine
* $\lim _{x\to 0+}{\frac {1}{x}}-{\frac {1}{e^{x}-1}}$
* $\lim _{x\to 1}{\frac {1}{x-1}}-{\frac {1}{\ln(x)}}$
Solution (Limits via L’Hospital 5)
Part 1: There is
$\lim _{x\to 0+}{\frac {1}{x}}-{\frac {1}{e^{x}-1}}=\lim _{x\to 0+}{\frac {e^{x}-1-x}{x(e^{x}-1)}}\ {\overset {\frac {0}{0}}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to 0+}{\frac {e^{x}-1}{e^{x}-1+xe^{x}}}\ {\overset {\frac {0}{0}}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to 0+}{\frac {e^{x}}{e^{x}+e^{x}+xe^{x}}}={\frac {1}{1+1+0}}={\frac {1}{2}}$
Part 2: Here, we have
$\lim _{x\to 1}{\frac {1}{x-1}}-{\frac {1}{\ln(x)}}=\lim _{x\to 1}{\frac {\ln(x)-x+1}{(x-1)\ln(x)}}\ {\overset {\frac {0}{0}}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to 1}{\frac {{\frac {1}{x}}-1}{\ln(x)+(x-1){\frac {1}{x}}}}=\lim _{x\to 1}{\frac {\frac {1-x}{x}}{\frac {x\ln(x)+x-1}{x}}}=\lim _{x\to 1}{\frac {1-x}{x\ln(x)+x-1}}\ {\overset {\frac {0}{0}}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to 1}{\frac {-1}{\ln(x)+1+1}}={\frac {-1}{0+1+1}}=-{\frac {1}{2}}$

### Types $0^{0}$, $0^{\infty }$, $\infty ^{0}$ and $1^{\infty }$

If one of the cases described occurs, we use the trick we have already used in the calculation of derivative of generalized power functions: We first write $f^{g}$ as $\exp \circ (g\cdot \ln \circ f)$. Since $\exp$ is continuous on all of $\mathbb {R}$, the limit can be "pulled inside". The limit formed there is now very often of the kind $0\cdot \pm \infty$ and can be calculated as described above with the rules of L'Hopital.
Example (Limits via L’Hospital 6)
A common example is the limit
$\lim _{x\to 0+}x^{x}$
This is a limit of type $0^{0}$. As described above we re-formulate it into
$\lim _{x\to 0+}x^{x}=\lim _{x\to 0+}\exp(x\ln(x))$
If we pull the limit into the exponential function, we get the limit value
$\lim _{x\to 0+}x\ln(x)$
This is of type $0\cdot (-\infty )$. Above we calculated it as follows
$\lim _{x\to 0+}x\ln(x)=\lim _{x\to 0+}{\frac {\ln(x)}{\frac {1}{x}}}\ {\overset {\frac {-\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to 0+}{\frac {\frac {1}{x}}{-{\frac {1}{x^{2}}}}}=\lim _{x\to 0+}-x=0$
Because of continuity of $\exp$ we hence get
$\lim _{x\to 0+}x^{x}=\lim _{x\to 0+}\exp(x\ln(x))=\exp(\lim _{x\to 0+}x\ln(x))=\exp(0)=1$
Hint
The limit $\lim _{x\to 0+}x^{x}$ is the main reason for setting $0^{0}=1$ . It makes the function $f:\mathbb {R} _{0}^{+}\to \mathbb {R} ,\ f(x)={\begin{cases}x^{x}&{\text{ for }}x\neq 0,\\1&{\text{ for }}x=0\end{cases}}$ continuous at zero.
Hint
For two arbitrary functions $f$ and $g$ , the re-formulation trick reads:
$\lim _{x\to x_{0}}f(x)^{g(x)}=\lim _{x\to x_{0}}\exp[\ln(f(x))g(x)]$
Exercise (Limits via L’Hospital 6)
Compute the following limits
* $\lim _{x\to \infty }x^{\frac {1}{x}}$
* $\lim _{x\to 0+}x^{\sin(x)}$
Solution (Limits via L’Hospital 6)
Part 1:
$\lim _{x\to \infty }x^{\frac {1}{x}}=\lim _{x\to \infty }\exp \left({\frac {\ln(x)}{x}}\right)\ {\underset {\text{continuous}}{\overset {\exp }{=}}}\ \exp \left(\lim _{x\to \infty }{\frac {\ln(x)}{x}}\right)\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \exp \left(\lim _{x\to \infty }{\frac {\frac {1}{x}}{1}}\right)=\exp \left(\lim _{x\to \infty }{\frac {1}{x}}\right)=\exp(0)=1$
Part 2:
${\begin{aligned}\lim _{x\to 0+}x^{\sin(x)}&=\lim _{x\to 0+}\exp \left(\sin(x)\ln(x)\right)\ {\underset {\text{continuous}}{\overset {\exp }{=}}}\ \exp \left(\lim _{x\to 0+}\sin(x)\ln(x)\right)=\exp \left(\lim _{x\to 0+}{\frac {\ln(x)}{\frac {1}{\sin(x)}}}\right)\ {\overset {\frac {-\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \exp \left(\lim _{x\to 0+}{\frac {\frac {1}{x}}{-{\frac {1}{\sin ^{2}(x)}}\cdot \cos(x)}}\right)\\&=\exp \left(\lim _{x\to 0+}-{\frac {\sin ^{2}(x)}{x\cos(x)}}\right)\ {\overset {\frac {0}{0}}{\underset {\text{L'H}}{=}}}\ \exp \left(\lim _{x\to 0+}-{\frac {2\sin(x)\cos(x)}{\cos(x)-x\sin(x)}}\right)=\exp \left({\frac {0}{1-0}}\right)=\exp(0)=1\end{aligned}}$

## Some warnings

However, it is not always useful to apply the rule of L'Hospital. In particular, it should not be applied if the conditions are not met. In this case, the hasty application of the rule may give a false result. We will discuss some warning examples to illustrate this.

### L’Hospital proofs can get tedious - there are also other ways
#### Growth of exponential and logarithm functions

Let us consider the limit value
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x^{k}}}$
$\alpha >0$
$k\in \mathbb {N}$
This is of the type ${\tfrac {\infty }{\infty }}$ and L'Hospital is therefore applicable, which results in
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x^{k}}}{\overset {\text{L'H.}}{=}}\lim _{x\to \infty }{\frac {\alpha e^{\alpha x}}{kx^{k-1}}}$
The limit is now again of type ${\tfrac {\infty }{\infty }}$. Repeating the rule, we obtain
$\lim _{x\to \infty }{\frac {\alpha e^{\alpha x}}{kx^{k-1}}}{\overset {\text{L'H.}}{=}}\lim _{x\to \infty }{\frac {\alpha ^{2}e^{\alpha x}}{k(k-1)x^{k-2}}}$
When applying the rule of L'Hospital, we see the following pattern: the enumerator remains the same except for the pre-factor, but this does not change the divergence behaviour towards $\infty$. In the denominator the power of $x$ decreases by one in every step. If we apply the rule of L'Hospital $k$ times, we hence get
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x^{k}}}{\overset {\text{L'H.}}{=}}\lim _{x\to \infty }{\frac {\alpha e^{\alpha x}}{kx^{k-1}}}{\overset {\text{L'H.}}{=}}\lim _{x\to \infty }{\frac {\alpha ^{2}e^{\alpha x}}{k(k-1)x^{k-2}}}{\overset {\text{L'H.}}{=}}\ldots =\lim _{x\to \infty }{\frac {\alpha ^{k}e^{\alpha x}}{k!x^{0}}}=\lim _{x\to \infty }\underbrace {\frac {\alpha ^{k}}{k!}} _{\text{constant}}\underbrace {e^{\alpha x}} _{\to \infty }=\infty$
But we could have achieved this result much faster and more elegantly. We have already shown above by only one application of L'Hospital
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {\alpha e^{\alpha x}}{1}}=\lim _{x\to \infty }\alpha e^{\alpha x}=\infty$
for all $\alpha >0$. So we get
$\lim _{x\to \infty }{\frac {e^{\alpha x}}{x^{k}}}=\lim _{x\to \infty }\left({\frac {e^{{\frac {\alpha }{k}}x}}{x}}\right)^{k}=\infty$
since ${\tilde {\alpha }}={\tfrac {\alpha }{k}}>0$.
Hint
The limit value states that every exponential function grows faster than every power function, no matter how large the power is.
Exercise (Limits via L’Hospital 7)
Determine for $\alpha >0$ and $k\in \mathbb {N}$ the limit
$\lim _{x\to \infty }{\frac {(\ln(x))^{k}}{x^{\alpha }}}$
by
* $k$-fold application of the rule of L'Hospital.
* One-fold application of the rule of L'Hospital and smart re-formulation.
Solution (Limits via L’Hospital 7)
Part 1: The limit value is of type ${\tfrac {\infty }{\infty }}$ and L'Hospital is applicable. There is
$\lim _{x\to \infty }{\frac {(\ln(x))^{k}}{x^{\alpha }}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {k(\ln(x))^{k-1}\cdot {\frac {1}{x}}}{\alpha x^{\alpha -1}}}=\lim _{x\to \infty }{\frac {k(\ln(x))^{k-1}}{\alpha x^{\alpha }}}$
The limit value is again of the type ${\tfrac {\infty }{\infty }}$, the power in the numerator decreases by one, that in the denominator remains the same. After $k$-fold application of L'Hospital we obtain
$\lim _{x\to \infty }{\frac {(\ln(x))^{k}}{x^{\alpha }}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\lim _{x\to \infty }{\frac {k(\ln(x))^{k-1}}{\alpha x^{\alpha }}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\lim _{x\to \infty }{\frac {k(k-1)(\ln(x))^{k-2}}{\alpha ^{2}x^{\alpha }}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ldots =\lim _{x\to \infty }{\frac {k!(\ln(x))^{0}}{\alpha ^{k}x^{\alpha }}}=\lim _{x\to \infty }\underbrace {\frac {k!}{\alpha ^{k}}} _{\text{constant}}\underbrace {\frac {1}{x^{\alpha }}} _{\to 0}=0$
Part 2: There is
$\lim _{x\to \infty }{\frac {\ln(x)}{x^{\alpha }}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {\frac {1}{x}}{\alpha *x^{\alpha -1}}}=\lim _{x\to \infty }{\frac {1}{\alpha *x^{\alpha }}}=0$
for all $k\in \mathbb {N}$. Hence
$\lim _{x\to \infty }{\frac {(\ln(x))^{k}}{x^{\alpha }}}=\lim _{x\to \infty }\left({\frac {\ln(x)}{x^{\frac {\alpha }{k}}}}\right)^{k}=0^{k}=0$
As ${\tilde {\alpha }}={\tfrac {\alpha }{k}}>0$.
Hint
The limit value says that the logarithmic function grows slower than any power function, no matter how small the power is.

#### Growth of polynomial functions

Let us now consider the following limit value of a rational function for $x\to \infty$:
$\lim _{x\to \infty }{\frac {x^{3}-4x+1}{x^{3}-3x^{2}+2x-4}}$
Here we have, because of $\lim _{x\to \infty }x^{3}-4x+1=\infty =\lim _{x\to \infty }x^{3}-3x^{2}+2x-4$ the type ${\tfrac {\infty }{\infty }}$, and by applying the rule of L'Hospital three times we obtain
$\lim _{x\to \infty }{\frac {x^{3}-4x+1}{x^{3}-3x^{2}+2x-4}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {3x^{2}-4}{3x^{2}-6x+2}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {6x}{6x-6}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H}}{=}}}\ \lim _{x\to \infty }{\frac {6}{6}}=1$
Alternatively, the limit value can be calculated without L'Hospital by excluding and then shortening the highest power ($x^{3}$):
$\lim _{x\to \infty }{\frac {x^{3}-4x+1}{x^{3}-3x^{2}+2x-4}}=\lim _{x\to \infty }{\frac {x^{3}(1-{\frac {4}{x^{2}}}+{\frac {1}{x^{3}}})}{x^{3}(1-{\frac {3}{x}}+{\frac {2}{x^{2}}}-{\frac {4}{x^{3}}})}}=\lim _{x\to \infty }{\frac {1-{\frac {4}{x^{2}}}+{\frac {1}{x^{3}}}}{1-{\frac {3}{x}}+{\frac {2}{x^{2}}}-{\frac {4}{x^{3}}}}}={\frac {1-0+0}{1-0+0-0}}=1$
If now in general $p(x)=x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}$ and $q(x)=x^{n}+b_{n-1}x^{n-1}+\ldots +b_{1}x^{1}+b_{0}$ are normalized polynomials, then there is again
$\lim _{x\to \infty }{\frac {p(x)}{q(x)}}=1$
If we want to show this with the rule of L'Hospital, we have to apply it a total of $n$ times, and get
${\begin{aligned}\lim _{x\to \infty }{\frac {p(x)}{q(x)}}&=\lim _{x\to \infty }{\frac {x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{x^{n}+b_{n-1}x^{n-1}+\ldots +b_{1}x^{1}+b_{0}}}\\[0.3em]&{\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\lim _{x\to \infty }{\frac {nx^{n-1}+a_{n-1}(n-1)x^{n-2}+\ldots +a_{1}}{nx^{n-1}+b_{n-1}(n-1)x^{n-2}+\ldots +b_{1}}}\\[0.3em]&{\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\lim _{x\to \infty }{\frac {n(n-1)x^{n-2}+a_{n-1}(n-1)(n-2)x^{n-3}+\ldots +a_{2}}{n(n-1)x^{n-2}+b_{n-1}(n-1)(n-2)x^{n-3}+\ldots +b_{2}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{L’Hospital }}(n-2){\text{-fold}}\right.}\\[0.3em]&{\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\lim _{x\to \infty }{\frac {n(n-1)\cdot \ldots \cdot 2\cdot 1\cdot x^{0}}{n(n-1)\cdot \ldots \cdot 2\cdot 1\cdot x^{0}}}\\[0.3em]&=\lim _{x\to \infty }{\frac {n!}{n!}}\\[0.3em]&=\lim _{x\to \infty }1\\[0.3em]&=1\end{aligned}}$
To calculate the limit without L'Hospital, we can again factor out the highest power, i.e. $x^{n}$, and then calculate the limit value:
${\begin{aligned}\lim _{x\to \infty }{\frac {p(x)}{q(x)}}&=\lim _{x\to \infty }{\frac {x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{x^{n}+b_{n-1}x^{n-1}+\ldots +b_{1}x^{1}+b_{0}}}\\[0.3em]&=\lim _{x\to \infty }{\frac {x^{n}\cdot \left(1+{\frac {a_{n-1}}{x}}+\ldots +{\frac {a_{1}}{x^{n-1}}}+{\frac {a_{0}}{x^{n}}}\right)}{x^{n}\cdot \left(1+{\frac {b_{n-1}}{x}}+\ldots +{\frac {b_{1}}{x^{n-1}}}+{\frac {b_{0}}{x^{n}}}\right)}}\\[0.3em]&=\lim _{x\to \infty }{\frac {1+\overbrace {\frac {a_{n-1}}{x}} ^{\to 0}+\ldots +\overbrace {\frac {a_{1}}{x^{n-1}}} ^{\to 0}+\overbrace {\frac {a_{0}}{x^{n}}} ^{\to 0}}{1+\underbrace {\frac {b_{n-1}}{x}} _{\to 0}+\ldots +\underbrace {\frac {b_{1}}{x^{n-1}}} _{\to 0}+\underbrace {\frac {b_{0}}{x^{n}}} _{\to 0}}}\\[0.3em]&={\frac {1+0+\ldots +0+0}{1+0+\ldots +0+0}}\\[0.3em]&=1\end{aligned}}$
Exercise (Limits of rational functions)
Show for $a_{n},b_{m}>0$ that
$\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\ldots +b_{1}x^{1}+b_{0}}}={\begin{cases}\infty &{\text{ if }}n>m,\\{\frac {a_{n}}{b_{n}}}&{\text{ if }}n=m,\\0&{\text{ if }}n<m\end{cases}}$
Solution (Limits of rational functions)
Fall 1: $n>m$
1st way: without L’Hospital
We factor out the greatest power $x^{n}$, and obtain
${\begin{aligned}\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\ldots +b_{1}x^{1}+b_{0}}}&=\lim _{x\to \infty }{\frac {x^{n}\cdot \left(a_{n}+a_{n-1}x^{-1}+\ldots +a_{1}x^{1-n}+a_{0}x^{-n}\right)}{x^{n}\cdot \left(b_{m}x^{m-n}+b_{m-1}x^{m-n+1}+\ldots +b_{1}x^{1-n}+b_{0}x^{-n}\right)}}\\[0.3em]&=\lim _{x\to \infty }{\frac {x^{n}\cdot \left(a_{n}+{\frac {a_{n-1}}{x}}+\ldots +{\frac {a_{1}}{x^{n-1}}}+{\frac {a_{0}}{x^{n}}}\right)}{x^{n}\cdot \left({\frac {b_{m}}{x^{n-m}}}+{\frac {b_{m-1}}{x^{n-m-1}}}+\ldots +{\frac {b_{1}}{x^{n-1}}}+{\frac {b_{0}}{x^{n}}}\right)}}\\[0.3em]&=\lim _{x\to \infty }{\frac {a_{n}+\overbrace {\frac {a_{n-1}}{x}} ^{\to 0}+\ldots +\overbrace {\frac {a_{1}}{x^{n-1}}} ^{\to 0}+\overbrace {\frac {a_{0}}{x^{n}}} ^{\to 0}}{\underbrace {\frac {b_{m}}{x^{n-m}}} _{\to 0}+\underbrace {\frac {b_{m-1}}{x^{n-m-1}}} _{\to 0}+\ldots +\underbrace {\frac {b_{1}}{x^{n-1}}} _{\to 0}+\underbrace {\frac {b_{0}}{x^{n}}} _{\to 0}}}\\[0.3em]&={\frac {a_{n}+0+\ldots +0+0}{0+0+\ldots +0+0}}\\[0.3em]&{\overset {\frac {a_{n}}{0+}}{=}}+\infty \end{aligned}}$
2nd way: with L’Hospital
We apply the rule of L'Hospital $m$ times, and get
${\begin{aligned}\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\ldots +b_{1}x^{1}+b_{0}}}&{\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\lim _{x\to \infty }{\frac {a_{n}nx^{n-1}+a_{n-1}(n-1)x^{n-2}+\ldots +a_{1}}{b_{m}mx^{m-1}+b_{m-1}(m-1)x^{m-2}+\ldots +b_{1}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{L’Hospital }}(m-1){\text{-fold}}\right.}\\[0.3em]&=\lim _{x\to \infty }{\frac {n(n-1)\cdot \ldots \cdot (n-m)x^{n-m}}{m!x^{0}}}\\[0.3em]&{\overset {\frac {+\infty }{n!}}{=}}+\infty \end{aligned}}$
Fall 2: $n=m$
1st way: without L’Hospital
${\begin{aligned}\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{n}x^{n}+b_{n-1}x^{n-1}+\ldots +b_{1}x^{1}+b_{0}}}&=\lim _{x\to \infty }{\frac {x^{n}\cdot \left(a_{n}+{\frac {a_{n-1}}{x}}+\ldots +{\frac {a_{1}}{x^{n-1}}}+{\frac {a_{0}}{x^{n}}}\right)}{x^{n}\cdot \left(b_{n}+{\frac {b_{n-1}}{x}}+\ldots +{\frac {b_{1}}{x^{n-1}}}+{\frac {b_{0}}{x^{n}}}\right)}}\\[0.3em]&=\lim _{x\to \infty }{\frac {a_{n}+{\frac {a_{n-1}}{x}}+\ldots +{\frac {a_{1}}{x^{n-1}}}+{\frac {a_{0}}{x^{n}}}}{b_{n}+{\frac {b_{n-1}}{x}}+\ldots +{\frac {b_{1}}{x^{n-1}}}+{\frac {b_{0}}{x^{n}}}}}\\[0.3em]&={\frac {a_{n}+0+\ldots +0+0}{b_{n}+0+\ldots +0+0}}\\[0.3em]&={\frac {a_{n}}{b_{n}}}\end{aligned}}$
2nd way: with L’Hospital
${\begin{aligned}\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{n}x^{n}+b_{n-1}x^{n-1}+\ldots +b_{1}x^{1}+b_{0}}}&{\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\lim _{x\to \infty }{\frac {a_{n}nx^{n-1}+a_{n-1}(n-1)x^{n-2}+\ldots +a_{1}}{b_{n}nx^{n-1}+b_{n-1}(n-1)x^{n-2}+\ldots +b_{1}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{L’Hospital }}(n-1){\text{-fold}}\right.}\\[0.3em]&=\lim _{x\to \infty }{\frac {n!a_{n}x^{0}}{n!b_{n}x^{0}}}\\[0.3cm]&={\frac {a_{n}}{b_{n}}}\end{aligned}}$
Fall 3: $n<m$
1st way: without L’Hospital
We factor out the greatest power $x^{m}$, and obtain
${\begin{aligned}\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\ldots +b_{1}x^{1}+b_{0}}}&=\lim _{x\to \infty }{\frac {x^{m}\cdot \left({\frac {a_{n}}{x^{m-n}}}+{\frac {a_{n-1}}{x^{m-n-1}}}+\ldots +{\frac {a_{1}}{x^{m-1}}}+{\frac {a_{0}}{x^{m}}}\right)}{x^{m}\cdot \left(b_{m}+{\frac {b_{m-1}}{x}}+\ldots +{\frac {b_{1}}{x^{m-1}}}+{\frac {b_{0}}{x^{m}}}\right)}}\\[0.3em]&=\lim _{x\to \infty }{\frac {{\frac {a_{n}}{x^{m-n}}}+{\frac {a_{n-1}}{x^{m-n-1}}}+\ldots +{\frac {a_{1}}{x^{m-1}}}+{\frac {a_{0}}{x^{m}}}}{b_{m}+{\frac {b_{m-1}}{x}}+\ldots +{\frac {b_{1}}{x^{m-1}}}+{\frac {b_{0}}{x^{m}}}}}\\[0.3em]&={\frac {0+0+\ldots +0+0}{b_{m}+0+\ldots +0+0}}\\[0.3em]&=0\end{aligned}}$
2nd way: with L’Hospital
We apply the rule of L'Hospital $n$ times, and get
${\begin{aligned}\lim _{x\to \infty }{\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\ldots +a_{1}x^{1}+a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\ldots +b_{1}x^{1}+b_{0}}}&{\underset {\text{L'H.}}{\overset {\frac {\infty }{\infty }}{=}}}\lim _{x\to \infty }{\frac {a_{n}nx^{n-1}+a_{n-1}(n-1)x^{n-2}+\ldots +a_{1}}{b_{m}mx^{m-1}+b_{m-1}(m-1)x^{m-2}+\ldots +b_{1}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{L’Hospital }}(n-1){\text{-fold}}\right.}\\[0.3em]&=\lim _{x\to \infty }{\frac {n!x^{0}}{m(m-1)\cdot \ldots \cdot (m-n)x^{m-n}}}\\[0.3em]&{\overset {\frac {n!}{\infty }}{=}}0\end{aligned}}$

### L’Hospital proof might fail

In this section we will present some examples of limit values where the rule of L'Hospital "fails". This can happen because the rule of L'Hospital is a sufficient but not a necessary condition for the existence of the limit value $\lim _{x\to a}{\tfrac {f(x)}{g(x)}}$.

#### infinite loops

Sometimes the rule of L'Hospital can go in an "infinite loop". An example is
$\lim _{x\to \infty }{\frac {e^{x}+e^{-x}}{e^{x}-e^{-x}}}$
This limit is of the type ${\tfrac {\infty }{\infty }}$, and L'Hospital is applicable. If we do so, we will obtain
$\lim _{x\to \infty }{\frac {e^{x}+e^{-x}}{e^{x}-e^{-x}}}\ {\overset {\text{L'H.}}{=}}\ \lim _{x\to \infty }{\frac {e^{x}-e^{-x}}{e^{x}+e^{-x}}}$
The resulting limit value is now again of the type ${\tfrac {\infty }{\infty }}$. If we look more closely, we see that the enumerator and denominator have been changed by the use of L'Hospital. If we now apply the rule again, the result is
$\lim _{x\to \infty }{\frac {e^{x}-e^{-x}}{e^{x}+e^{-x}}}\ {\overset {\text{L'H.}}{=}}\ \lim _{x\to \infty }{\frac {e^{x}+e^{-x}}{e^{x}-e^{-x}}}$
The original limit value is therefore not changed. The rule of L'Hospital therefore does not help us with this limit value! The reason is that exponentials do not change under differentiation. However, there is a relatively simple way to reach the destination without L'Hospital:
If we factor out $e^{x}$ from the numerator and denominator, and then shorten it, we get
$\lim _{x\to \infty }{\frac {e^{x}+e^{-x}}{e^{x}-e^{-x}}}=\lim _{x\to \infty }{\frac {e^{x}(1-e^{-2x})}{e^{x}(1+e^{-2x})}}=\lim _{x\to \infty }{\frac {1-e^{-2x}}{1+e^{-2x}}}={\frac {1-\lim _{x\to \infty }e^{-2x}}{1+\lim _{x\to \infty }e^{-2x}}}={\frac {1+0}{1-0}}=1$
Exercise (Limits without L’Hospital 1)
Determine the limit
$\lim _{x\to \infty }{\frac {x}{\sqrt {x^{2}+1}}}$
What is the problem in applying the rule of L'Hospital?
Solution (Limits without L’Hospital 1)
By factoring out $x^{2}$ in the denominator we obtain
$\lim _{x\to \infty }{\frac {x}{\sqrt {x^{2}+1}}}=\lim _{x\to \infty }{\frac {x}{\sqrt {x^{2}\cdot \left(1+{\frac {1}{x^{2}}}\right)}}}=\lim _{x\to \infty }{\frac {x}{{\sqrt {x^{2}}}\cdot {\sqrt {1+{\frac {1}{x^{2}}}}}}}=\lim _{x\to \infty }{\frac {x}{x\cdot {\sqrt {1+{\frac {1}{x^{2}}}}}}}=\lim _{x\to \infty }{\frac {1}{\underbrace {\sqrt {1+{\frac {1}{x^{2}}}}} _{\to {\sqrt {1+0}}}}}={\frac {1}{\sqrt {1}}}=1$
The application of the rule of L'Hospital leads into an endless loop, because
$\lim _{x\to \infty }{\frac {x}{\sqrt {x^{2}+1}}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to \infty }{\frac {1}{\frac {2x}{2{\sqrt {x^{2}+1}}}}}=\lim _{x\to \infty }{\frac {\sqrt {x^{2}+1}}{x}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H.}}{=}}}\ \lim _{x\to \infty }{\frac {\frac {2x}{2{\sqrt {x^{2}+1}}}}{1}}=\lim _{x\to \infty }{\frac {x}{\sqrt {x^{2}+1}}}\ {\overset {\frac {\infty }{\infty }}{\underset {\text{L'H.}}{=}}}\ \ldots$

#### L’Hospital makes divergence worse

It may also happen that the use of L'Hospital actually "makes the situation worse". In other words, a limit value that exists can be transformed by applying the rule into a limit value that no longer exists. Therefore always note: From $\lim _{x\to a}{\tfrac {f'(x)}{g'(x)}}=c$ we get $\lim _{x\to a}{\tfrac {f(x)}{g(x)}}=c$, but not vice versa. In particular, the fact that $\lim _{x\to a}{\tfrac {f'(x)}{g'(x)}}$ does not exist, does not imply that $\lim _{x\to a}{\tfrac {f(x)}{g(x)}}$ does not exist. Let us look at
$\lim _{x\to \infty }{\frac {2x+\sin(x)}{2x-\sin(x)}}$
There is $2x\pm \sin(x)\geq 2x-1\to \infty$. Therefore we have a type ${\tfrac {\infty }{\infty }}$ . Application of L'Hospital now renders
$\lim _{x\to \infty }{\frac {2x+\sin(x)}{2x-\sin(x)}}\ {\overset {\text{L'H.}}{=}}\ \lim _{x\to \infty }{\frac {2+\cos(x)}{2-\cos(x)}}$
Now we have a problem because this limit value does not exist. Let us look at the sequences $(x_{n})_{n\in \mathbb {N} }$ with
$x_{n}=n\pi$
This certainly diverges to $\infty$. However, there is
$\lim _{n\to \infty }{\frac {2+\cos(x_{n})}{2-\cos(x_{n})}}=\lim _{n\to \infty }{\frac {n\pi +(-1)^{n+1}}{n\pi -(-1)^{n+1}}}$
This limit value does not exist (not even improperly), since $(-1)^{n+1}$ diverges. This means that L'Hospital is inapplicable here too. That the original limit value does exist can be seen from the following conversion trick: Because of $\lim _{x\to \infty }{\tfrac {\sin(x)}{x}}=0$ there is
$\lim _{x\to \infty }{\frac {2x+\sin(x)}{2x-\sin(x)}}=\lim _{x\to \infty }{\frac {x(2+{\frac {\sin(x)}{x}})}{x(2-{\frac {\sin(x)}{x}})}}=\lim _{x\to \infty }{\frac {2+{\frac {\sin(x)}{x}}}{2-{\frac {\sin(x)}{x}}}}={\frac {2+0}{2-0}}=1$
Exercise (Limits without L’Hospital 2)
Determine
$\lim _{x\to 0}{\frac {x^{2}\sin({\tfrac {1}{x}})}{x+\sin(x)}}$
What is the problem in applying the rule of L'Hospital?
Solution (Limits without L’Hospital 2)
First there is with a simple re-formulation trick
$\lim _{x\to 0}{\frac {x^{2}\sin({\tfrac {1}{x}})}{x+\sin(x)}}=\lim _{x\to 0}{\frac {x\cdot x\cdot \sin({\tfrac {1}{x}})}{x+\sin(x)}}=\lim _{x\to 0}{\frac {x\cdot \sin({\tfrac {1}{x}})}{{\tfrac {1}{x}}\cdot (x+\sin(x))}}=\lim _{x\to 0}{\frac {x\cdot \sin({\tfrac {1}{x}})}{{\tfrac {1}{x}}\cdot (x+\sin(x))}}=\lim _{x\to 0}{\frac {x\cdot \sin({\tfrac {1}{x}})}{1+{\tfrac {\sin(x)}{x}}}}$
Further, on the one hand $\lim _{x\to 0}x\cdot \sin({\tfrac {1}{x}})=0$, which follows directly from the estimation $0\leq \left|x\cdot \sin({\tfrac {1}{x}})\right|\leq |x|{\overset {x\to 0}{\to }}0$. On the other hand $\lim _{x\to 0}{\tfrac {\sin(x)}{x}}=1$, which we have shown with the rule of L'Hospital above.
In total we get
$\lim _{x\to 0}{\frac {x^{2}\sin({\tfrac {1}{x}})}{x+\sin(x)}}=\lim _{x\to 0}{\frac {\overbrace {x\cdot \sin({\tfrac {1}{x}})} ^{\to 0}}{1+\underbrace {\tfrac {\sin(x)}{x}} _{\to 1}}}={\frac {0}{1+1}}=0$
If we apply the rule of L'Hospital, which is allowed since the limit value is of the type ${\tfrac {0}{0}}$, we obtain
$\lim _{x\to 0}{\frac {x^{2}\sin({\tfrac {1}{x}})}{x+\sin(x)}}{\underset {\text{L'H.}}{\overset {\frac {0}{0}}{=}}}\lim _{x\to 0}{\frac {2x\sin({\tfrac {1}{x}})+x^{2}\cos({\tfrac {1}{x}})\cdot (-{\tfrac {1}{x^{2}}})}{1+\cos(x)}}=\lim _{x\to 0}{\frac {\overbrace {2x\sin({\tfrac {1}{x}})} ^{\to 0}-\overbrace {\cos({\tfrac {1}{x}})} ^{(*)}}{1+\underbrace {\cos(x)} _{\to 1}}}$
This limit now diverges because the ($*$) expression for $x\to 0$ diverges. Namely, for the null sequence $x_{n}={\frac {1}{n\pi }}$ there is $\cos({\tfrac {1}{x_{n}}})=\cos(n\pi )=(-1)^{n+1}$. So the application of L'Hospital was again unsuccessful!

### L’Hospital may render a wrong result

This can happen whenever the rule is applied although the conditions not are met. An example is
$\lim _{x\to \pi }{\frac {\sin(x)}{x}}$
Look carefully, in this case $x$ converges towards $\pi$, not $0$! Since enumerator and denominator are continuous in $\pi$, there is
$\lim _{x\to \pi }{\frac {\sin(x)}{x}}={\frac {\sin(\pi )}{\pi }}={\frac {0}{\pi }}=0$
L'Hospital is not applicable in the case of ${\frac {0}{\pi }}$ . If you apply the rule anyway, you will get the false result
$\lim _{x\to \pi }{\frac {\sin(x)}{x}}\ {\color {Red}{\overset {\text{false}}{=}}}\ \lim _{x\to \pi }{\frac {\cos(x)}{1}}={\frac {\cos(\pi )}{1}}={\frac {-1}{1}}=-1$
Therefore you should always check first whether the rule of L'Hospital is applicable or whether it is even necessary at all.
Exercise (Limits without 3)
Determine the limits
* $\lim _{x\to 0-}{\frac {\cos(x)}{x}}$
* $\lim _{x\to 0+}x^{\frac {1}{x}}$
What are the limits resulting from the incorrect application of the L'Hospital rule?
Solution (Limits without 3)
Part 1: Inserting results in
$\lim _{x\to 0-}{\frac {\overbrace {\cos(x)} ^{\to \cos(0)=1}}{\underbrace {x} _{\to 0-}}}=-\infty$
Since the limit value is of the type ${\frac {1}{0}}$, L'Hospital is not applicable. If we apply the rule anyway, we get the false result
$\lim _{x\to 0-}{\frac {\cos(x)}{x}}\ {\color {Red}{\overset {\text{false}}{=}}}\ \lim _{x\to 0-}{\frac {-\sin(x)}{1}}={\frac {-\sin(0)}{1}}={\frac {0}{1}}=0$
Part 2: Since the limit value is of the type $0^{\infty }$, we first use our standard re-formulation trick
$\lim _{x\to 0+}x^{\frac {1}{x}}=\lim _{x\to 0+}e^{\ln(x)\cdot {\frac {1}{x}}}=\lim _{x\to 0+}e^{\frac {\ln(x)}{x}}$
For the expression in the exponent there is now $\lim _{x\to 0+}{\frac {\overbrace {\ln(x)} ^{\to -\infty }}{\underbrace {x} _{\to 0+}}}=-\infty$. Because of $\lim _{x\to -\infty }e^{x}=0$ the result is
$\lim _{x\to 0+}x^{\frac {1}{x}}=\lim _{x\to 0+}e^{\frac {\ln(x)}{x}}=0$
In Exponent, L'Hospital is again not applicable. If we apply the rule anyway, we get
$\lim _{x\to 0+}{\frac {\ln(x)}{x}}\ {\color {Red}{\overset {\text{false}}{=}}}\ \lim _{x\to 0+}{\frac {\frac {1}{x}}{1}}=\lim _{x\to 0+}{\frac {1}{x}}=+\infty$
Because of $\lim _{x\to \infty }e^{x}=+\infty$ the following false result follows
$\lim _{x\to 0+}x^{\frac {1}{x}}=\lim _{x\to 0+}e^{\frac {\ln(x)}{x}}\ {\color {Red}{\overset {\text{false}}{=}}}\ +\infty$

## Implication: sufficient criterion for differentiability

Theorem (Criterion for differentiability)
Let $I\subseteq \mathbb {R}$ be an open interval and $a\in I$. Further let $f:I\to \mathbb {R}$ be continuous in $I$ and differentiable in $I\setminus \{a\}$. In addition, let there be $\lim \limits _{x\to a}f'(x)=c$. Then f is differentiable also at $a$ and there is $f'(a)=c$.
Proof (Criterion for differentiability)
We have to show:
$f'(a)=\lim _{h\to 0}{\frac {f(a+h)-f(a)}{h}}=c$
Now is $\lim _{h\to 0}f(a+h)-f(a){\overset {f{\text{ continuous}}}{=}}f(a)-f(a)=0$ and $\lim _{h\to 0}h=0$. Furthermore, ${\tilde {f}}(h)=f(a+h)-f(a)$ and ${\tilde {g}}(h)=h$ are differentiable for $h\neq 0$, and ${\tilde {g}}'(h)=1\neq 0$. With the rule of L'Hospital we obtain
$\lim _{h\to 0}{\frac {f(a+h)-f(a)}{h}}=\lim _{h\to 0}{\frac {f'(a+h)}{1}}{\overset {\lim \limits _{x\to a}f'(x)=c}{=}}c$
Thus $f$ is differentiable at $a$ with $f'(a)=c$.
Alternative proof (Criterion for differentiability)
We can also use the mean value theorem to show
$f'(a)=\lim _{x\to a}{\frac {f(x)-f(a)}{x-a}}=c$
Let for this be $(x_{n})_{n\in \mathbb {N} }$ a sequence in $I$ with $\lim _{n\to \infty }x_{n}=a$. Then $f$ according to the precondition for all $n\in \mathbb {N}$ is continuous on $[a,x_{n}]$ (or $[x_{n},a]$) and differentiable on $(a,x_{n})$ (or $(x_{n},a)$). According to the mean value theorem there is for all $n\in \mathbb {N}$ a $\xi _{n}\in (a,x_{n})$ (or $(x_{n},a)$) with
${\frac {f(x_{n})-f(a)}{x_{n}-a}}=f'(\xi _{n})$
Since now $x_{n}\to a$ and $\xi _{n}\in [a,x_{n}]\iff a\leq \xi _{n}\leq x_{n}$ (or $\xi _{n}\in [x_{n},a]\iff x_{n}\leq \xi _{n}\leq a$), there is also $\xi _{n}\to a$. Because of $\lim _{x\to a}f'(x)=c$ it follows that $\lim _{n\to \infty }f'(\xi _{n})=c$. So we get
$\lim _{n\to \infty }{\frac {f(x_{n})-f(a)}{x_{n}-a}}=\lim _{n\to \infty }f'(\xi _{n})=c$
Since $(x_{n})$ with $x_{n}\to a$ was arbitrary, we obtain
$f'(a)=\lim _{x\to a}{\frac {f(x)-f(a)}{x-a}}=c$
Hint
A function that fulfils the criterion from the theorem is not only differentiable at the point $a$. Because of $\lim _{x\to a}f'(x)=c=f'(a)$ the derivative function is even continuous in $a$. Therefore the criterion is sufficient and not necessary for the differentiability in $a$.
Question: Give an example of a differentiable function that does not satisfy the conditions of the theorem.
We are looking for a differentiable function whose derivative is not continuous at one point. An example (among many) is the function
$f:\mathbb {R} \to \mathbb {R} ,\ f(x)={\begin{cases}x^{2}\sin({\tfrac {1}{x}})&{\text{ for }}x\neq 0,\\0&{\text{ for }}x=0.\end{cases}}$
It has at $a=0$ the derivative $f'(0)=0$, but is not continuous there, as the limit
$\lim _{x\to 0 \atop x\neq 0}f'(x)=\lim _{x\to 0 \atop x\neq 0}\left[2x\sin({\tfrac {1}{x}})-\cos({\tfrac {1}{x}})\right]$
does not exist.
Exercise (Differentiability of the Si-function)
Let
$f:\mathbb {R} \to \mathbb {R} ,\ f(x)={\begin{cases}{\frac {\sin(x)}{x}}&{\text{ for }}x\neq 0,\\1&{\text{ for }}x=0\end{cases}}$
Show, without using the differential quotient, that $f$ is differentiable at zero and calculate the derivative $f'(0)$.
Solution (Differentiability of the Si-function)
Step 1: $f$ is continuous at zero
By L’Hospital there is
$\lim _{x\to 0}f(x)=\lim _{x\to 0}{\frac {\sin(x)}{x}}{\underset {\text{l.H.}}{\overset {\tfrac {0}{0}}{=}}}\lim _{x\to 0}{\frac {\cos(x)}{1}}=1=f(0)$
So $f$ is continuous at zero.
Step 2: $f$ is differentiable on $\mathbb {R} \setminus \{0\}$
Since $\sin$ and $x\mapsto x$ are differentiable on $\mathbb {R} \setminus \{0\}$, the function $f$ is also differentiable there, by the quotient rule. Further there is for $x\neq 0$:
$f'(x)={\frac {\cos(x)\cdot x-\sin(x)\cdot 1}{x^{2}}}={\frac {x\cos(x)-\sin(x)}{x^{2}}}$
Step 3: $f$ is differentiable at zero
We use the criterion from the previous theorem. (Because of Step 1 and 2, it is applicable.) There is
$\lim _{x\to 0}f'(x)=\lim _{x\to 0}{\frac {x\cos(x)-\sin(x)}{x^{2}}}{\underset {\text{l.H.}}{\overset {\tfrac {0}{0}}{=}}}\lim _{x\to 0}{\frac {\cos(x)-x\sin(x)-\cos(x)}{2x}}=\lim _{x\to 0}{\frac {-x\sin(x)}{2x}}{\underset {\text{l.H.}}{\overset {\tfrac {0}{0}}{=}}}\lim _{x\to 0}{\frac {-\sin(x)-x\cos(x)}{2}}=0$
According to the criterion, $f$ is differentiable at zero with $f'(0)=0$.
Overview: continuity and differentiability →
We believe that anyone can understand higher level maths - with the right explanation! That's why we - a group of passionate students and teachers of mathematics - are translating our legendary co-created textbook for real analysis (“Analysis 1”) from German into English. If you know German and want to help us to make higher level maths accessible to everyone, then we look forward to hearing from you at en@serlo.org.
Feedback? Do you want to join?
If you have questions concerning the content, or didn't understand something, the feel free to contact us! We would love to answer your questions! Also we are thankful for critics and/or comments! If you share our vision to explain university math in an comprehensible way, then contact us under:
E-Mail: en@serlo.org
This article is licensed under the free license CC-BY-SA 3.0. With that you can use it, modify it or share it freely, as long as you name „Serlo“ as source and put you changes under the same CC-BY-SA 3.0 oder an compatible license. On the page „Kopier uns!“ we explain you what you have to pay attention to, when using our texts, picture or videos.