Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Inverse Function Calculator

Enter a function f(x) to find its inverse f⁻¹(x) by swapping x and y and solving, with the inverse's domain and an automatic check that the two functions undo each other.

Linear, linear-fractional, quadratic, power, root, exponential, logarithmic and basic trig functions.

Examples

About the Inverse Function Calculator

An inverse function reverses a rule. If ff converts Celsius to Fahrenheit, its inverse converts Fahrenheit back to Celsius; if ff doubles a number and adds three, the inverse subtracts three and halves. Finding an inverse by hand means swapping the roles of input and output and solving an equation, which is routine for lines and quickly becomes fiddly for fractions, roots and exponentials.

This calculator finds f−1(x)f^{-1}(x) for linear, rational, power, root, exponential, logarithmic and basic trigonometric functions. It shows the swap-and-solve steps, gives the domain of the inverse, and when ff is not one-to-one it chooses a standard branch and says so. Every answer is verified numerically by composing ff with f−1f^{-1} at sample points.

What is an inverse function?

The inverse of a function ff is the function f−1f^{-1} that satisfies f−1(f(x))=xf^{-1}(f(x)) = x for every xx in the domain of ff and f(f−1(y))=yf(f^{-1}(y)) = y for every yy in the range of ff. The notation f−1f^{-1} means the inverse, not the reciprocal 1f\frac{1}{f}.

Only one-to-one functions have inverses, because each output must come from exactly one input. On a graph this is the horizontal line test: no horizontal line may meet the curve twice. The graph of f−1f^{-1} is the reflection of the graph of ff in the line y=xy = x, and the domain and range swap places.

How to use the Inverse Function Calculator

  1. Type the function in terms of xx, for example (2x + 3)/(x - 1), x^3 + 1 or e^x.
  2. Press Find the inverse.
  3. Read the steps: replace f(x) with y, swap x and y, and solve for y.
  4. Note the domain of f⁻¹ and any branch restriction the calculator applied.
  5. Use the check lines to confirm that f and f⁻¹ undo each other.

Formulas

Defining property

f−1(f(x))=x,f(f−1(x))=xf^{-1}(f(x)) = x,\quad f(f^{-1}(x)) = x

Swap and solve

y=f(x)  →  x=f(y)  →  y=f−1(x)y = f(x) \;\to\; x = f(y) \;\to\; y = f^{-1}(x)

Domain and range swap

Dom⁡(f−1)=Ran⁡(f)\operatorname{Dom}(f^{-1}) = \operatorname{Ran}(f)

Inverse of a Möbius function

f(x)=ax+bcx+d  ⇒  f−1(x)=dx−ba−cxf(x) = \frac{ax + b}{cx + d} \;\Rightarrow\; f^{-1}(x) = \frac{dx - b}{a - cx}

Worked example: (2x + 3)/(x − 1)

The example inverts f(x)=2x+3x−1f(x) = \frac{2x + 3}{x - 1}. After swapping, the equation x=2y+3y−1x = \frac{2y + 3}{y - 1} is cleared of its fraction, every term containing yy is gathered on one side, and yy is factored out.

The result is f−1(x)=x+3x−2f^{-1}(x) = \frac{x + 3}{x - 2}. Its domain excludes 2 because ff never outputs 2: as xx grows, f(x)f(x) approaches the horizontal asymptote y=2y = 2 without reaching it.

The solution below is generated by the same engine that powers the calculator above.

Final answer

f−1(x)=x+3x−2f^{-1}(x) = \frac{x+3}{x-2}

How we read your problem

Find f⁻¹, the function that undoes f(x) = (2 x + 3) / (x - 1).

f(x)=2x+3x−1f(x) = \frac{2x+3}{x-1}

Step-by-step solution

  1. Replace f(x) with y

    y=2x+3x−1y = \frac{2x+3}{x-1}
  2. Multiply both sides by the denominator

    y(1x+−1)=2x+3y(1x+-1) = 2x+3
  3. Collect the x-terms on one side and factor out x

    x(1y−2)=3−−1yx(1y-2) = 3--1y
  4. Divide to isolate x

    x=y+3y−2x = \frac{y+3}{y-2}
  5. Solved for x

    x=y+3y−2x = \frac{y+3}{y-2}
  6. Swap x and y to name the inverse

    f−1(x)=x+3x−2f^{-1}(x) = \frac{x+3}{x-2}
  7. The domain of f⁻¹ is the range of f

    Domain of f−1: (−∞,2)∪(2,∞)\text{Domain of } f^{-1}:\ (-\infty, 2) \cup (2, \infty)

Formulas used

  • Inverse

    y=f(x)  ⟺  x=f−1(y)y = f(x) \iff x = f^{-1}(y)

To invert a function, write y = f(x), undo its operations in reverse order to get x on its own, then swap the letters.

Verification

  • Checked: f(f⁻¹(y)) = y at 12 sample points.
  • Checked: f⁻¹(f(x)) = x at 12 sample points.

Detailed explanation

Why the swap-and-solve method works

Writing y=f(x)y = f(x) describes all pairs (x,y)(x, y) on the graph. Swapping the letters describes the reflected set of pairs, which is exactly the graph of the inverse. Solving the swapped equation for yy turns that set of pairs back into a formula. The method fails only when the solving step has more than one answer, which signals that ff is not one-to-one.

For each function type there is a matching undo operation: subtraction undoes addition, division undoes multiplication, a cube root undoes a cube, ln⁡\ln undoes exe^x and log⁡2\log_2 undoes 2x2^x. Inverting x3+1x^3 + 1 means undoing those operations in reverse order: subtract 1, then take the cube root, giving x−13\sqrt[3]{x - 1}.

Restricting the domain

A function like x2x^2 fails the horizontal line test because 22 and −2-2 both map to 4. To give it an inverse we keep only part of its domain. The calculator uses the conventional branch x≥0x \geq 0, which gives f−1(x)=xf^{-1}(x) = \sqrt{x}, and reports the restriction in the answer. For x2+1x^2 + 1 the same branch gives x−1\sqrt{x - 1} with domain [1,∞)[1, \infty).

Trigonometric functions are restricted in the standard way too. For sin⁡x\sin x the calculator keeps −π2≤x≤π2-\frac{\pi}{2} \leq x \leq \frac{\pi}{2}, which produces arcsin⁡x\arcsin x on [−1,1][-1, 1].

How the answer is checked

After finding a candidate inverse, the engine evaluates f(f−1(y))f(f^{-1}(y)) for sample values of yy in the range of ff and requires it to return yy; if that fails, no inverse is reported. It also evaluates f−1(f(x))f^{-1}(f(x)): when this returns xx only for some inputs, ff is not one-to-one, and the answer names the branch that was used. This catches sign slips and wrong branches that are easy to miss in algebra alone.

Common mistakes

  • Reading f−1(x)f^{-1}(x) as 1f(x)\frac{1}{f(x)}; the exponent notation means inverse here, not reciprocal.
  • Forgetting to swap xx and yy and simply solving y=f(x)y = f(x) for xx, then leaving the answer in terms of yy.
  • Claiming x2x^2 has the inverse ±x\pm\sqrt x; a function must give one output, so a branch is required.
  • Ignoring the domain of the inverse, which equals the range of the original function.
  • Undoing operations in the original order instead of reverse order.

Tips

  • Test one value: if f(2)=7f(2) = 7, then f−1(7)f^{-1}(7) must be 2.
  • Sketch ff with the graphing calculator and apply the horizontal line test before inverting.
  • For fractions of linear terms, multiply out, collect the yy terms and factor yy out.
  • Find the range of ff with the domain and range calculator to get the inverse's domain.
  • Use the function composition calculator to verify that f(f−1(x))f(f^{-1}(x)) simplifies to xx.

Frequently asked questions

How do you find the inverse of a function?

Replace f(x) with y, swap x and y, solve the new equation for y, and write the result as f⁻¹(x). Then state its domain, which is the range of the original function.

Does every function have an inverse?

No. Only one-to-one functions do. Functions that fail the horizontal line test, such as x² or sin x, need a restricted domain before an inverse exists.

Which branch does the calculator choose for x²?

It uses x ≥ 0, so the inverse is the square root. The restriction is written in the answer so you know which branch was used.

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

No. The superscript −1 means the inverse function. The reciprocal 1/f(x) is a different function and is usually written with a fraction or as (f(x))⁻¹.

What is the inverse of e^x?

The natural logarithm, ln x, with domain x > 0. In the same way, the inverse of 2^x is log base 2 of x.

How are the graphs of f and f⁻¹ related?

They are reflections of each other in the line y = x, so a point (a, b) on one graph corresponds to the point (b, a) on the other.

How does the calculator verify the inverse?

It evaluates f(f⁻¹(y)) at several sample points and reports an inverse only if every value comes back unchanged. It also composes in the other order to detect when a branch restriction was needed.

Find your inverse function

Type a function above to see f⁻¹(x), its domain and a numerical check that it really undoes f.

More math calculators