Skip to content
ihateDesmos

Inverse function calculator

Type a function to find its inverse, f⁻¹(x), step by step. You also get the domain and range of the inverse, and a graph showing the two functions as mirror images. If the function isn’t one-to-one, you get the inverse of each restricted branch.

Inverse
f⁻¹(x) = (2x + 1)/(1 − x)
Domain of the inverse
(−∞, 1) ∪ (1, ∞)
Range of the inverse
(−∞, −2) ∪ (−2, ∞)
Steps
  1. Write y = (x − 1)/(x + 2)
  2. Swap x and y: x = (y − 1)/(y + 2)
  3. Multiply both sides by the denominator: x(y + 2) = y − 1
  4. Collect the y terms on one side, then factor out y: y(x − 1) = −2x − 1
  5. Divide to get y on its own: y = (2x + 1)/(1 − x)
  6. Check: f(1) = 0, and f⁻¹(0) = 1
−6−5−4−3−2−1123456−6−4−2246(1, 0)(0, 1)
f in blue and its inverse in red are mirror images in the dashed line y = x.

Checked: putting the inverse into f gave x back at several points before this was shown.

Open in the graphing calculator →

How to find an inverse here

  1. 1
    Type your function of x, such as 2x + 3, (x - 1)/(x + 2), x^3 or e^x.
  2. 2
    Read the inverse and its domain and range.
  3. 3
    Check the graph: the function and its inverse are mirror images in the line y = x.

How to find an inverse function by hand

Swap x and y, then solve for y. For f(x) = 2x + 3:

  1. Write y = 2x + 3.
  2. Swap x and y: x = 2y + 3.
  3. Subtract 3: x − 3 = 2y.
  4. Divide by 2: y = (x − 3)/2.

So f⁻¹(x) = (x − 3)/2. To check it, follow one value through both. f(5) = 13, and f⁻¹(13) = 5. The guide to inverse functions explains why this works.

Common inverse pairs

FunctionInverseNote
x + ax − a
axx/aa ≠ 0
x³∛x
x²√xOnly for x ≥ 0
eˣln(x)The inverse needs x > 0
10ˣlog(x)The inverse needs x > 0
sin(x)arcsin(x)Only for −π/2 ≤ x ≤ π/2
tan(x)arctan(x)Only for −π/2 < x < π/2
1/x1/xIts own inverse

When does a function have an inverse?

Only if it’s one-to-one, meaning no two inputs give the same output. On a graph, this is the horizontal line test: if any horizontal line crosses the curve more than once, the function has no inverse over its whole domain.

f(x) = x² fails the test, since f(2) and f(−2) are both 4. An inverse would need to send 4 to two places at once. The fix is to restrict the domain. On x ≥ 0 the inverse is √x, and on x ≤ 0 it’s −√x. This calculator shows both branches.

Domain and range swap

The domain of the inverse is the range of f, and the range of the inverse is the domain of f. That matters when a formula alone would suggest more. The inverse of f(x) = √x is written x², which looks defined everywhere. But √x only outputs numbers from 0 upward, so the inverse is x² for x ≥ 0 only. To find these for any function, use the domain and range calculator.

When there’s no formula

Some functions have an inverse that can’t be written with ordinary functions. f(x) = x³ + x is one-to-one, so an inverse exists, but x can’t be isolated without the general cubic formula. f(x) = x eˣ needs a special function, the Lambert W. In these cases, the calculator says so rather than guessing. You can still see the inverse on a graph, by reflecting the curve in y = x in the graphing calculator.

Frequently asked questions

What is an inverse function?
A function that undoes another one. If f(a) = b, then f⁻¹(b) = a. Applying one after the other gets you back to where you started.
Does f⁻¹(x) mean 1/f(x)?
No. The −1 here means “inverse function”, not a power. The inverse of 2x is x/2, while its reciprocal is 1/(2x).
How do I check my inverse?
Compose them: f(f⁻¹(x)) should equal x. Or test a number: if f(5) = 13, then f⁻¹(13) should be 5. This calculator runs that check before showing an answer.
Why are the two graphs mirror images?
Finding an inverse swaps x and y, so each point (a, b) on f becomes (b, a) on the inverse. Swapping coordinates reflects a point in the line y = x.
Why does x² have two answers?
Because x² isn’t one-to-one, it has no single inverse. It has two branches, √x for x ≥ 0 and −√x for x ≤ 0, and you choose by which part of the parabola you need.
Is it free?
Yes, with no sign-up. It runs in your browser.

Related tools and guides

See the reflection live

Graph any function and its inverse together in the calculator, and change the formula as you go.

Open the calculator