gizmobench

Inverse Function Calculator

Type f(x) and press Find inverse to get f⁻¹(x) as an exact formula, with the domain it holds on, the points it leaves out, the working and a graph of both curves mirrored across y = x. It reads five families: linear, fractional-linear, power, exponential and logarithmic functions, each with exact rational coefficients and a linear expression inside, and it expands a polynomial or a quotient to find which family it belongs to, so x^2 - 6x + 5 is read as (x - 3)^2 - 4. A function that is not one-to-one, such as x^2, gets no inverse until you pick a side of the vertex: x ≥ 0 gives sqrt(x) and x ≤ 0 gives -sqrt(x). Anything outside the five families, such as sin(x) or x^3 + x, is refused with the reason rather than approximated, and every inverse is checked in exact fractions, f⁻¹(f(x)) = x and f(f⁻¹(y)) = y at sample points, before it is shown.

Your function

Example input

Domain restriction

None needed: f is one-to-one on its domain.

Plot range for both x and y

Reads linear, fractional-linear, power, exponential and logarithmic functions of x with exact rational coefficients, such as 2x + 3, (x + 7)/(3x + 5), x^2 - 6x + 5, sqrt(2x + 1), 3·2^(x - 1) + 5 and ln(x - 2) + 1. Use numbers, x, + - * / ^ and brackets, with sqrt, cbrt, exp, ln, log (base 10), log2 and log_b(x). 2x means 2 times x, and 1/2x is read as x/2. Exponents and polynomial degrees go up to 12.

Result

f⁻¹(x) = (x - 3)/2

Read as f(x) = 2x + 3, a linear function.

(1, 5)(5, 1)-4-4-2-200224466ff⁻¹y = x

Text equivalent: Graph for x and y from -4 to 6: f(x) = 2x + 3 in teal and f⁻¹(x) = (x - 3)/2 in amber, mirrored across the dashed line y = x. The point (1, 5) on f pairs with (5, 1) on f⁻¹.

Inverse found: f⁻¹(x) = (x - 3)/2.

Inverse
f⁻¹(x) = (x - 3)/2
Excluded points
none
Check f(f⁻¹(y))
f(f⁻¹(5)) = f(1) = 5
Check f⁻¹(f(x))
f⁻¹(f(2)) = f⁻¹(7) = 2

Domain and range

FunctionFormulaDomainRange
f2x + 3all real xall real y
f⁻¹(x - 3)/2all real xall real y

Working

  1. Write y = f(x): y = 2x + 3.
  2. Solve for x: x = (y - 3)/2.
  3. Swap x and y: f⁻¹(x) = (x - 3)/2, for all real x.

Composition checks

Each point goes through f and then f⁻¹, and back, in exact fractions. Points are chosen where every value is rational, so equality is exact rather than rounded.

xf⁻¹(f(x)) = xf(f⁻¹(y)) = y
1f⁻¹(f(1)) = f⁻¹(5) = 1f(f⁻¹(5)) = f(1) = 5
2f⁻¹(f(2)) = f⁻¹(7) = 2f(f⁻¹(7)) = f(2) = 7
3f⁻¹(f(3)) = f⁻¹(9) = 3f(f⁻¹(9)) = f(3) = 9

Worked examples

  • f(x) = 2x + 3linear example
    (x - 3)/2
  • f(x) = x^2 on the branch x ≥ 0power example
    sqrt(x) for x ≥ 0
  • f(x) = (x + 7)/(3x + 5)fractional-linear example
    (7 - 5x)/(3x - 1) for x ≠ 1/3
  • f(x) = 3·2^(x - 1) + 5exponential example
    log_2((x - 5)/3) + 1 for x > 5
  • f(x) = ln(x - 2) + 1logarithmic example
    e^(x - 1) + 2

Common questions

How do I find the inverse of a function?
Write y = f(x), solve for x, then swap the letters. The page shows those three steps under the answer. For f(x) = 2x + 3 they read y = 2x + 3, then x = (y - 3)/2, then f⁻¹(x) = (x - 3)/2. The inverse undoes f: f(1) = 5 and f⁻¹(5) = 1, and both of those checks are listed with the result.
Why does x^2 need a domain restriction?
Because two inputs give the same output: f(1) = f(-1) = 1, so there is no single way back from 1. A function has an inverse only where it is one-to-one, so the page shows no inverse for x^2 until you choose a branch. Choose x ≥ 0 and the inverse is sqrt(x); choose x ≤ 0 and it is -sqrt(x). Both hold for x ≥ 0. The same choice appears for any even power, such as (x - 3)^2 - 4, with the branches split at its vertex, x = 3.
What is the inverse of (x + 7)/(3x + 5)?
(7 - 5x)/(3x - 1). A fractional-linear function leaves out one input and never reaches one output: here x = -5/3 makes the denominator zero, and f never equals 1/3, which is exactly where the inverse's own denominator is zero. The page lists both as excluded points, x = -5/3 from f and x = 1/3 from f⁻¹, and checks the result at x = 1, 2 and 3: for example f(2) = 9/11 and f⁻¹(9/11) = 2.
Which functions can this calculator invert?
Five families, each with exact rational coefficients and a linear expression inside: linear, such as 2x + 3; fractional-linear, such as (x + 7)/(3x + 5); power, such as x^3, sqrt(2x + 1) and 1/(x - 1)^2 + 3; exponential, such as 3·2^(x - 1) + 5 and e^(2x); and logarithmic, such as ln(x - 2) + 1 and log_2(x + 3). A polynomial is expanded first, so every quadratic works, by completing the square, and a higher degree works when it is one shifted power a(x - h)^n + k. Exponents and polynomial degrees go up to 12. Anything else, such as sin(x), x^3 + x or x·e^x, is refused with the reason instead of an approximate answer.
How is the inverse checked?
In exact fractions, before anything is shown. Up to three sample points where every value is rational are pushed through f and then f⁻¹, and back: for 2x + 3 the page lists f⁻¹(f(1)) = f⁻¹(5) = 1 and f(f⁻¹(5)) = f(1) = 5, then the same at x = 2 and 3. If a check failed, the page would show an error instead of a formula. With base e only one such point exists, where the exponent is 0, so e^x is checked at f(0) = 1 and f⁻¹(1) = 0.
What are the excluded points?
Inputs that f cannot take and outputs it never reaches, listed for f and for f⁻¹. A denominator zero is one: 1/x leaves out x = 0 from both. A cancelled factor is another: (x^2 - 1)/(x - 1) is read as x + 1, but x = 1 is still excluded, so its inverse, x - 1, excludes x = 2, and the graph marks both gaps with open circles. A domain that stops at a boundary, such as x > 2 for ln(x - 2) + 1, is shown in the domain and range table instead.
How do I read the graph?
f is drawn in teal and f⁻¹ in amber, with the dashed line y = x between them. Both axes share one range, -4 to 6 until you change it, so the inverse is a true mirror image: for 2x + 3 the point (1, 5) on f is joined to (5, 1) on f⁻¹. When you choose a branch, the unused half of f is drawn faint and dashed. A text version of the graph sits under it, and Download SVG saves the same drawing.
How should I type the function?
Type the right-hand side, or start with f(x) = or y =. Use ^ for powers, as in x^2 and 2^(x - 1), or the superscripts ², ³ and ⁻¹. The functions are sqrt, cbrt, exp, ln, log (base 10), log2 and log_b(x), as in log_2(x + 3). A missing multiplication sign is read left to right, so 2x is 2 times x and 1/2x is read as x/2; the Read as line under the answer shows how your input was read. e is read only as the base of an exponential, so write e^(2x) with brackets.
Can I copy or save the result?
Copy result puts the formula, the family, both domains and ranges, the excluded points and every check on the clipboard as text. Download SVG saves the graph as it is drawn. Both stay off until the current f(x) has an inverse, and the download also needs a valid plot range. Everything is worked out in your browser, and the last function you submitted yourself is remembered on this device, not sent anywhere.

Exact for the five families this page reads: linear, fractional-linear, power, exponential and logarithmic functions with rational coefficients and a linear expression inside. It is not a general symbolic solver: any other expression is refused as unsupported, and a function that is not one-to-one on its whole domain gets an inverse only after you choose a narrower branch.