Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 38 · Functions and Transformations

Inverse Functions

Learn what an inverse function undoes, how to test for one with the horizontal line test, how to find it algebraically and how its graph mirrors the original.

A function takes you from an input to an output. An inverse function takes you back. If f turns Celsius into Fahrenheit, its inverse turns Fahrenheit into Celsius. If f doubles a number and adds 3, the inverse subtracts 3 and halves.

The inverse of f is written f⁻¹. The small -1 is a label, not an exponent: f⁻¹(x) does not mean 1/f(x).

The defining property

f⁻¹ undoes f, and f undoes f⁻¹:

Text
f⁻¹(f(x)) = x    for every x in the domain of f
f(f⁻¹(x)) = x    for every x in the domain of f⁻¹

If f(3) = 7, then f⁻¹(7) = 3. Inputs and outputs swap roles. That means the domain of f⁻¹ is the range of f, and the range of f⁻¹ is the domain of f.

Which functions have an inverse?

For an inverse to be a function, each output of f must come from exactly one input. Such a function is called one-to-one. You can test it on a graph with the horizontal line test: if every horizontal line crosses the graph at most once, the function is one-to-one and has an inverse.

f(x) = 2x + 3 passes: it is a line with nonzero slope. g(x) = x² fails: the horizontal line y = 4 crosses at x = 2 and x = -2. But if we restrict the domain of g to x ≥ 0, the function becomes one-to-one, and its inverse is √x.

Finding an inverse algebraically

  1. Write y = f(x).
  2. Swap x and y.
  3. Solve for y.
  4. Write y = f⁻¹(x) and state its domain.

Example 1. Find the inverse of f(x) = 2x + 3. Write y = 2x + 3. Swap: x = 2y + 3. Solve: y = (x - 3)/2. So f⁻¹(x) = (x - 3)/2. Check: f(f⁻¹(x)) = 2·(x - 3)/2 + 3 = x.

Example 2. Find the inverse of f(x) = (x + 1)/(x - 2), with x ≠ 2. Swap: x = (y + 1)/(y - 2). Multiply: x(y - 2) = y + 1, so xy - 2x = y + 1. Collect y terms: xy - y = 2x + 1, so y(x - 1) = 2x + 1 and y = (2x + 1)/(x - 1). Domain: x ≠ 1, which matches the original range (this function never outputs 1).

Example 3. Find the inverse of f(x) = x² + 4 for x ≥ 0. Swap: x = y² + 4, so y² = x - 4 and y = ±√(x - 4). The original domain x ≥ 0 means the inverse's outputs must be non-negative, so take the positive root: f⁻¹(x) = √(x - 4) with x ≥ 4.

Python Verify an inverse numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Graphs of inverses

Because inputs and outputs swap, a point (a, b) on the graph of f becomes (b, a) on the graph of f⁻¹. Swapping coordinates reflects the plane across the line y = x. So the graph of an inverse is the mirror image of the original in the line y = x.

Python A function, its inverse and the mirror line

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

flowchart LR
    A["x = 2"] -- "f" --> B["f(2) = 7"]
    B -- "inverse of f" --> A

The inverse follows the arrow backward.

Restricting domains

Many useful functions are not one-to-one, but a sensible restriction fixes that. Squaring is invertible on x ≥ 0; absolute value is invertible on x ≥ 0; a parabola can be restricted to one side of its vertex. Calculators do this too: the square-root button gives only the positive root.

Do not confuse f⁻¹(x) with 1/f(x). For f(x) = 2x + 3, the inverse is (x - 3)/2, while the reciprocal is 1/(2x + 3). They are completely different functions.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. If f(5) = 12 and f has an inverse, what is f⁻¹(12)?

    The inverse swaps input and output, so f⁻¹(12) = 5.
  2. 2. What is the inverse of f(x) = 3x - 6?

    Swap: x = 3y - 6, so y = (x + 6)/3.
  3. 3. Which function fails the horizontal line test on all of its natural domain?

    A horizontal line such as y = 9 crosses x² at x = 3 and x = -3.
  4. 4. The graph of f⁻¹ is the graph of f reflected in

    Swapping (a, b) to (b, a) is a reflection in the line y = x.

Summary

  • f⁻¹ undoes f: f⁻¹(f(x)) = x and f(f⁻¹(x)) = x.
  • Only one-to-one functions have inverse functions; check with the horizontal line test.
  • To find an inverse: write y = f(x), swap x and y, solve for y.
  • The domain and range of f⁻¹ are the range and domain of f.
  • The graph of f⁻¹ is the reflection of f in the line y = x.

Next: Quadratic Functions and Vertex Form