---
title: Inverse Functions, Logarithms, and Exponentials
module: Exponential, Logarithmic, and Inverse Functions
moduleNumber: 6
lessonNumber: 1
order: 601
summary: >
  A one-to-one function has an inverse that reverses it, with a graph mirrored
  across y = x and a derivative given by the reciprocal-slope rule. The
  exponential e^x is its own derivative and the natural logarithm has derivative
  1/x; logarithmic differentiation turns products, quotients, and variable
  powers into sums.
topics: [Exponential, Logarithmic, and Inverse Functions]
sources:
  - book: Stewart
    ref: "Ch. 6 — Inverse Functions; §6.1 Inverse Functions"
  - book: Stewart
    ref: "§6.2 Exponential Functions and Their Derivatives; §6.3 Logarithmic Functions"
  - book: Stewart
    ref: "§6.4 Derivatives of Logarithmic Functions"
draft: false
---

A function takes an input to an output. Sometimes the useful question runs the
other way: given the output, which input produced it? For a bacteria culture
whose population $N = f(t)$ is recorded hourly, the biologist may instead want
the time $t$ required to reach a given level $N$. That reversed rule is the
**inverse function** $f^{-1}$, and it exists only when $f$ never sends two
inputs to the same output. The two families where this reversal is used most
are the exponentials $b^x$ and the logarithms $\log_b x$, inverse to each other,
and the derivative of an inverse gives both their derivatives from a single
rule.

## One-to-one functions

An inverse can only be defined when no output is claimed by two different
inputs. If $g(2) = g(3) = 4$, there is no way to recover the input from the
output $4$.

> **Definition (One-to-one function).** A function $f$ is **one-to-one** if it
> never takes the same value twice; that is,
> $$
> f(x_1) \neq f(x_2) \quad \text{whenever} \quad x_1 \neq x_2.
> $$

Geometrically this is a statement about horizontal lines. If some horizontal
line $y = c$ met the graph at two points $x_1, x_2$, then $f(x_1) = f(x_2) = c$
with $x_1 \neq x_2$, breaking the definition.

> **Horizontal Line Test.** A function is one-to-one if and only if no
> horizontal line intersects its graph more than once.

For example, $f(x) = x^3$ is one-to-one: distinct numbers have distinct cubes,
and no horizontal line meets the cubic twice. By contrast $g(x) = x^2$ fails,
since $g(-1) = g(1) = 1$. An increasing function is automatically one-to-one,
and so is a decreasing one, because a strictly monotonic graph can never
double back to repeat a height.

$$
% caption: The Horizontal Line Test. A cubic meets every horizontal line
% exactly once and is one-to-one; a parabola meets some lines twice and is not.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\begin{scope}
  \draw[->, black] (-1.6,0) -- (1.6,0) node[right] {$x$};
  \draw[->, black] (0,-1.5) -- (0,1.7) node[above] {$y$};
  \draw[acc, very thick] plot[smooth, domain=-1.15:1.15] (\x, {\x*\x*\x}) node[above right] {$x^3$};
  \draw[black, densely dashed] (-1.6,0.6) -- (1.6,0.6);
  \fill[black] (0.843,0.6) circle (1.7pt);
\end{scope}
\begin{scope}[xshift=4.4cm]
  \draw[->, black] (-1.6,0) -- (1.6,0) node[right] {$x$};
  \draw[->, black] (0,-0.3) -- (0,1.9) node[above] {$y$};
  \draw[acc, very thick] plot[smooth, domain=-1.32:1.32] (\x, {\x*\x}) node[above right] {$x^2$};
  \draw[black, densely dashed] (-1.6,0.64) -- (1.6,0.64);
  \fill[black] (-0.8,0.64) circle (1.7pt);
  \fill[black] (0.8,0.64) circle (1.7pt);
\end{scope}
\end{tikzpicture}
$$

## The inverse function

> **Definition (Inverse function).** Let $f$ be one-to-one with domain $A$ and
> range $B$. Its **inverse** $f^{-1}$ has domain $B$ and range $A$, and is
> defined by
> $$
> f^{-1}(y) = x \iff f(x) = y.
> $$

The inverse reverses the assignment: if $f$ sends $x$ to $y$, then $f^{-1}$
sends $y$ back to $x$. Domain and range trade places,
$$
\operatorname{dom} f^{-1} = \operatorname{ran} f,
\qquad
\operatorname{ran} f^{-1} = \operatorname{dom} f.
$$
The superscript $-1$ is notation, not an exponent: $f^{-1}(x)$ does not mean
$1/f(x)$. Applying a function and then its inverse returns the starting value,
which is the content of the **cancellation equations**:
$$
f^{-1}\bigl(f(x)\bigr) = x \ \text{ for } x \in A,
\qquad
f\bigl(f^{-1}(x)\bigr) = x \ \text{ for } x \in B.
$$

To compute a formula for $f^{-1}$, solve $y = f(x)$ for $x$, then interchange
the names of the variables so the independent variable is again called $x$.

> **Finding an inverse.** Write $y = f(x)$; solve for $x$ in terms of $y$;
> interchange $x$ and $y$ to get $y = f^{-1}(x)$.

For $f(x) = x^3 + 2$, solving $y = x^3 + 2$ gives $x = \sqrt[3]{y - 2}$, and
after interchanging, $f^{-1}(x) = \sqrt[3]{x - 2}$. The rule "cube, then add 2"
is reversed by "subtract 2, then take the cube root."

The graph of $f^{-1}$ is the reflection of the graph of $f$ across the line
$y = x$. The point $(a, b)$ lies on the graph of $f$ exactly when $(b, a)$ lies
on the graph of $f^{-1}$, and $(b, a)$ is the mirror image of $(a, b)$ in the
diagonal.

$$
% caption: A one-to-one function and its inverse are reflections of each other
% across the line y = x; the point (a,b) on f maps to (b,a) on the inverse.
\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,-0.3) -- (0,4.6) node[above] {$y$};
\draw[black, dashed] (-0.2,-0.2) -- (4.4,4.4) node[right, black] {$y=x$};
% f: increasing curve above the diagonal
\draw[acc, very thick] plot[smooth, domain=0.35:2.05] (\x, {0.55*\x*\x*\x - 0.2*\x + 0.35}) node[right] {$f$};
% f^{-1}: reflection (swap coordinates)
\draw[acc, very thick, densely dashed] plot[smooth, domain=0.35:2.05] ({0.55*\x*\x*\x - 0.2*\x + 0.35}, \x) node[above] {$f^{-1}$};
% matched points
\fill[black] (1.6,{0.55*1.6*1.6*1.6 - 0.2*1.6 + 0.35}) circle (2pt);
\node[anchor=south east] at (1.6,{0.55*1.6*1.6*1.6 - 0.2*1.6 + 0.35}) {$(a,\,b)$};
\fill[black] ({0.55*1.6*1.6*1.6 - 0.2*1.6 + 0.35},1.6) circle (2pt);
\node[anchor=north west] at ({0.55*1.6*1.6*1.6 - 0.2*1.6 + 0.35},1.6) {$(b,\,a)$};
\draw[black] (1.6,{0.55*1.6*1.6*1.6 - 0.2*1.6 + 0.35}) -- ({0.55*1.6*1.6*1.6 - 0.2*1.6 + 0.35},1.6);
\end{tikzpicture}
$$

A function that fails the Horizontal Line Test can often be salvaged by
restricting its domain. The full parabola $y = x^2$ has no inverse, but
$f(x) = x^2$ on $[0, 2]$ is one-to-one, with inverse $f^{-1}(x) = \sqrt{x}$ on
$[0, 4]$.

## The derivative of an inverse

Reflecting a graph across $y = x$ interchanges the roles of the horizontal and
vertical directions, so it interchanges rise and run. The slope of $f^{-1}$ at a
point is therefore the reciprocal of the slope of $f$ at the mirror point.

> **Theorem (Derivative of an inverse).** If $f$ is one-to-one and
> differentiable with $f'\bigl(f^{-1}(a)\bigr) \neq 0$, then $f^{-1}$ is
> differentiable at $a$ and
> $$
> \bigl(f^{-1}\bigr)'(a) = \frac{1}{f'\bigl(f^{-1}(a)\bigr)}.
> $$

The reason is [implicit differentiation](/calculus/derivatives/implicit-differentiation-and-related-rates).
Write $y = f^{-1}(x)$, so $f(y) = x$. Differentiating $f(y) = x$ with respect to
$x$ and using the [chain rule](/calculus/derivatives/differentiation-rules-and-the-chain-rule),
$$
f'(y)\,\frac{\d y}{\d x} = 1
\qquad\Longrightarrow\qquad
\frac{\d y}{\d x} = \frac{1}{f'(y)} = \frac{1}{\d x/\d y}.
$$
In Leibniz notation the rule reads $\dfrac{\d y}{\d x} = \dfrac{1}{\,\d x/\d y\,}$, which
is the reciprocal-slope statement written symbolically.

$$
% caption: Writing g = f^{-1}, reflection across y = x sends the tangent to f
% at (a,b), of slope m, to the tangent to g at (b,a), of reciprocal slope 1/m.
\begin{tikzpicture}[scale=1.05, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.3,0) -- (3.7,0) node[right] {$x$};
\draw[->, black] (0,-0.3) -- (0,3.7) node[above] {$y$};
\draw[black, dashed] (-0.2,-0.2) -- (3.5,3.5) node[right, black] {$y=x$};
\draw[acc, very thick] plot[smooth, domain=0.35:3.35] (\x, {0.25*\x*\x}) node[right] {$f$};
\draw[acc, very thick, densely dashed] plot[smooth, domain=0.35:3.35] ({0.25*\x*\x}, \x) node[above] {$g$};
% tangent to f at P=(2.4,1.44), slope 1.2
\draw[black] (1.75,{1.44-1.2*0.65}) -- (3.05,{1.44+1.2*0.65});
\fill[black] (2.4,1.44) circle (1.7pt) node[anchor=north west] {$(a,\,b)$};
\node[black, anchor=north west, font=\footnotesize] at (2.55,0.78) {slope $m$};
% tangent to f^{-1} at P'=(1.44,2.4), slope 5/6
\draw[black, densely dashed] ({1.44-0.78},{2.4-0.833*0.78}) -- ({1.44+1.4},{2.4+0.833*1.4});
\fill[black] (1.44,2.4) circle (1.7pt) node[anchor=south east] {$(b,\,a)$};
\node[black, anchor=south east, font=\footnotesize] at (0.72,2.72) {slope $\frac{1}{m}$};
\end{tikzpicture}
$$

The formula gives the derivative of an inverse without ever computing the
inverse itself.

> **Worked example.** For $f(x) = 2x + \cos x$, find $(f^{-1})'(1)$.
>
> The derivative $f'(x) = 2 - \sin x$ is positive everywhere, so $f$ increases
> and is one-to-one, and the inverse exists. Rather than solve $2x + \cos x = 1$
> for a formula, read off the point directly: $f(0) = 2(0) + \cos 0 = 1$, so
> $f^{-1}(1) = 0$. Then
>
> $$
> \bigl(f^{-1}\bigr)'(1) = \frac{1}{f'\bigl(f^{-1}(1)\bigr)} = \frac{1}{f'(0)}
> = \frac{1}{2 - \sin 0} = \frac{1}{2}.
> $$

## Exponential functions

An **exponential function** has the form $f(x) = b^x$ with a positive constant
base $b$; the variable sits in the exponent. This is not the power function
$x^b$, where the variable is the base. For a positive integer $n$, $b^n$ is $b$
multiplied by itself $n$ times; the laws of exponents extend the definition to
rational $x$, and a limiting process fills the irrational values so that $b^x$
is continuous everywhere.

> **Theorem (Exponential function).** If $b > 0$ and $b \neq 1$, then
> $f(x) = b^x$ is continuous with domain $\mathbb{R}$ and range $(0, \infty)$,
> so $b^x > 0$ for all $x$. It is increasing if $b > 1$ and decreasing if
> $0 < b < 1$. For $a, b > 0$ and real $x, y$:
> $$
> b^{x+y} = b^x b^y, \qquad
> b^{x-y} = \frac{b^x}{b^y}, \qquad
> (b^x)^y = b^{xy}, \qquad
> (ab)^x = a^x b^x.
> $$

Every graph $y = b^x$ passes through $(0, 1)$ because $b^0 = 1$, and larger
bases climb more steeply for $x > 0$. The end behavior follows from the
monotonicity:
$$
b > 1: \quad \lim_{x \to \infty} b^x = \infty, \quad \lim_{x \to -\infty} b^x = 0;
\qquad
0 < b < 1: \quad \lim_{x \to \infty} b^x = 0, \quad \lim_{x \to -\infty} b^x = \infty.
$$
In either case the $x$-axis is a horizontal asymptote.

$$
% caption: The family y = b^x. Every curve passes through (0,1); bases above 1
% increase and bases below 1 decrease, each a reflection of another across the
% vertical axis.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-2.6,0) -- (2.7,0) node[right] {$x$};
\draw[->, black] (0,-0.3) -- (0,3.7) node[above] {$y$};
\draw[acc, very thick] plot[smooth, domain=-2.5:1.65] (\x, {pow(3,\x)}) node[right] {$3^x$};
\draw[acc, very thick] plot[smooth, domain=-2.5:1.85] (\x, {pow(2,\x)}) node[right] {$2^x$};
\draw[acc, very thick, densely dashed] plot[smooth, domain=-1.85:2.5] (\x, {pow(0.5,\x)}) node[above left] {$2^{-x}$};
\fill[black] (0,1) circle (2pt) node[anchor=north east] {$(0,\,1)$};
\draw[black, dotted] (-2.6,0) -- (2.7,0);
\end{tikzpicture}
$$

### The number e and the derivative of the exponential

Differentiating $b^x$ from the definition exposes a constant that depends only
on the base:
$$
f'(x) = \lim_{h \to 0} \frac{b^{x+h} - b^x}{h}
= b^x \lim_{h \to 0} \frac{b^h - 1}{h}
= f'(0)\, b^x.
$$
The rate of change of an exponential is proportional to its own value, with
proportionality constant $f'(0)$, the slope at the $y$-intercept. Numerically
$f'(0) \approx 0.69$ for $b = 2$ and $\approx 1.10$ for $b = 3$, so some base
between $2$ and $3$ gives slope exactly $1$. That base is the number $e$.

> **Definition (The number e).** $e$ is the base for which
> $$
> \lim_{h \to 0} \frac{e^h - 1}{h} = 1,
> $$
> equivalently the base whose graph $y = e^x$ crosses the $y$-axis with slope
> $1$. To twenty places, $e \approx 2.71828182845904523536$, and $e$ is
> irrational.

With $f'(0) = 1$, the proportionality formula collapses to the defining property
of the natural exponential function: it is its own derivative.

> **Theorem (Derivative of $e^x$).**
> $$
> \frac{\d}{\d x}\, e^x = e^x,
> \qquad\text{and with the chain rule,}\qquad
> \frac{\d}{\d x}\, e^{u} = e^{u}\,\frac{\d u}{\d x}.
> $$

The slope of the tangent to $y = e^x$ at any point equals the height of the
curve there. No other elementary function reproduces itself under
differentiation, which is why $e$ rather than $10$ or $2$ is the natural base
for calculus.

$$
% caption: For y = e^x the slope of the tangent at each point equals the
% y-coordinate at that point; here the tangent at (1, e) has slope e.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-2.3,0) -- (2.3,0) node[right] {$x$};
\draw[->, black] (0,-0.3) -- (0,4.4) node[above] {$y$};
\draw[acc, very thick] plot[smooth, domain=-2.2:1.45] (\x, {pow(2.71828,\x)}) node[above left] {$y=e^x$};
% point (1, e); e ~ 2.718
\fill[black] (1,2.718) circle (2pt);
\node[anchor=west] at (1.05,2.55) {$(1,\,e)$};
% tangent line at (1,e): slope e, y = e*x
\draw[black, thick] (0.1,{2.718*0.1}) -- (1.55,{2.718*1.55});
\node[black, anchor=north west] at (1.35,{2.718*1.35}) {slope $=e$};
\end{tikzpicture}
$$

For example, $\dfrac{\d}{\d x}\, e^{\tan x} = e^{\tan x}\sec^2 x$ by the chain rule,
and the product rule gives
$\dfrac{\d}{\d x}\bigl(e^{-4x}\sin 5x\bigr) = e^{-4x}(5\cos 5x - 4\sin 5x)$. The
integral counterpart is $\displaystyle\int e^x\,\d x = e^x + C$.

## Logarithmic functions

Since $b^x$ is one-to-one for $b \neq 1$, it has an inverse, the **logarithm to
base $b$**.

> **Definition (Logarithm).** For $b > 0$, $b \neq 1$,
> $$
> \log_b x = y \iff b^y = x.
> $$
> Thus $\log_b x$ is the exponent to which $b$ must be raised to produce $x$.

The cancellation equations become
$$
\log_b(b^x) = x \ \text{ for all } x \in \mathbb{R},
\qquad
b^{\log_b x} = x \ \text{ for all } x > 0.
$$
As the inverse of the exponential, $\log_b$ has domain $(0, \infty)$, range
$\mathbb{R}$, and a graph obtained by reflecting $y = b^x$ across $y = x$. Every
logarithmic graph passes through $(1, 0)$ because $\log_b 1 = 0$. The rapid
growth of $b^x$ reflects into the very slow growth of $\log_b x$. The properties
of exponents transpose into the properties of logarithms.

> **Theorem (Laws of logarithms).** For $b > 1$, $\log_b$ is one-to-one,
> continuous, and increasing on $(0, \infty)$ with range $\mathbb{R}$. For
> $x, y > 0$ and any real $r$:
> $$
> \log_b(xy) = \log_b x + \log_b y, \quad
> \log_b\!\left(\tfrac{x}{y}\right) = \log_b x - \log_b y, \quad
> \log_b(x^r) = r\log_b x.
> $$

The vertical asymptote of the logarithm is the reflected image of the
exponential's horizontal asymptote:
$$
\lim_{x \to \infty} \log_b x = \infty,
\qquad
\lim_{x \to 0^+} \log_b x = -\infty
\qquad (b > 1).
$$

### The natural logarithm

The most convenient base is $e$; its logarithm gets the special notation
$\ln x = \log_e x$, the **natural logarithm**. The defining relations and
cancellation equations specialize to
$$
\ln x = y \iff e^y = x,
\qquad
\ln(e^x) = x,
\qquad
e^{\ln x} = x,
\qquad
\ln e = 1.
$$
These two cancellation identities solve equations with an unknown in the
exponent.

> **Worked example.** Solve $e^{5 - 3x} = 10$ for $x$.
>
> The unknown sits in the exponent, so apply the inverse of $e^{(\cdot)}$: take
> $\ln$ of both sides and use $\ln(e^{5 - 3x}) = 5 - 3x$.
>
> $$
> 5 - 3x = \ln 10
> \qquad\Longrightarrow\qquad
> x = \tfrac{1}{3}(5 - \ln 10) \approx 0.8991.
> $$

Any logarithm can be rewritten in terms of $\ln$, which is why calculators need
only one logarithm key.

> **Theorem (Change of base).** For any base $b > 0$, $b \neq 1$,
> $$
> \log_b x = \frac{\ln x}{\ln b}.
> $$

The proof is one line: if $y = \log_b x$ then $b^y = x$; taking $\ln$ gives
$y \ln b = \ln x$, so $y = \ln x / \ln b$. As an application,
$\log_8 5 = \ln 5 / \ln 8 \approx 0.773976$.

$$
% caption: The natural exponential and natural logarithm are inverses, so their
% graphs mirror across y = x. Because e^x has slope 1 at (0,1), ln x has slope 1
% at (1,0).
\begin{tikzpicture}[scale=0.95, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-2.6,0) -- (3.4,0) node[right] {$x$};
\draw[->, black] (0,-2.6) -- (0,3.4) node[above] {$y$};
\draw[black, dashed] (-2.4,-2.4) -- (3.2,3.2) node[right, black] {$y=x$};
\draw[acc, very thick] plot[smooth, domain=-2.4:1.2] (\x, {pow(2.71828,\x)}) node[above] {$y=e^x$};
\draw[acc, very thick, densely dashed] plot[smooth, domain=0.09:3.2] (\x, {ln(\x)}) node[right] {$y=\ln x$};
\fill[black] (0,1) circle (1.8pt);
\fill[black] (1,0) circle (1.8pt);
\end{tikzpicture}
$$

## Derivatives of logarithms

The natural logarithm is differentiable because it inverts the differentiable
function $e^x$. Writing $y = \ln x$, so $e^y = x$, and differentiating
implicitly gives $e^y\,\d y/\d x = 1$, hence $\d y/\d x = 1/e^y = 1/x$.

> **Theorem (Derivative of $\ln$).**
> $$
> \frac{\d}{\d x}\,\ln x = \frac{1}{x},
> \qquad
> \frac{\d}{\d x}\,\ln u = \frac{1}{u}\,\frac{\d u}{\d x} = \frac{u'}{u}.
> $$

The chain-rule form is the one used in practice. For $y = \ln(x^3 + 1)$,
$$
\frac{\d y}{\d x} = \frac{1}{x^3 + 1}\cdot 3x^2 = \frac{3x^2}{x^3 + 1},
$$
and $\dfrac{\d}{\d x}\ln(\sin x) = \dfrac{\cos x}{\sin x} = \cot x$. Extending to
absolute values gives a formula valid on both sides of the origin,
$$
\frac{\d}{\d x}\ln|x| = \frac{1}{x},
\qquad\text{whose integral form}\qquad
\int \frac{1}{x}\,\d x = \ln|x| + C
$$
fills the one gap in the power rule for antiderivatives: $\int x^n\,\d x$ gives
$x^{n+1}/(n+1)$ except when $n = -1$, and that missing case is supplied by the
logarithm. As one consequence, $\int \tan x\,\d x = \ln|\sec x| + C$, found by
substituting $u = \cos x$.

The general and base-$b$ formulas follow from $\ln$ through change of base and
the identity $e^{\ln b} = b$.

| Function | Derivative | Source |
| --- | --- | --- |
| $e^x$ | $e^x$ | defining property |
| $b^x$ | $b^x \ln b$ | $b^x = e^{(\ln b)x}$ |
| $\ln x$ | $1/x$ | inverse of $e^x$ |
| $\log_b x$ | $1/(x \ln b)$ | change of base |

The base-$b$ exponential derivative comes from rewriting $b^x = e^{(\ln b)x}$
and applying the chain rule:
$$
\frac{\d}{\d x}\,b^x = \frac{\d}{\d x}\,e^{(\ln b)x} = e^{(\ln b)x}\cdot \ln b
= b^x \ln b.
$$
The base-$b$ logarithm derivative is $\dfrac{\d}{\d x}\log_b x = \dfrac{1}{x \ln b}$,
smallest and simplest when $b = e$ so that $\ln b = 1$. That simplicity is the
reason calculus prefers natural logarithms.

## Logarithmic differentiation

Products, quotients, and powers stacked together are painful to differentiate
directly, but taking a logarithm first turns them into sums and differences. The
technique is **logarithmic differentiation**.

> **Logarithmic differentiation.** To differentiate $y = f(x)$: take $\ln$ of
> both sides and simplify with the laws of logarithms; differentiate implicitly;
> solve for $y'$; substitute the expression for $y$.

> **Worked example.** Differentiate $y = \dfrac{x^{3/4}\sqrt{x^2 + 1}}{(3x + 2)^5}$.
>
> Taking logarithms separates the three factors into a sum:
>
> $$
> \ln y = \tfrac{3}{4}\ln x + \tfrac{1}{2}\ln(x^2 + 1) - 5\ln(3x + 2).
> $$
>
> Differentiate implicitly, one term at a time:
>
> $$
> \frac{y'}{y} = \frac{3}{4x} + \frac{x}{x^2 + 1} - \frac{15}{3x + 2}.
> $$
>
> Multiplying by $y$ gives the derivative without a single application of the
> quotient rule:
>
> $$
> y' = \frac{x^{3/4}\sqrt{x^2 + 1}}{(3x + 2)^5}
> \left(\frac{3}{4x} + \frac{x}{x^2 + 1} - \frac{15}{3x + 2}\right).
> $$

The same device proves the **power rule** for an arbitrary real exponent. Let
$y = x^n$ with $x \neq 0$; then $\ln|y| = n\ln|x|$, so $y'/y = n/x$ and
$y' = n\,y/x = n x^{n-1}$. Functions of the form $[g(x)]^{h(x)}$, where both base
and exponent vary, need the same treatment or the equivalent rewrite
$e^{h(x)\ln g(x)}$; neither the power rule nor the exponential rule applies on
its own.

> **Worked example.** Differentiate $y = x^{\sqrt{x}}$ for $x > 0$.
>
> Both base and exponent hold the variable, so neither $\dfrac{\d}{\d x}x^n$ nor
> $\dfrac{\d}{\d x}b^x$ applies. Take $\ln$ of both sides:
>
> $$
> \ln y = \sqrt{x}\,\ln x.
> $$
>
> Differentiate implicitly, using the product rule on the right:
>
> $$
> \frac{y'}{y} = \frac{1}{2\sqrt{x}}\,\ln x + \sqrt{x}\cdot\frac{1}{x}
> = \frac{\ln x}{2\sqrt{x}} + \frac{1}{\sqrt{x}}.
> $$
>
> Solving for $y'$ and restoring $y = x^{\sqrt{x}}$,
>
> $$
> y' = x^{\sqrt{x}}\left(\frac{\ln x + 2}{2\sqrt{x}}\right).
> $$

## The number e as a limit

The derivative $\ln'(1) = 1$ can be unwound into a limit formula for $e$ itself.
From the definition of the derivative at $x = 1$,
$$
1 = \ln'(1) = \lim_{x \to 0}\frac{\ln(1 + x) - \ln 1}{x}
= \lim_{x \to 0}\ln(1 + x)^{1/x}.
$$
By continuity of the exponential, exponentiating both sides gives
$$
e = \lim_{x \to 0}(1 + x)^{1/x},
\qquad\text{equivalently}\qquad
e = \lim_{n \to \infty}\left(1 + \frac{1}{n}\right)^{n}.
$$
The second form, with $n = 1/x$, is the expression that reappears in
[continuously compounded growth](/calculus/exponential-logarithmic-and-inverse-functions/growth-decay-inverse-trig-and-hyperbolic-functions):
letting the compounding interval shrink to zero drives the accumulation factor
to $e$.
