Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find the Inverse of a Function

The inverse f−1f^{-1} undoes ff: it sends each output back to the input that produced it. Algebraically you swap the roles of xx and yy and solve for the new yy.

Recognize the task

The question asks for f−1(x)f^{-1}(x), "the inverse", or the input that gives a certain output. Typical forms: linear 3x−73x - 7, a power plus a constant x3+2x^3 + 2, a rational 2x+1x−3\frac{2x + 1}{x - 3}, a quadratic on half its domain. Test: does every horizontal line cross the graph at most once? If not, restrict the domain first.
Inverses are defined in the inverse functions lesson.

Ways to do it

Swap and solveusual
y=f(x)  →  x=f(y)  →  y=f−1(x)y = f(x) \;\to\; x = f(y) \;\to\; y = f^{-1}(x)
Works for any one-to-one formula (finding the inverse algebraically).
Undo in reverse orderone x
f:×3, −7⇒f−1:+7, ÷3f: \times 3,\ -7 \quad\Rightarrow\quad f^{-1}: +7,\ \div 3
When xx appears once, list the operations on it and undo them from last to first.
Reflect the graphgraph
(a,b)∈f  ⟺  (b,a)∈f−1(a, b) \in f \iff (b, a) \in f^{-1}
Mirror the graph in the line y=xy = x (inverse as reflection).

Steps

StepOn f(x)=2x+1x−3f(x) = \dfrac{2x + 1}{x - 3}
1Check that f is one-to-one. Use the horizontal line test, or rewrite the formula so xx appears once.f(x)=2+7x−3f(x) = 2 + \frac{7}{x - 3} ✓
2Write y = f(x) and swap x and y. The swap records that the inverse exchanges inputs and outputs.x=2y+1y−3x = \dfrac{2y + 1}{y - 3}
3Solve for y. Clear the fraction, collect the yy-terms on one side, and factor yy out.xy−3x=2y+1⇒y(x−2)=3x+1xy - 3x = 2y + 1 \Rightarrow y(x - 2) = 3x + 1
4Write the inverse with its domain. The domain of the inverse is the range of ff.f−1(x)=3x+1x−2f^{-1}(x) = \dfrac{3x + 1}{x - 2}, x≠2x \neq 2
5Check one point. Send a number through ff and back through f−1f^{-1}.f(4)=9f(4) = 9, f−1(9)=287=4f^{-1}(9) = \frac{28}{7} = 4 ✓

Worked examples

Example 1 · a linear function

swap and solve
y=3x−7→x=3y−7y = 3x - 7 \to x = 3y - 7
swap xx and yy
x+7=3yx + 7 = 3y
add 77
f−1(x)=x+73f^{-1}(x) = \dfrac{x + 7}{3}
divide by 33

Example 2 · a cube plus a constant

odd power
y=x3+2→x=y3+2y = x^3 + 2 \to x = y^3 + 2
cubes pass the line test
y3=x−2y^3 = x - 2
isolate the power
f−1(x)=x−23f^{-1}(x) = \sqrt[3]{x - 2}
cube root, any real xx

Example 3 · a quadratic on half its domain

restricted
f(x)=(x−1)2f(x) = (x - 1)^2, x≥1x \geq 1
right half is one-to-one
x=(y−1)2⇒y−1=±xx = (y - 1)^2 \Rightarrow y - 1 = \pm\sqrt{x}
swap, take roots
y≥1y \geq 1, so take the ++ sign
outputs of f−1f^{-1} are inputs of ff
f−1(x)=1+xf^{-1}(x) = 1 + \sqrt{x}, x≥0x \geq 0
check: f(3)=4f(3) = 4, f−1(4)=3f^{-1}(4) = 3
See a function and its mirror image side by side in the inverse function visualizer.

See it happen

Swapping xx and yy swaps the coordinates of every point, and swapping coordinates is the same as reflecting in the line y=xy = x. That is why the graph of f−1f^{-1} is the mirror image of the graph of ff. A horizontal line crossing ff twice would become a vertical line crossing the mirror image twice, so the mirror image would fail to be a function. Hence the one-to-one check comes first.

Common mistakes

Undoing the steps in the original order

✗ f(x)=3x−7⇒f−1(x)=x3+7f(x) = 3x - 7 \Rightarrow f^{-1}(x) = \frac{x}{3} + 7
✓ undo the last step first: f−1(x)=x+73f^{-1}(x) = \frac{x + 7}{3}

Reading the inverse as a reciprocal

✗ f−1(x)=13x−7f^{-1}(x) = \dfrac{1}{3x - 7}
✓ f−1(x)=x+73f^{-1}(x) = \frac{x + 7}{3}; the −1-1 is not an exponent here

Inverting a function that is not one-to-one

✗ f(x)=x2⇒f−1(x)=±xf(x) = x^2 \Rightarrow f^{-1}(x) = \pm\sqrt{x}
✓ restrict to [0,∞)[0, \infty) first: f−1(x)=xf^{-1}(x) = \sqrt{x}

Taking the positive root on the left branch

✗ f(x)=x2f(x) = x^2 on (−∞,0](-\infty, 0]: f−1(x)=xf^{-1}(x) = \sqrt{x}
✓ f−1(x)=−xf^{-1}(x) = -\sqrt{x}, since f(−2)=4f(-2) = 4 must return −2-2
See restricting the domain in the lesson.