# Inverse function rule

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 calculus, the inverse function rule is a formula that expresses the derivative of the inverse of a bijective and differentiable function f in terms of the derivative of f. More precisely, if the inverse of ${\displaystyle f}$ is denoted as ${\displaystyle f^{-1}}$, where ${\displaystyle f^{-1}(y)=x}$ if and only if ${\displaystyle f(x)=y}$, then the inverse function rule is, in Lagrange's notation,

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

This formula holds in general whenever ${\displaystyle f}$ is continuous and injective on an interval I, with ${\displaystyle f}$ being differentiable at ${\displaystyle f^{-1}(a)}$(${\displaystyle \in I}$) and where${\displaystyle f'(f^{-1}(a))\neq 0}$. The same formula is also 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 }$ denotes function composition.

Geometrically, a function and inverse function have graphs that are reflections, in the line ${\displaystyle y=x}$. This reflection operation turns the gradient of any line into its reciprocal.[1]

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.

The inverse function rule may also be expressed in Leibniz's notation. As that notation suggests,

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

This relation is obtained by differentiating the equation ${\displaystyle f^{-1}(y)=x}$ in terms of x and applying the chain rule, yielding that:

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

considering that the derivative of x with respect to x is 1.

## Derivation

Let ${\displaystyle f}$ be an invertible (bijective) function, let ${\displaystyle x}$ be in the domain of ${\displaystyle f}$, and let ${\displaystyle y}$ be in the codomain of ${\displaystyle f}$.

This also means that ${\displaystyle y}$ is in the domain of ${\displaystyle f^{-1}}$, and that ${\displaystyle x}$ is in the codomain of ${\displaystyle f^{-1}}$.

(Sidenote: since f is a bijective function, ${\displaystyle y}$ being in the codomain of the function, ${\displaystyle f}$, it means that ${\displaystyle y}$ is in the range of the function, ${\displaystyle f}$.)

Since ${\displaystyle f}$ is an invertible function, we know that: ${\displaystyle f(f^{-1}(y))=y}$ and ${\displaystyle f^{-1}(f(x))=x}$

Which equation should be used for the derivation? Technically speaking, since ${\displaystyle f}$ and ${\displaystyle f^{-1}}$ are inverses, either one will work, and you can do some careful manipulation of swapping the instances of ${\displaystyle f}$ and ${\displaystyle f^{-1}}$, however, that may cause confusion. So, which equation should be used?

Taking a look at both equations, it looks like, in order to do anything useful, we would have to differentiate both sides of the chosen equation. Due to the fact that there are nested functions, the chain rule will also be in use. We want our final formula to give the derivative of the inverse function, with respect to the input to the inverse function (${\displaystyle y}$), rather than with respect to another function. So, thinking about how the chain rule works, we know that we will have to multiply by the derivative of the "inside". If we use the first equation (${\displaystyle f(f^{-1}(y))=y}$), the "inside" function will be ${\displaystyle f^{-1}(y)}$, and according to the chain rule, we would get ${\displaystyle (f^{-1})^{\prime }(y)}$ not nested within any other function. That being said, let's start.

{\displaystyle {\begin{aligned}&&f(f^{-1}(y))&=y\\{\text{Differentiating both sides with respect to }}y&&\\&\implies &{\dfrac {\mathrm {d} }{\mathrm {d} y}}f(f^{-1}(y))&={\dfrac {\mathrm {d} }{\mathrm {d} y}}y\\{\text{Using the chain rule on the left side}}&&&\\&\iff &{\dfrac {\mathrm {d} \left(f(f^{-1}(y))\right)}{\mathrm {d} \left(f^{-1}(y)\right)}}{\dfrac {\mathrm {d} \left(f^{-1}(y)\right)}{\mathrm {d} y}}&={\dfrac {\mathrm {d} y}{\mathrm {d} y}}\\&\iff &{\dfrac {\mathrm {d} f(f^{-1}(y))}{\mathrm {d} f^{-1}(y)}}{\dfrac {\mathrm {d} f^{-1}(y)}{\mathrm {d} y}}&={\dfrac {\mathrm {d} y}{\mathrm {d} y}}\\&\iff &f^{\prime }\left(f^{-1}(y))\right)(f^{-1})^{\prime }(y)&=1\\{\text{Dividing both sides by }}f^{\prime }\left(f^{-1}(y))\right)&&&\\&\implies &(f^{-1})^{\prime }(y)&={\frac {1}{f^{\prime }\left(f^{-1}(y))\right)}}\end{aligned}}}

Great! Rather than using ${\displaystyle a}$ as the variable, we can rewrite this equation using ${\displaystyle a}$ as the input for ${\displaystyle f^{-1}}$, and we get the following:[2]

${\displaystyle (f^{-1})^{\prime }(a)={\frac {1}{f^{\prime }\left(f^{-1}(a))\right)}}}$

## Examples

• ${\displaystyle y=x^{2}}$ (for positive 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 ${\displaystyle 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 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}$

${\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.
• Another very interesting and useful property is the following:
${\displaystyle \int f^{-1}(x)\,{dx}=xf^{-1}(x)-F(f^{-1}(x))+C}$
Where ${\displaystyle F}$ denotes the antiderivative of ${\displaystyle f}$.
• The inverse of the derivative of f(x) is also of interest, as it is used in showing the convexity of the Legendre transform.

Let ${\displaystyle z=f'(x)}$ then we have, assuming ${\displaystyle f''(x)\neq 0}$:

${\displaystyle {\frac {d(f')^{-1}(z)}{dz}}={\frac {1}{f''(x)}}}$
This can be shown using the previous notation ${\displaystyle y=f(x)}$. Then we have:

${\displaystyle f'(x)={\frac {dy}{dx}}={\frac {dy}{dz}}{\frac {dz}{dx}}={\frac {dy}{dz}}f''(x)\Rightarrow {\frac {dy}{dz}}={\frac {f'(x)}{f''(x)}}}$
Therefore:

${\displaystyle {\frac {d(f')^{-1}(z)}{dz}}={\frac {dx}{dz}}={\frac {dy}{dz}}{\frac {dx}{dy}}={\frac {f'(x)}{f''(x)}}{\frac {1}{f'(x)}}={\frac {1}{f''(x)}}}$

By induction, we can generalize this result for any integer ${\displaystyle n\geq 1}$, with ${\displaystyle z=f^{(n)}(x)}$, the nth derivative of f(x), and ${\displaystyle y=f^{(n-1)}(x)}$, assuming ${\displaystyle f^{(i)}(x)\neq 0{\text{ for }}0:

${\displaystyle {\frac {d(f^{(n)})^{-1}(z)}{dz}}={\frac {1}{f^{(n+1)}(x)}}}$

## Higher derivatives

The chain rule given above is obtained by differentiating the identity ${\displaystyle f^{-1}(f(x))=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.