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.
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)
Select a function type, enter parameters, and get the inverse with steps.
Quick examples:
A function has an inverse only if it is one-to-one (injective). Use this checklist before trying to find f⁻¹(x).
| Function | One-to-One? | Reason | Domain Restriction Needed? |
|---|---|---|---|
| f(x) = 3x + 5 | Yes | Linear functions are always one-to-one (a ≠ 0) | No |
| f(x) = x² | No (on all reals) | f(2) = f(−2) = 4 — fails horizontal line test | Yes: restrict to x ≥ 0 |
| f(x) = x³ | Yes | Strictly increasing on all reals | No |
| f(x) = eˣ | Yes | Strictly 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 test | Yes: restrict to x ≥ 0 |
| f(x) = 1/x | Yes (x ≠ 0) | Strictly decreasing on each half-domain | No (self-inverse!) |
| f(x) = x⁴ | No (on all reals) | Even function: symmetric about y-axis | Yes: restrict to x ≥ 0 |
Linear: f(x) = 4x − 9
Square root: f(x) = √(x + 3)
Rational: f(x) = (x + 2) / (x − 5)
| f(x) | f⁻¹(x) | Domain of f | Domain of f⁻¹ |
|---|---|---|---|
| ax + b | (x − b) / a | (−∞, ∞) | (−∞, ∞) |
| x² | √x | [0, ∞) | [0, ∞) |
| x³ | ∛x | (−∞, ∞) | (−∞, ∞) |
| eˣ | ln(x) | (−∞, ∞) | (0, ∞) |
| ln(x) | eˣ | (0, ∞) | (−∞, ∞) |
| √x | x² | [0, ∞) | [0, ∞) |
| sin(x) | arcsin(x) | [−π/2, π/2] | [−1, 1] |
| cos(x) | arccos(x) | [0, π] | [−1, 1] |
| 1/x | 1/x | x ≠ 0 | x ≠ 0 |
| (ax+b)/(cx+d) | (b−dx)/(cx−a) | x ≠ −d/c | x ≠ a/c |
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.