# Inverse functions and differentiation

Rule:
${\displaystyle {\color {CornflowerBlue}{f'}}(x)={\frac {1}{{\color {Salmon}{(f^{-1})'}}({\color {Blue}{f}}(x))}}}$

Example for arbitrary ${\displaystyle x_{0}\approx 5.8}$:
${\displaystyle {\color {CornflowerBlue}{f'}}(x_{0})={\frac {1}{4}}}$
${\displaystyle {\color {Salmon}{(f^{-1})'}}({\color {Blue}{f}}(x_{0}))=4~}$

In mathematics, the inverse of a function ${\displaystyle y=f(x)}$ is a function that, in some fashion, "undoes" the effect of ${\displaystyle f}$ (see inverse function for a formal and detailed definition). The inverse of ${\displaystyle f}$ is denoted ${\displaystyle f^{-1}}$. The statements y = f(x) and x = f −1(y) are equivalent.

Their two derivatives, assuming they exist, are reciprocal, as the Leibniz notation suggests; that is:

${\displaystyle {\frac {dx}{dy}}\,\cdot \,{\frac {dy}{dx}}=1.}$

This relation is obtained by differentiating ${\displaystyle f^{-1}(y)=x}$ and applying the chain rule

${\displaystyle {\frac {dx}{dy}}\,\cdot \,{\frac {dy}{dx}}={\frac {dx}{dx}}}$

considering the derivative of ${\displaystyle x}$ with respect to ${\displaystyle x}$ is 1.

Writing explicitly the dependence of ${\displaystyle y}$ on ${\displaystyle x}$ and the point at which the differentiation takes place and using Lagrange's notation, the formula for the derivative of the inverse becomes

${\displaystyle \left[f^{-1}\right]'(a)={\frac {1}{f'\left(f^{-1}(a)\right)}}}$.

This is equivalent to the expression

${\displaystyle {\mathcal {D}}\left[f^{-1}\right]={\frac {1}{({\mathcal {D}}f)\circ \left(f^{-1}\right)}},}$

where ${\displaystyle {\mathcal {D}}}$ denotes the unary derivative operator (on the space of functions) and ${\displaystyle \circ }$ denote the binary composition operator.

Geometrically, a function and inverse function have graphs that are reflections, in the line y = x. This reflection operation turns the gradient of any line into its reciprocal.

Assuming that ${\displaystyle f}$ has an inverse in a neighbourhood of ${\displaystyle x}$ and that its derivative at that point is non-zero, its inverse is guaranteed to be differentiable at ${\displaystyle x}$ and have a derivative given by the above formula.

## Examples

• ${\displaystyle \,y=x^{2}}$ (for positive ${\displaystyle x}$) has inverse ${\displaystyle x={\sqrt {y}}}$.
${\displaystyle {\frac {dy}{dx}}=2x{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }};{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }}{\frac {dx}{dy}}={\frac {1}{2{\sqrt {y}}}}={\frac {1}{2x}}}$
${\displaystyle {\frac {dy}{dx}}\,\cdot \,{\frac {dx}{dy}}=2x\cdot {\frac {1}{2x}}=1.}$

At x = 0, however, there is a problem: the graph of the square root function becomes vertical, corresponding to a horizontal tangent for the square function.

• ${\displaystyle \,y=e^{x}}$ (for real ${\displaystyle x}$) has inverse ${\displaystyle \,x=\ln {y}}$ (for positive ${\displaystyle y}$)
${\displaystyle {\frac {dy}{dx}}=e^{x}{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }};{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }}{\frac {dx}{dy}}={\frac {1}{y}}}$
${\displaystyle {\frac {dy}{dx}}\,\cdot \,{\frac {dx}{dy}}=e^{x}\cdot {\frac {1}{y}}={\frac {e^{x}}{e^{x}}}=1}$

• Integrating this relationship gives
${\displaystyle {f^{-1}}(x)=\int {\frac {1}{f'({f^{-1}}(x))}}\,{dx}+c.}$
This is only useful if the integral exists. In particular we need ${\displaystyle f'(x)}$ to be non-zero across the range of integration.
It follows that a function that has a continuous derivative has an inverse in a neighbourhood of every point where the derivative is non-zero. This need not be true if the derivative is not continuous.

## Higher derivatives

The chain rule given above is obtained by differentiating the identity x = f −1(f(x)) with respect to x. One can continue the same process for higher derivatives. Differentiating the identity twice with respect to x , one obtains

${\displaystyle {\frac {d^{2}y}{dx^{2}}}\,\cdot \,{\frac {dx}{dy}}+{\frac {d}{dx}}\left({\frac {dx}{dy}}\right)\,\cdot \,\left({\frac {dy}{dx}}\right)=0,}$

that is simplified further by the chain rule as

${\displaystyle {\frac {d^{2}y}{dx^{2}}}\,\cdot \,{\frac {dx}{dy}}+{\frac {d^{2}x}{dy^{2}}}\,\cdot \,\left({\frac {dy}{dx}}\right)^{2}=0.}$

Replacing the first derivative, using the identity obtained earlier, we get

${\displaystyle {\frac {d^{2}y}{dx^{2}}}=-{\frac {d^{2}x}{dy^{2}}}\,\cdot \,\left({\frac {dy}{dx}}\right)^{3}.}$

Similarly for the third derivative:

${\displaystyle {\frac {d^{3}y}{dx^{3}}}=-{\frac {d^{3}x}{dy^{3}}}\,\cdot \,\left({\frac {dy}{dx}}\right)^{4}-3{\frac {d^{2}x}{dy^{2}}}\,\cdot \,{\frac {d^{2}y}{dx^{2}}}\,\cdot \,\left({\frac {dy}{dx}}\right)^{2}}$

or using the formula for the second derivative,

${\displaystyle {\frac {d^{3}y}{dx^{3}}}=-{\frac {d^{3}x}{dy^{3}}}\,\cdot \,\left({\frac {dy}{dx}}\right)^{4}+3\left({\frac {d^{2}x}{dy^{2}}}\right)^{2}\,\cdot \,\left({\frac {dy}{dx}}\right)^{5}}$

These formulas are generalized by the Faà di Bruno's formula.

These formulas can also be written using Lagrange's notation. If f and g are inverses, then

${\displaystyle g''(x)={\frac {-f''(g(x))}{[f'(g(x))]^{3}}}}$

## Example

• ${\displaystyle \,y=e^{x}}$ has the inverse ${\displaystyle \,x=\ln y}$. Using the formula for the second derivative of the inverse function,
${\displaystyle {\frac {dy}{dx}}={\frac {d^{2}y}{dx^{2}}}=e^{x}=y{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }};{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }}\left({\frac {dy}{dx}}\right)^{3}=y^{3};}$

so that

${\displaystyle {\frac {d^{2}x}{dy^{2}}}\,\cdot \,y^{3}+y=0{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }};{\mbox{ }}{\mbox{ }}{\mbox{ }}{\mbox{ }}{\frac {d^{2}x}{dy^{2}}}=-{\frac {1}{y^{2}}}}$,

which agrees with the direct calculation.