Inverse Function Calculator

Reviewed by CalcMulti Editorial Team·Last updated: ·Algebra Hub

The inverse function f⁻¹(x) "undoes" the original function f(x). If f maps input a to output b, then f⁻¹ maps b back to a. Inverse functions are used throughout mathematics and its applications: decoding a cipher, converting temperature scales, reversing a coordinate transformation, or solving exponential equations using logarithms.

To find f⁻¹(x) algebraically, replace f(x) with y, swap the roles of x and y, then solve for y. The result is f⁻¹(x). This calculator performs each step explicitly — swapping variables, isolating y, and expressing the final answer — and also checks whether the original function is one-to-one (a necessary condition for the inverse to be a function).

A critical prerequisite for an inverse to exist as a function is that the original function must be one-to-one (injective) — every output value must correspond to exactly one input. The graphical test for this is the horizontal line test: draw any horizontal line across the graph of f(x); if it ever crosses the curve more than once, the function is not one-to-one and its raw inverse is a relation, not a function. For example, f(x) = x² is not one-to-one on all reals because f(2) = f(−2) = 4, so we restrict the domain to x ≥ 0 before taking the inverse, giving f⁻¹(x) = √x.

The domain and range swap when you take an inverse: the domain of f⁻¹ equals the range of f, and the range of f⁻¹ equals the domain of f. This means restrictions on the original domain become restrictions on the inverse range, and vice versa. Graphically, the graph of f⁻¹ is the reflection of the graph of f across the line y = x — x-coordinates and y-coordinates are exchanged at every point.

Inverse functions appear constantly in applied mathematics. The natural logarithm ln(x) is the inverse of eˣ; arcsin(x) is the inverse of sin(x) on [−π/2, π/2]; the square root function is the inverse of x² on [0, ∞). In cryptography, decryption functions are inverses of encryption functions. In calculus, the inverse function theorem relates the derivative of f⁻¹ to the derivative of f: if f is differentiable and f'(a) ≠ 0, then (f⁻¹)'(b) = 1 / f'(a) where b = f(a).

Worked examples by function type: (1) Linear — f(x) = 3x − 7. Replace y = 3x − 7, swap: x = 3y − 7, solve: y = (x + 7)/3, so f⁻¹(x) = (x + 7)/3. Domain of f⁻¹: all reals. (2) Rational — f(x) = (2x + 1)/(x − 3). Replace and swap: x = (2y + 1)/(y − 3). Cross-multiply: x(y − 3) = 2y + 1, giving xy − 3x = 2y + 1, so y(x − 2) = 3x + 1, and f⁻¹(x) = (3x + 1)/(x − 2). Domain of f⁻¹: x ≠ 2. (3) Exponential — f(x) = eˣ − 5. Swap: x = eʸ − 5, so x + 5 = eʸ, giving f⁻¹(x) = ln(x + 5). Domain of f⁻¹: x > −5. Each type requires a different algebraic technique, but the three-step process (write y, swap x/y, solve for y) is universal.

Domain restrictions deserve special attention. Many familiar functions are not one-to-one on their natural domains and require restriction before inversion. f(x) = x² is restricted to x ≥ 0 for the principal square root. f(x) = sin(x) is restricted to [−π/2, π/2] for arcsin. f(x) = cos(x) is restricted to [0, π] for arccos. f(x) = x⁴ requires x ≥ 0 for the fourth root inverse. When stating an inverse function, you must also state its domain (which equals the range of the original restricted function). Omitting domain restrictions is a common error that can produce complex numbers or undefined values.

Verification is essential and simple. A correct inverse always satisfies both composition identities: f(f⁻¹(x)) = x and f⁻¹(f(x)) = x. For example, if f(x) = 5x + 2 and you claim f⁻¹(x) = (x − 2)/5, check: f(f⁻¹(x)) = 5·((x−2)/5) + 2 = x − 2 + 2 = x ✓. Also check f⁻¹(f(x)) = (5x + 2 − 2)/5 = 5x/5 = x ✓. For rational functions, the algebra is more complex but the principle is identical. Always verify both directions — getting only f(f⁻¹(x)) = x is necessary but not sufficient.

Formula

To find f⁻¹(x): (1) Replace f(x) with y, (2) Swap x and y, (3) Solve for y, (4) Replace y with f⁻¹(x)

f⁻¹(x)
inverse function — reverses the mapping of f(x)
domain of f⁻¹
equals the range of f
range of f⁻¹
equals the domain of f

Find f⁻¹(x)

Select a function type, enter parameters, and get the inverse with steps.

Quick examples:

Does Your Function Have an Inverse?

A function has an inverse only if it is one-to-one (injective). Use this checklist before trying to find f⁻¹(x).

FunctionOne-to-One?ReasonDomain Restriction Needed?
f(x) = 3x + 5YesLinear functions are always one-to-one (a ≠ 0)No
f(x) = x²No (on all reals)f(2) = f(−2) = 4 — fails horizontal line testYes: restrict to x ≥ 0
f(x) = x³YesStrictly increasing on all realsNo
f(x) = eˣYesStrictly increasing; range = (0, ∞)No
f(x) = sin(x)No (on all reals)Periodic — repeats every 2πYes: restrict to [−π/2, π/2]
f(x) = |x|No|3| = |−3| = 3 — fails horizontal line testYes: restrict to x ≥ 0
f(x) = 1/xYes (x ≠ 0)Strictly decreasing on each half-domainNo (self-inverse!)
f(x) = x⁴No (on all reals)Even function: symmetric about y-axisYes: restrict to x ≥ 0

Common Mistakes When Finding Inverse Functions

  • Skipping the one-to-one check. Writing f⁻¹(x) = √x for f(x) = x² without restricting the domain gives a relation, not a function.
  • Confusing f⁻¹(x) with 1/f(x). The notation f⁻¹ means the inverse function, not the reciprocal. f⁻¹(x) ≠ 1/f(x) in general (though for f(x) = x, they happen to coincide).
  • Omitting the domain of f⁻¹. The domain of f⁻¹ equals the range of f. For f(x) = √x, f⁻¹(x) = x² but only on x ≥ 0 — writing just "x²" is incomplete.
  • Forgetting to verify. Always check f(f⁻¹(x)) = x AND f⁻¹(f(x)) = x. A common error produces something that satisfies only one direction.
  • Algebra errors when solving for y. Cross-multiplication, factoring out y, and dividing by (x − a) are the three most error-prone steps for rational functions. Write every intermediate step explicitly.

Step-by-Step Worked Examples

Linear: f(x) = 4x − 9

  1. 1. Write y = 4x − 9
  2. 2. Swap x and y: x = 4y − 9
  3. 3. Solve: x + 9 = 4y → y = (x + 9) / 4
  4. 4. f⁻¹(x) = (x + 9) / 4, domain: all reals

Square root: f(x) = √(x + 3)

  1. 1. Write y = √(x + 3), domain x ≥ −3
  2. 2. Swap: x = √(y + 3)
  3. 3. Square both sides: x² = y + 3
  4. 4. f⁻¹(x) = x² − 3, domain x ≥ 0 (range of original f)

Rational: f(x) = (x + 2) / (x − 5)

  1. 1. Write y = (x+2)/(x−5), domain x ≠ 5
  2. 2. Swap: x = (y+2)/(y−5)
  3. 3. Cross-multiply: x(y−5) = y+2 → xy − 5x = y + 2
  4. 4. Collect y: xy − y = 5x + 2 → y(x−1) = 5x + 2
  5. 5. f⁻¹(x) = (5x + 2) / (x − 1), domain x ≠ 1

Common Function Inverses

f(x)f⁻¹(x)Domain of fDomain of f⁻¹
ax + b(x − b) / a(−∞, ∞)(−∞, ∞)
√x[0, ∞)[0, ∞)
∛x(−∞, ∞)(−∞, ∞)
ln(x)(−∞, ∞)(0, ∞)
ln(x)(0, ∞)(−∞, ∞)
√x[0, ∞)[0, ∞)
sin(x)arcsin(x)[−π/2, π/2][−1, 1]
cos(x)arccos(x)[0, π][−1, 1]
1/x1/xx ≠ 0x ≠ 0
(ax+b)/(cx+d)(b−dx)/(cx−a)x ≠ −d/cx ≠ a/c

Disclaimer

This calculator is for educational purposes only and does not constitute professional advice. Results are based on standard mathematical formulas. Always verify critical calculations with a qualified professional before making important decisions.

Frequently Asked Questions