---
title: Indeterminate Forms and l'Hospital's Rule
module: Exponential, Logarithmic, and Inverse Functions
moduleNumber: 6
lessonNumber: 3
order: 603
summary: >
  When a limit produces 0/0 or infinity over infinity, the value is undetermined
  by the forms alone. l'Hospital's Rule resolves both by replacing the ratio of
  functions with the ratio of their derivatives. Products, differences, and
  powers reduce to a quotient the rule can handle, and repeated use ranks the
  growth of logarithms, powers, and exponentials.
topics: [Exponential, Logarithmic, and Inverse Functions]
sources:
  - book: Stewart
    ref: "Ch. 6 — Inverse Functions; §6.8 Indeterminate Forms and l'Hospital's Rule"
draft: false
---

Consider $\displaystyle\lim_{x \to 1}\frac{\ln x}{x - 1}$. Both numerator and
denominator approach $0$, and $\tfrac{0}{0}$ is not a number, so the
[limit laws](/calculus/limits-and-continuity/limit-laws-and-the-precise-definition)
for quotients do not apply: the value is not determined by the form. It might be
any number, or fail to exist. The same ambiguity arises for
$\displaystyle\lim_{x \to \infty}\frac{e^x}{x^2}$, where numerator and
denominator both grow without bound. l'Hospital's Rule handles both cases by
replacing the ratio of two functions with the ratio of their derivatives, and
applied repeatedly it ranks the competing growth rates of logarithms, powers,
and exponentials.

## Indeterminate forms

> **Definition (Indeterminate forms $\tfrac{0}{0}$ and $\tfrac{\infty}{\infty}$).**
> A limit $\displaystyle\lim_{x \to a}\frac{f(x)}{g(x)}$ is an **indeterminate
> form of type $\tfrac{0}{0}$** if $f(x) \to 0$ and $g(x) \to 0$, and of type
> **$\tfrac{\infty}{\infty}$** if both $f(x)$ and $g(x)$ tend to $\pm\infty$. In
> either case the form alone does not fix the value of the limit.

Some such limits yield to algebra. A rational $\tfrac{0}{0}$ cancels a common
factor,
$$
\lim_{x \to 1}\frac{x^2 - x}{x^2 - 1}
= \lim_{x \to 1}\frac{x(x - 1)}{(x + 1)(x - 1)}
= \lim_{x \to 1}\frac{x}{x + 1} = \frac{1}{2},
$$
and $\displaystyle\lim_{x \to 0}\frac{\sin x}{x} = 1$ was found by a geometric
argument. But $\frac{\ln x}{x - 1}$ has no factor to cancel, and a general
method is needed.

## l'Hospital's Rule

> **Theorem (l'Hospital's Rule).** Suppose $f$ and $g$ are differentiable with
> $g'(x) \neq 0$ near $a$ (except possibly at $a$), and that
> $\displaystyle\lim_{x \to a}\frac{f(x)}{g(x)}$ is an indeterminate form of type
> $\tfrac{0}{0}$ or $\tfrac{\infty}{\infty}$. Then
> $$
> \lim_{x \to a}\frac{f(x)}{g(x)} = \lim_{x \to a}\frac{f'(x)}{g'(x)}
> $$
> provided the limit on the right exists (or is $\pm\infty$).

The statement holds for one-sided limits and for $a = \pm\infty$; the symbol
$x \to a$ may be replaced by $x \to a^+$, $x \to a^-$, $x \to \infty$, or
$x \to -\infty$. Named for the Marquis de l'Hospital, who published it in 1696,
the rule was discovered by John Bernoulli.

The reason is visible when $f(a) = g(a) = 0$ with $f', g'$ continuous and
$g'(a) \neq 0$. Near $a$ each function is close to its tangent line through
$(a, 0)$, so the ratio of the functions is close to the ratio of the two linear
approximations, which is the ratio of their slopes.

$$
% caption: When both functions vanish at a, zooming in makes each nearly linear;
% the ratio of the functions approaches the ratio of the tangent slopes f'/g'.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.3,0) -- (4.6,0) node[right] {$x$};
\draw[->, black] (0,-1.7) -- (0,1.9) node[above] {$y$};
% common zero at a
\coordinate (A) at (1.2,0);
\fill[black] (A) circle (1.8pt) node[anchor=north] {$a$};
% two lines through (a,0) with slopes m1 (steep), m2 (shallow)
\draw[acc, very thick] (A) -- (4.3, {1.05*(4.3-1.2)}) node[right] {$f\approx m_1(x-a)$};
\draw[acc, very thick, densely dashed] (A) -- (4.3, {0.42*(4.3-1.2)}) node[right] {$g\approx m_2(x-a)$};
\node[black, anchor=east] at (4.0,-0.55) {$\dfrac{f}{g}\to\dfrac{m_1}{m_2}=\dfrac{f'(a)}{g'(a)}$};
\end{tikzpicture}
$$

Formally, using the definition of the derivative,
$$
\lim_{x \to a}\frac{f(x)}{g(x)}
= \lim_{x \to a}\frac{\dfrac{f(x) - f(a)}{x - a}}{\dfrac{g(x) - g(a)}{x - a}}
= \frac{f'(a)}{g'(a)}
= \lim_{x \to a}\frac{f'(x)}{g'(x)},
$$
where the middle step uses $f(a) = g(a) = 0$. The general proof, valid without
continuity of the derivatives and for the $\tfrac{\infty}{\infty}$ case, is more
delicate but gives the same conclusion.

The differentiation is of numerator and denominator **separately**; this is not
the quotient rule. Returning to the opening example,
$$
\lim_{x \to 1}\frac{\ln x}{x - 1}
= \lim_{x \to 1}\frac{1/x}{1} = 1.
$$

## Comparing growth rates

Repeated application compares the growth rates of the function families of this
module. For $\displaystyle\lim_{x \to \infty}\frac{e^x}{x^2}$, type
$\tfrac{\infty}{\infty}$, two passes clear the denominator:
$$
\lim_{x \to \infty}\frac{e^x}{x^2}
= \lim_{x \to \infty}\frac{e^x}{2x}
= \lim_{x \to \infty}\frac{e^x}{2} = \infty.
$$
The exponential outgrows the power; in fact $e^x$ grows faster than every power
$x^n$. At the other extreme the logarithm grows slower than every positive
power:
$$
\lim_{x \to \infty}\frac{\ln x}{\sqrt[3]{x}}
= \lim_{x \to \infty}\frac{1/x}{\tfrac{1}{3}x^{-2/3}}
= \lim_{x \to \infty}\frac{3}{x^{1/3}} = 0.
$$
These two results give the ordering that governs limits at infinity: logarithms
grow slower than powers, and powers grow slower than exponentials.

$$
% caption: The growth race at large x. The logarithm trails every power, and
% every power trails the exponential, so ln x, x^2, and e^x separate in order.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.3,0) -- (4.7,0) node[right] {$x$};
\draw[->, black] (0,-0.3) -- (0,3.9) node[above] {$y$};
\draw[acc, very thick] plot[smooth, domain=0:1.86] (\x, {pow(2.71828,\x)}) node[right] {$e^x$};
\draw[acc, very thick, densely dashed] plot[smooth, domain=0:1.9] (\x, {\x*\x}) node[above right] {$x^2$};
\draw[black, very thick, dotted] plot[smooth, domain=0.14:4.4] (\x, {ln(\x)}) node[right] {$\ln x$};
\end{tikzpicture}
$$

A harder $\tfrac{0}{0}$ example needs three applications:
$$
\lim_{x \to 0}\frac{\tan x - x}{x^3}
= \lim_{x \to 0}\frac{\sec^2 x - 1}{3x^2}
= \lim_{x \to 0}\frac{2\sec^2 x \tan x}{6x}
= \frac{1}{3}\lim_{x \to 0}\frac{\tan x}{x} = \frac{1}{3}.
$$

## Checking the form

l'Hospital's Rule applies only to $\tfrac{0}{0}$ and $\tfrac{\infty}{\infty}$.
Applying it blindly to a ratio that is not indeterminate gives a wrong answer.
For $\displaystyle\lim_{x \to \pi^-}\frac{\sin x}{1 - \cos x}$, the numerator
tends to $0$ but the denominator tends to $1 - (-1) = 2 \neq 0$, so the form is
$\tfrac{0}{2}$, not indeterminate, and the function is continuous there:
$$
\lim_{x \to \pi^-}\frac{\sin x}{1 - \cos x} = \frac{\sin \pi}{1 - \cos \pi} = \frac{0}{2} = 0.
$$
Differentiating top and bottom would have produced $\cos x / \sin x \to -\infty$,
which is incorrect. Verify the form before differentiating, and prefer simpler
methods when they apply.

A second failure mode is a genuine indeterminate form on which the rule cycles
without ever simplifying. There the derivatives only reshuffle the same
expression, and elementary algebra settles the limit at once.

> **Worked example.** Evaluate $\displaystyle\lim_{x \to \infty}\frac{\sqrt{x^2 + 1}}{x}$.
>
> The form is $\infty/\infty$, so the rule applies. Differentiating top and
> bottom,
>
> $$
> \lim_{x \to \infty}\frac{\sqrt{x^2 + 1}}{x}
> = \lim_{x \to \infty}\frac{x/\sqrt{x^2 + 1}}{1}
> = \lim_{x \to \infty}\frac{x}{\sqrt{x^2 + 1}},
> $$
>
> and a second application returns $\sqrt{x^2 + 1}/x$, the original ratio
> inverted. The rule cycles between the two forms and never terminates. Factor
> $x$ out of the radical instead:
>
> $$
> \frac{\sqrt{x^2 + 1}}{x} = \sqrt{1 + \frac{1}{x^2}} \longrightarrow \sqrt{1} = 1.
> $$

$$
% caption: A limit on which l'Hospital cycles. Factoring x from the radical
% shows the ratio decreasing to the horizontal asymptote y = 1.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.3,0) -- (5.2,0) node[right] {$x$};
\draw[->, black] (0,-0.3) -- (0,2.9) node[above] {$y$};
\draw[black, dashed] (0,1.0) -- (5.0,1.0) node[right, black] {$y=1$};
\draw[acc, very thick] plot[smooth, domain=0.4:4.7, samples=60] (\x, {sqrt(\x*\x + 1)/\x});
\end{tikzpicture}
$$

## Reducing other forms to a quotient

Products, differences, and powers can each be indeterminate, and each is handled
by algebra that recasts it as $\tfrac{0}{0}$ or $\tfrac{\infty}{\infty}$.

| Form | Situation | Conversion |
| --- | --- | --- |
| $0 \cdot \infty$ | $f \to 0$, $g \to \infty$ | write $fg = \dfrac{f}{1/g}$ or $\dfrac{g}{1/f}$ |
| $\infty - \infty$ | $f \to \infty$, $g \to \infty$ | common denominator, factor, or rationalize |
| $0^0,\ \infty^0,\ 1^\infty$ | $f^g$ | take $\ln$: $\ln y = g \ln f$, type $0 \cdot \infty$ |

### Indeterminate products

For type $0 \cdot \infty$, move one factor into the denominator.

> **Worked example.** Evaluate $\displaystyle\lim_{x \to 0^+} x \ln x$.
>
> Here $x \to 0$ while $\ln x \to -\infty$, an indeterminate $0 \cdot \infty$.
> Writing $x = 1/(1/x)$ puts it in $\tfrac{-\infty}{\infty}$ form so the rule
> applies:
>
> $$
> \lim_{x \to 0^+} x \ln x
> = \lim_{x \to 0^+}\frac{\ln x}{1/x}
> = \lim_{x \to 0^+}\frac{1/x}{-1/x^2}
> = \lim_{x \to 0^+}(-x) = 0.
> $$
>
> Inverting the other factor, $x/(1/\ln x)$, produces a messier derivative;
> pick the arrangement that simplifies.

### Indeterminate differences

For type $\infty - \infty$, combine into a single fraction.

> **Worked example.** Evaluate $\displaystyle\lim_{x \to (\pi/2)^-}(\sec x - \tan x)$.
>
> Both $\sec x$ and $\tan x$ diverge as $x \to (\pi/2)^-$, so the difference is
> $\infty - \infty$. Writing each over $\cos x$ merges them into one fraction of
> type $\tfrac{0}{0}$, and the rule applies:
>
> $$
> \lim_{x \to (\pi/2)^-}(\sec x - \tan x)
> = \lim_{x \to (\pi/2)^-}\frac{1 - \sin x}{\cos x}
> = \lim_{x \to (\pi/2)^-}\frac{-\cos x}{-\sin x} = 0.
> $$

### Indeterminate powers

Three forms arise from $y = [f(x)]^{g(x)}$: type $0^0$ when $f \to 0$ and
$g \to 0$; type $\infty^0$ when $f \to \infty$ and $g \to 0$; and type
$1^\infty$ when $f \to 1$ and $g \to \pm\infty$. All three are resolved by
taking the logarithm, which turns the power into the product $g \ln f$.

$$
% caption: A power indeterminacy is resolved through the logarithm: take ln to
% get a product, convert to a quotient, apply the rule, then exponentiate.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize,
  box/.style={draw, black!70, minimum width=26mm, minimum height=10mm, align=center}]
\definecolor{acc}{HTML}{4A6FA5}
\node[box, draw=acc] (a) at (0,0) {$y=f^{\,g}$};
\node[box] (b) at (3.4,0) {$\ln y = g\ln f$};
\node[box] (c) at (6.8,0) {type $0\cdot\infty$};
\node[box] (d) at (6.8,-1.9) {$\lim \ln y = L$};
\node[box, draw=acc] (e) at (3.4,-1.9) {$\lim y = e^{L}$};
\draw[->, acc, thick] (a) -- (b);
\draw[->, acc, thick] (b) -- (c);
\draw[->, acc, thick] (c) -- (d);
\draw[->, acc, thick] (d) -- (e);
\node[black, anchor=south, font=\scriptsize] at (5.1,0.05) {rewrite};
\node[black, anchor=west, font=\scriptsize] at (6.95,-0.95) {l'Hospital};
\end{tikzpicture}
$$

For $\displaystyle\lim_{x \to 0^+}(1 + \sin 4x)^{\cot x}$, type $1^\infty$, set
$y = (1 + \sin 4x)^{\cot x}$, so
$$
\ln y = \cot x \,\ln(1 + \sin 4x) = \frac{\ln(1 + \sin 4x)}{\tan x},
$$
a $\tfrac{0}{0}$ form. l'Hospital gives
$$
\lim_{x \to 0^+}\ln y
= \lim_{x \to 0^+}\frac{\dfrac{4\cos 4x}{1 + \sin 4x}}{\sec^2 x} = 4,
$$
and since $y = e^{\ln y}$, the original limit is $e^4$. The exponentiation at the
end is essential: the rule computes $\lim \ln y$, and the answer is $e$ raised to
that.

The canonical $1^\infty$ form is the limit that defines $e$.

> **Worked example.** Evaluate $\displaystyle\lim_{x \to \infty}\left(1 + \frac{1}{x}\right)^x$.
>
> As $x \to \infty$ the base tends to $1$ and the exponent to $\infty$, type
> $1^\infty$. Set $y = (1 + 1/x)^x$, so
>
> $$
> \ln y = x\,\ln\!\left(1 + \frac{1}{x}\right) = \frac{\ln(1 + 1/x)}{1/x},
> $$
>
> a $\tfrac{0}{0}$ form. Applying the rule, with $\frac{\d}{\d x}\ln(1 + 1/x) =
> \frac{-1/x^2}{1 + 1/x}$ and $\frac{\d}{\d x}(1/x) = -1/x^2$,
>
> $$
> \lim_{x \to \infty}\ln y
> = \lim_{x \to \infty}\frac{-1/x^2}{(1 + 1/x)(-1/x^2)}
> = \lim_{x \to \infty}\frac{1}{1 + 1/x} = 1,
> $$
>
> so the limit is $e^1 = e$. This recovers $e = \lim_{x \to \infty}(1 + 1/x)^x$
> as an instance of the general power method.

> **Worked example.** Evaluate $\displaystyle\lim_{x \to 0^+} x^x$.
>
> The base and exponent both approach $0$, type $0^0$. Write
> $x^x = e^{x \ln x}$. The exponent is the product limit computed above,
> $x \ln x \to 0$, so
>
> $$
> \lim_{x \to 0^+} x^x = \lim_{x \to 0^+} e^{x \ln x} = e^0 = 1.
> $$
>
> The symbol $0^0$ has no arithmetic value, yet $x^x \to 1$ along this path.
> Not every combination is indeterminate: $0^\infty$, for instance, equals $0$.

$$
% caption: The function x^x for x > 0 descends from the limit 1 at the origin
% to a minimum near x = 1/e, then rises past 1.
\begin{tikzpicture}[scale=1.6, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.15,0) -- (1.75,0) node[right] {$x$};
\draw[->, black] (0,-0.1) -- (0,2.1) node[above] {$y$};
\draw[black, dotted] (0,1.0) -- (1.7,1.0);
\node[black, anchor=east] at (-0.05,1.0) {$1$};
\draw[acc, very thick] plot[smooth, domain=0.045:1.55, samples=60] (\x, {exp(\x*ln(\x))}) node[above right] {$x^x$};
\fill[black] (0.368,0.692) circle (1.3pt) node[anchor=north, font=\footnotesize] {min};
\end{tikzpicture}
$$

The type $\infty^0$ is handled identically. For
$\displaystyle\lim_{x \to \infty} x^{1/x}$, set $y = x^{1/x}$, so
$\ln y = \dfrac{\ln x}{x}$, a $\tfrac{\infty}{\infty}$ form. l'Hospital gives
$$
\lim_{x \to \infty}\ln y = \lim_{x \to \infty}\frac{1/x}{1} = 0,
\qquad\text{so}\qquad
\lim_{x \to \infty} x^{1/x} = e^0 = 1.
$$
The vanishing exponent cancels the growing base, leaving $1$.

## Proof of the rule

The special case with $f(a) = g(a) = 0$ and continuous derivatives was proved
above by splitting the ratio into two difference quotients. The general
statement, which allows one-sided approach and the $\tfrac{\infty}{\infty}$ form,
rests on a two-function version of the
[Mean Value Theorem](/calculus/applications-of-derivatives/extrema-and-the-mean-value-theorem).

> **Theorem (Cauchy's Mean Value Theorem).** If $f$ and $g$ are continuous on
> $[a, b]$ and differentiable on $(a, b)$, then there is a number $c$ in
> $(a, b)$ with
> $$
> \bigl[f(b) - f(a)\bigr]\,g'(c) = \bigl[g(b) - g(a)\bigr]\,f'(c).
> $$

Taking $g(x) = x$ recovers the ordinary Mean Value Theorem. Applied to the pair
$(f, g)$ on a shrinking interval with endpoint $a$, and using $f(a) = g(a) = 0$,
the equation rearranges to
$$
\frac{f(x)}{g(x)} = \frac{f(x) - f(a)}{g(x) - g(a)} = \frac{f'(c)}{g'(c)}
$$
for some $c$ between $a$ and $x$. As $x \to a$ the intermediate point $c$ is
squeezed to $a$ as well, so the ratio $f'(c)/g'(c)$ approaches
$\lim f'(x)/g'(x)$, which is the conclusion of the rule.
