Function Inverse Calculator
Enter a function of x and get its inverse f⁻¹(x). The calculator detects the structural pattern of the input — linear, linear-fractional, square root, exponential, logarithmic or quadratic — and returns the inverse together with any domain restrictions implied by that pattern.
Pattern recognition, then rearrangement
An inverse function undoes what the original did: if f sends 3 to 7, then f⁻¹ sends 7 back to 3. Finding one follows a fixed recipe — write y = f(x), swap the two letters, solve for the new y — but the solving step works only when the function has a shape you can rearrange.
This calculator recognises the shapes that can be rearranged and inverts them. It reports which pattern it matched, the inverse itself, and any domain restriction that pattern brings with it.
Not every function has an inverse, and among those that do, only some can be written in closed form. Rather than a general symbolic solve that would fail unpredictably, the tool tests the input against a fixed list of invertible structures and reports which it matched.
That pattern line is worth reading: it says how the function was understood, and therefore why the inverse looks as it does — particularly for the quadratic, where the answer is half the story.
How to use this calculator
- Enter the function of x Ordinary notation, with implicit multiplication accepted, so 2x + 3 needs no operator. The expression is simplified before the pattern match.
- Read which pattern was matched Linear, linear fractional, quadratic, or the square root, exponential or logarithm of a linear. An unmatched input returns the list rather than a partial answer.
- Read the inverse together with any restriction Several patterns carry a domain condition, which is printed alongside the expression. It is part of the answer, not a footnote.
- Verify by composing if it matters Feeding f and the returned inverse into the composition calculator should give x in both orders — the definitional check, in one step.
How the inverse is found
The expression is parsed and simplified, then tested against each supported structure in turn. Polynomial cases come first: a degree-one polynomial is inverted by subtracting the constant and dividing by the slope, while a constant is rejected since it maps everything to one value.
A quadratic is not one-to-one on the whole real line, so it cannot be inverted without a choice. The tool takes the branch right of the vertex, computes that vertex from the coefficients and states it, then inverts by completing the square — which is where the square root comes from. Higher-degree polynomials are refused with a message saying why.
A quotient of two linear expressions is recognised as a linear-fractional form and inverted by rearrangement, provided the cross-product of the coefficients is non-zero — when it vanishes the function is constant and there is nothing to invert. A quotient with a constant denominator is handled as an ordinary linear function.
The remaining three patterns are a named function applied to a linear argument, each inverted by applying the opposite function and undoing the linear part. A square root inverts to a square restricted to non-negative inputs; an exponential to a logarithm with a strictly positive restriction; a logarithm to an exponential with no restriction.
What each input means
- f(x) Function — form field “Function f(x)”
- The expression to invert. Its structure is what matters — the pattern match is on the shape of the parsed tree, not on how the input was typed.
- f⁻¹(x) Inverse
- The returned function, written in x again. Composing it with the original in either order should return x on the appropriate domain.
- −B/(2A) Vertex position
- Reported for the quadratic case only. It is the boundary of the branch chosen, and the inverse is valid only for inputs the function produces on that side.
Worked examples
Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.
A square root, and where the restriction lands
Invert sqrt(x + 1). The inverse is a quadratic, which on its own would not be one-to-one — so the restriction is doing real work here.
Inputs Function f(x) = sqrt(x + 1)
- Function f(x) = sqrt(x + 1)
- Pattern Square root of a linear
- Inverse f⁻¹(x) = x² − 1 (domain: x ≥ 0)
Result f⁻¹(x) = x² − 1 (x ≥ 0)
The inverse squares the input and then undoes the shift, and it is reported with the condition that its input be non-negative. That condition is inherited from the original function's output: a square root never produces a negative number, so the inverse is never asked to accept one.
Dropping the restriction would give a parabola, which fails the horizontal-line test. The restriction is what makes the pair genuine inverses rather than merely related expressions.
A linear-fractional function
Invert (x + 1)/(x − 2). This is the Möbius pattern, and it has the unusual property of inverting into another function of the same shape.
Inputs Function f(x) = (x + 1)/(x - 2)
- Function f(x) = (x + 1)/(x − 2)
- Pattern Linear fractional (Möbius)
- Inverse f⁻¹(x) = (−2·x − 1)/(−x + 1)
Result f⁻¹(x) = (−2·x − 1)/(−x + 1)
The inverse is again a quotient of two linear expressions, with the coefficients rearranged rather than replaced. That closure under inversion is characteristic of the linear-fractional family and is a good structural check on the answer.
The tool verifies that the cross-product of the coefficients does not vanish before inverting. When it does, the quotient reduces to a constant, which has no inverse at all.
Reading the result
A restriction is part of the answer
Where a condition such as x ≥ 0 is printed, the inverse is genuine only on that set. Quoting the expression without it describes a different function, usually not one-to-one.
Why a quadratic gives only one branch
A parabola takes each value twice, once either side of the vertex, so no single function undoes it everywhere. The right-hand branch is the textbook convention; the left differs only in the sign before the square root.
Domain and range swap
The domain of the inverse is the range of the original and the other way round. That is why the restrictions appear where they do, and it is the quickest way to predict what condition an inverse will carry before computing it.
When you would use this
Solving an equation by undoing it
Where f(x) = k has to be solved and f is invertible, the answer is f⁻¹(k) directly — a solving problem turned into a substitution, which is often the point of finding the inverse.
Reversing a conversion or a model
A formula turning a raw measurement into a reported figure is a function, and recovering the measurement means inverting it. Most such formulas are linear or linear-fractional, both supported.
Assumptions and limitations
What this calculator assumes
- The function is written in x and matches one of the supported structural patterns.
- The quadratic case is inverted on the branch to the right of the vertex, following the usual textbook convention.
- Restrictions printed with the inverse are inherited from the original function's range and are part of the result.
- Constant functions and polynomials of degree three or more are refused rather than approximated.
Where it stops being the right tool
- Pattern-based, not general. A function outside the recognised list returns an explanatory message and the list itself.
- No trigonometric inversion: arcsine, arccosine and arctangent have their own principal-value conventions and are handled by the dedicated trigonometric tools.
- Only one branch of a quadratic is given, and higher even-degree polynomials are not inverted at all.
Common mistakes
Confusing the inverse with the reciprocal
Why it happens. The notation f⁻¹ looks exactly like a power of minus one, and for numbers that is what it means. For functions it denotes the inverse, which is almost never equal to 1/f.
How to avoid it. Compose to check. An inverse composed with the original gives x; a reciprocal composed with the original does not.
Dropping the domain restriction
Why it happens. The expression is the visible answer and the condition reads like an aside. Without it the quadratic and square-root cases are simply wrong as inverses.
How to avoid it. Quote the condition with the expression. If the pair does not compose back to x on some input, the restriction is what was missing.
Expecting an inverse for a function that has none
Why it happens. Every function looks invertible written as an equation, since y can usually be isolated. One-to-one is the real requirement, and most polynomials of degree two or more fail it.
How to avoid it. Apply the horizontal-line test mentally, or restrict the domain first. The error message names the degree that made the function fail.
Frequently asked questions
Which functions can be inverted here?
Linear functions, linear-fractional quotients, quadratics on a restricted domain, and the square root, exponential and logarithm of a linear argument. Anything else returns a message listing exactly these patterns.
Why does the quadratic answer mention a principal branch?
Because a parabola is not one-to-one: it takes each value twice, once either side of its vertex. The calculator inverts the branch to the right of the vertex, reporting that vertex position, which is the standard textbook choice.
Does it handle trigonometric inverses?
No. Inverting sine, cosine and tangent requires conventions about which principal-value range to use, and those are handled by the dedicated trigonometric tools rather than folded in here.
How can I check the inverse is right?
Compose the two functions in both orders. If f⁻¹(f(x)) and f(f⁻¹(x)) both reduce to x on the stated domain, the pair are genuine inverses — and that is the definition rather than a heuristic.