Inverse functions

An inverse function reverses, or undoes, what a function does. On this page we look at what an inverse function is, which functions have inverses, how to find an inverse and its domain and range, and how the graph of an inverse is related to the graph of the original function.

Inverse of a function

The inverse of a function is found by switching the roles of $x$ and $y$. If a function pairs each input $x$ with an output $y$, then its inverse pairs that $y$ back with $x$. The inverse of $f$ is written $f^{-1}$.

Be careful: the notation $f^{-1}(x)$ does not mean $\dfrac{1}{f(x)}$.

Example: The function $f(x)=4x-2$ produces the ordered pairs on the left. Switching $x$ and $y$ in each pair gives the inverse function on the right.

$f$ $f^{-1}$
$x$$y$$x$$y$
$-1$$-6$$-6$$-1$
$0$$-2$$-2$$0$
$1$$2$$2$$1$
$2$$6$$6$$2$

One-to-one functions

Not every function has an inverse. Only a one-to-one function has an inverse. A function is one-to-one if each $x$ value corresponds to a different $y$ value — that is, no two different inputs give the same output.

For example, $f=\{(2,4),(6,-5),(7,1),(11,25)\}$ is one-to-one, because every $y$ value is different. But $g=\{(2,4),(6,-5),(7,4)\}$ is not one-to-one, because two different inputs, $2$ and $7$, give the same output, $4$.

Horizontal line test

For a graph, we use the horizontal line test: if no horizontal line crosses the graph more than once, then the graph represents a one-to-one function.

xyone-to-one xynot one-to-one

The increasing curve on the left is one-to-one — every horizontal line meets it at just one point. The parabola on the right is not one-to-one, because a horizontal line can meet it at two points.

Finding the inverse of a function

To find the inverse of a one-to-one function, follow these steps:

1. Replace $f(x)$ with $y$.
2. Switch $x$ and $y$.
3. Solve for $y$.
4. The result is the inverse function, $f^{-1}(x)$.

For a function given as a set of ordered pairs, just switch the two numbers in each pair.

Example 1: Find the inverse of $f=\{(2,8),(-3,0),(5,-5),(8,-4)\}$.

Solution: Every $y$ value is different, so $f$ is one-to-one and has an inverse. Switch the numbers in each ordered pair:

$f^{-1}=\{(8,2),(0,-3),(-5,5),(-4,8)\}$

Example 2: Find the inverse of $h=\{(0,-1),(2,6),(-3,-2),(-6,6)\}$.

Solution: The $y$ value $6$ appears twice (from $x=2$ and $x=-6$), so $h$ is not one-to-one. Therefore $h$ has no inverse.

Example 3: Find the inverse of $f(x)=5x+4$.

Solution: A linear function is one-to-one. Replace $f(x)$ with $y$, switch $x$ and $y$, then solve for $y$:

$\begin{align*}y&=5x+4\\x&=5y+4\\x-4&=5y\\y&=\dfrac{x-4}{5}\end{align*}$

So $f^{-1}(x)=\dfrac{x-4}{5}$.

Example 4: Find the inverse of $f(x)=2x^2-8$.

Solution: This is a quadratic function, which is not one-to-one (for example, $x=2$ and $x=-2$ both give $y=0$). Therefore it has no inverse.

Example 5: Find the inverse of $f(x)=x^3+10$.

Solution: A cubic function is one-to-one. Replace $f(x)$ with $y$, switch $x$ and $y$, then solve for $y$:

$\begin{align*}y&=x^3+10\\x&=y^3+10\\x-10&=y^3\\y&=\sqrt[3]{x-10}\end{align*}$

So $f^{-1}(x)=\sqrt[3]{x-10}$.

Example 6: Find the inverse of the one-to-one function $g(x)=\dfrac{3x-5}{8x+9}$.

Solution: Replace $g(x)$ with $y$ and switch $x$ and $y$:

$x=\dfrac{3y-5}{8y+9}$

Multiply both sides by $8y+9$ and solve for $y$:

$\begin{align*}x(8y+9)&=3y-5\\8xy+9x&=3y-5\\8xy-3y&=-9x-5\\y(8x-3)&=-9x-5\\y&=\dfrac{-9x-5}{8x-3}\end{align*}$

So $g^{-1}(x)=\dfrac{-9x-5}{8x-3}$.

Domain and range of an inverse function

Because an inverse switches inputs and outputs, the domain of $f^{-1}$ is the range of $f$, and the range of $f^{-1}$ is the domain of $f$.

Example: Find the inverse of $f(x)=\sqrt{x+6}$, and give the domain of the inverse.

Solution: The function is one-to-one. Replace $f(x)$ with $y$, switch $x$ and $y$, then solve for $y$:

$\begin{align*}y&=\sqrt{x+6}\\x&=\sqrt{y+6}\\x^2&=y+6\\y&=x^2-6\end{align*}$

So $f^{-1}(x)=x^2-6$.

The domain of $f^{-1}$ is the range of $f$. Since a square root is never negative, the range of $f$ is $[0,\infty)$. Therefore the domain of $f^{-1}$ is $[0,\infty)$.

Graph of an inverse function

The graph of $f^{-1}$ is the mirror image of the graph of $f$ across the line $y=x$. To draw the inverse of a graph, reflect each point across $y=x$ — that is, switch its $x$ and $y$ coordinates.

xyff⁻¹y = x

Example: A one-to-one function passes through the points $(-1,2)$ and $(4,-2)$. Find two points on its inverse.

Solution: Switch the $x$ and $y$ coordinates of each point. The inverse passes through

$(2,-1)$   and   $(-2,4)$.