Part 30 of 36 · TransformationsSee the whole course

Inverse functions: how to find and graph them

Short answer

The inverse of a function f, written f⁻¹, undoes f: if f turns 3 into 7, then f⁻¹ turns 7 back into 3. To find it, write y = f(x), swap x and y, then solve for y. The graph of f⁻¹ is the mirror image of the graph of f across the line y = x.

What “undo” means

A function is a machine: you put a number in and a number comes out. (See what is a function if that is new.) Take f(x) = 2x + 1. Put in 3 and you get f(3) = 7.

The inverse is the machine that runs backwards. Put 7 in, and out comes 3. The steps of f were “double, then add 1”. To undo them, work in reverse order and flip each step: “subtract 1, then halve”. So f⁻¹(x) = (x − 1) ÷ 2, and f⁻¹(7) = (7 − 1) ÷ 2 = 3 ✓. This is the same backwards thinking as in solving a linear equation.

Careful: the small −1 in f⁻¹ is a name, not an exponent. f⁻¹(x) does not mean 1 ÷ f(x).

The three steps

  1. Write y = f(x).
  2. Swap x and y. This is the “undo”: the old output becomes the new input.
  3. Solve for y. What you get is f⁻¹(x).

Try it. Change a and b, then move the point P along the blue graph and watch its mirror image Q move along the orange one.

f(x) = 2x + 1
  1. y = 2x + 1
  2. swap x and y: x = 2y + 1
  3. solve for y: f⁻¹(x) = (1/2)x − 1/2
f(3) = 7, so f⁻¹(7) = 3. The point (3, 7) mirrors to (7, 3).

Why the graph is a mirror image

Swapping x and y swaps the two numbers in every point: (3, 7) on f becomes (7, 3) on f⁻¹. Swapping the two numbers of a point is exactly a reflection across the line y = x, the diagonal that runs through (1, 1), (2, 2), (3, 3). So fold the picture along that diagonal, and the graph of f lands on the graph of f⁻¹. (Reflections are covered in reflecting a graph over the axes. This one uses a slanted mirror.)

Example 1: f(x) = 2x + 1

Write: y = 2x + 1
Swap: x = 2y + 1
Solve for y: x − 1 = 2y, so y = (x − 1) ÷ 2
So f⁻¹(x) = (x − 1) ÷ 2
Check: f(3) = 7, and f⁻¹(7) = (7 − 1) ÷ 2 = 3 ✓

Example 2: f(x) = 3x − 6

Swap: x = 3y − 6
Add 6: x + 6 = 3y
Divide by 3: f⁻¹(x) = (x + 6) ÷ 3, which is x ÷ 3 + 2
Check: f(2) = 0, and f⁻¹(0) = 6 ÷ 3 = 2 ✓

Example 3: a function that is its own inverse, f(x) = 4 − x

Swap: x = 4 − y
Solve for y: y = 4 − x
The inverse is the same function. Its graph has slope −1, and a line with slope −1 is already symmetric about y = x. Put 1 in: f(1) = 3, and f(3) = 1 takes it back.

Which functions have an inverse?

An inverse must give one answer for each input, because it is a function too. That only works if f never gives the same output twice. Look at the graph: if a horizontal line can cut it in two places, there is no inverse. This is the horizontal line test.

Domain and range swap too: the inputs of f are the outputs of f⁻¹ (see domain and range).

Watch it explained in under a minute

The same idea, narrated step by step. Square version for sharing: download the 1:1 video.
Read the video transcript

This function turns 3 into 7. f(3) = 7. Its inverse undoes it: 7 goes back to 3.

The two points are mirror images. The mirror is the line y = x. Flip the whole graph over it, and you get the inverse.

To find its formula, swap x and y. x = 2y + 1. Now solve for y. y = (x − 1) over 2.

Check it. Put 7 in. (7 − 1) over 2, is 3. It works.

Want practice questions and more examples? Full guide: pipmath.app/blog

The five mistakes to avoid

Try it yourself

Find the inverse of each function. Tap a question to see the answer.

1. f(x) = x + 5

Swap: x = y + 5, so y = x − 5. f⁻¹(x) = x − 5. Check: f(2) = 7, and f⁻¹(7) = 2 ✓.

2. f(x) = 4x − 8

Swap: x = 4y − 8. Add 8: x + 8 = 4y. Divide by 4: f⁻¹(x) = (x + 8) ÷ 4, which is x ÷ 4 + 2. Check: f(3) = 4, and f⁻¹(4) = 12 ÷ 4 = 3 ✓.

3. f(x) = (x − 2) ÷ 3

Swap: x = (y − 2) ÷ 3. Multiply by 3: 3x = y − 2. Add 2: f⁻¹(x) = 3x + 2. Check: f(5) = 1, and f⁻¹(1) = 5 ✓.

Where this fits in

That finishes the transformations part of the course: shifts, flips, stretches and now the mirror over y = x. Next comes a new family of functions, the parabola, starting with what a quadratic function is. You will meet the inverse idea again there, because undoing a square is a square root.

Quick answers

Questions about this topic

What is an inverse function?

An inverse function undoes the original. If f turns an input a into an output b, then the inverse f⁻¹ turns b back into a. Its graph is the mirror image of f across the line y = x.

How do you find the inverse of a function?

Write y = f(x), swap x and y, then solve for y. The result is f⁻¹(x). Check it by putting a number through f and then through f⁻¹: you should get the same number back.

Is f⁻¹(x) the same as 1 divided by f(x)?

No. The −1 in f⁻¹ is a name for the inverse, not an exponent. 1 ÷ f(x) is the reciprocal, which is a different function.

Which functions have an inverse?

A function has an inverse when it never gives the same output twice, which is the horizontal line test. Lines that are not flat pass. y = x² fails, but if you only use x ≥ 0 its inverse is the square root.

Keep going

Learn it by playing

Pip: Math Adventure is a math game for iPhone where functions, lines, equations and calculus are puzzles you solve by playing. It is coming soon to the App Store.

Join the list and we will tell you the day Pip is out.