Graphing • Algebraic Functions Grapher

Inverse Function Grapher

Plot any mathematical function f(x) alongside its inverse f−1(x) and the line of symmetry y = x. Explore coordinate reflections (a, b) ↔ (b, a), verify the horizontal line test, and review step-by-step algebraic inversion derivations.

Symmetry Over y = x Horizontal Line Test (HLT) Interactive Reflector (a, b) ↔ (b, a) 5-Step Algebraic Proofs

Interactive Inverse Function Grapher

Function Archetype Presets Reflected Over y = x
Function & Viewport Settings
f(x) =

Supports: +, -, *, /, ^, sqrt(), cbrt(), exp(), log() / ln(), abs()

f⁻¹(x) =
Automatic parametric inversion active
GRID VIEWPORT BOUNDS
DISPLAY OVERLAYS
Point Reflector Tracer (a, b) ↔ (b, a) Live Tracker

Select an input coordinate x = a. The grapher projects point P(a, b) on f(x) and its exact reflection P'(b, a) across y = x onto f⁻¹(x).

1.0
Point on f(x)
P(1.0, 5.0)
Point on f⁻¹(x)
P'(5.0, 1.0)
Midpoint on y = x: M(3.0, 3.0)
One-to-One (Passes HLT)
f(x): Primary Function
f⁻¹(x): Inverse Function
y = x: Axis of Symmetry
Algebraic Derivation & Verification Proof Standard 5-Step Inversion
Direct Answer & Overview
Verified Educational Guide

Quick Guide: What is an Inverse Function?

An inverse function f⁻¹(x) reverses the operation of f(x) by swapping input and output coordinates: if f(a) = b, then f⁻¹(b) = a. Geometrically, the graph of an inverse function is the mirror reflection of f(x) across the identity line y = x. A function has an inverse if and only if it is one-to-one (passes the Horizontal Line Test).

Primary Mathematical Formula Standard Mathematical Model
Standard Equation
ƒ(x)
Q.E.D.
f(a)=bifff−1(b)=a,quadf(f−1(x))=xf(a) = b iff f^{-1}(b) = a, quad f(f^{-1}(x)) = x
Evaluated with exact mathematical formulation • Rigorously verified
Exact Formula
Input Parameters
Required
1
Primary Function f(x): Any algebraic, rational, exponential, or radical expression
2
Domain Bounds [x_min, x_max]: Interval over which the function is evaluated
3
Coordinate Probe a: Interactive input to inspect point reflection P(a, b) into P'(b, a)
Expected Outputs
Calculated
Dual-Curve Visualization: f(x) in blue, f⁻¹(x) in rose, and y = x in dashed green
Invertibility Status: Automatic check confirming if f(x) passes the Horizontal Line Test
Point Reflector: Displays coordinates P(a, b), P'(b, a), and midpoint M on y = x
Step-by-Step Algebraic Inversion: Full 5-step derivation with domain/range duality
Worked Numerical Example
Instant Verification
Find the inverse of the linear function f(x) = 2x + 3 and plot its reflection.
→ Set y = 2x + 3. Swap variables to get x = 2y + 3. Solve for y: 2y = x - 3 => y = (x - 3)/2. Composition check: 2((x - 3)/2) + 3 = x.
f⁻¹(x) = (x - 3)/2. The line reflects across y = x, intersecting at (-3, -3).

Inverse Function Definition, Bijectivity & The Reflection Principle

In algebra and mathematical analysis, an inverse function is a relation that completely undoes the mapping of an original function. If a function f takes an element x from its domain Df and maps it to an element y in its range Rf such that f(x) = y, then the inverse function f−1 takes y and maps it directly back to x:

f(x) = y   ⇔   f−1(y) = x

This inverse relationship establishes a fundamental domain-range duality:

  • Domain of f−1 = Range of f: Domain(f−1) = Range(f)
  • Range of f−1 = Domain of f: Range(f−1) = Domain(f)

Geometrically, swapping every input coordinate with its corresponding output coordinate transforms every point (a, b) on the curve of f(x) into the point (b, a) on the curve of f−1(x). In Euclidean coordinate geometry, the line segment connecting (a, b) and (b, a) has a midpoint M((a + b)/2, (a + b)/2) which lies precisely on the line y = x, and its slope is (a − b) / (b − a) = −1, which is perpendicular to the line y = x (slope +1). Thus, the graph of f−1(x) is the exact orthogonal reflection of the graph of f(x) across the line y = x.

The Horizontal Line Test & Domain Restrictions for Non-Injective Curves

Not every mathematical function possesses an inverse function. For an inverse relation to qualify as a valid mathematical function, it must assign exactly one output value to each input value (passing the Vertical Line Test). Consequently, the original function f(x) must satisfy the Horizontal Line Test.

The Horizontal Line Test (One-to-One Criterion)

If any horizontal line y = c intersects the graph of f(x) more than once, the function is many-to-one. When reflected across y = x, that horizontal line becomes a vertical line intersecting f−1(x) multiple times, violating the definition of a single-valued function.

Resolving Non-Invertibility with Domain Restrictions

Consider the standard quadratic function f(x) = x2 on the unrestricted domain (−∞, ∞). Because f(−3) = 9 and f(3) = 9, the horizontal line y = 9 intersects the curve at two distinct points. Reflecting the entire parabola gives x = y2 &implies; y = ±√x, which produces two output values for each positive x and is therefore not a function.

To create an invertible function, mathematicians apply a domain restriction:

Original: f(x) = x²,   Domain: [0, ∞),   Range: [0, ∞)
Inverse: f−1(x) = √x,   Domain: [0, ∞),   Range: [0, ∞)

By restricting the domain to x ≥ 0, the function becomes strictly monotonically increasing, passes the Horizontal Line Test, and yields the principal square root function f−1(x) = √x.

The 4-Step Algebraic Algorithm to Invert Any Function

To determine the symbolic formula for an inverse function f−1(x), follow the standard 4-step algebraic inversion procedure:

Step 1

Set y = f(x)

Replace the function notation f(x) with the single dependent variable y to make algebraic manipulation clear and concise.

Step 2

Interchange Variables x and y

Replace every instance of x with y, and every instance of y with x. This step algebraically performs the geometric reflection across the line y = x.

Step 3

Solve Algebraically for y

Use standard algebraic techniques (factoring, cross-multiplication, completing the square, taking roots, or taking logarithms) to isolate y on one side of the equation.

Step 4

Substitute f⁻¹(x) and State Restrictions

Replace y with the formal notation f−1(x). State any domain or range restrictions inherited from the original function.

Verification Through Function Composition: f(f⁻¹(x)) = x

The definitive mathematical test to prove whether two functions f and g are genuine inverses is the Identity Composition Theorem. Both directions of composition must reduce to the identity function I(x) = x:

(f ∁ f−1)(x) = f(f−1(x)) = x   for all x ∈ Domain(f−1)
(f−1 ∁ f)(x) = f−1(f(x)) = x   for all x ∈ Domain(f)

If either composition fails to simplify to x, then the two functions are not true inverses. For example, testing f(x) = 2x + 3 and g(x) = (x − 3)/2:

f(g(x)) = 2 × [(x − 3) / 2] + 3 = (x − 3) + 3 = x   ✓
g(f(x)) = [(2x + 3) − 3] / 2 = 2x / 2 = x   ✓

Step-by-Step Worked Numerical Solutions

Worked Example 1 Rational Inversion

Find the inverse of the linear fractional (Möbius) transformation:

f(x) = (2x + 1) / (x − 3),   x ≠ 3
  1. Replace f(x) with y: y = (2x + 1) / (x − 3)
  2. Swap x and y: x = (2y + 1) / (y − 3)
  3. Clear the denominator: Multiply both sides by (y − 3):
    x(y − 3) = 2y + 1 &implies; xy − 3x = 2y + 1
  4. Group all terms with y on one side:
    xy − 2y = 3x + 1
  5. Factor out y:
    y(x − 2) = 3x + 1 &implies; y = (3x + 1) / (x − 2)
  6. Conclusion: f−1(x) = (3x + 1) / (x − 2) with domain x ≠ 2. Notice that the vertical asymptote of f(x) at x = 3 becomes the horizontal asymptote of f−1(x) at y = 3.
Worked Example 2 Radical Function

Find the inverse of the square root function:

f(x) = √(x + 4),   Domain: [−4, ∞),   Range: [0, ∞)
  1. Set y = f(x): y = √(x + 4)
  2. Swap x and y: x = √(y + 4), with x ≥ 0 (since range of f is y ≥ 0)
  3. Square both sides: x2 = y + 4
  4. Isolate y: y = x2 − 4
  5. State with restricted domain: f−1(x) = x2 − 4 for x ≥ 0. Omitting the domain restriction x ≥ 0 would incorrectly produce a two-sided parabola whose left half is not part of the inverse!

Core Function Inversion Reference Table

Reference table summarizing inverse pairs across standard function families:

Family Original Function f(x) Inverse Function f⁻¹(x) Domain Restrictions
Linear f(x) = mx + b f⁻¹(x) = (x − b) / m m ≠ 0
Quadratic f(x) = x² f⁻¹(x) = √x x ≥ 0
Cubic f(x) = x³ f⁻¹(x) = ³√x All real x
Exponential f(x) = eˣ f⁻¹(x) = ln(x) x > 0
Logarithmic f(x) = log₁₀(x) f⁻¹(x) = 10ˣ All real x
Reciprocal f(x) = 1 / x f⁻¹(x) = 1 / x (Self-Inverse) x ≠ 0

Common Pitfalls & Mistakes to Avoid

Confusing f⁻¹(x) with 1/f(x)

The superscript notation denotes inverse operation, not exponentiation. The multiplicative inverse is [f(x)]−1 = 1/f(x), whereas f−1(x) is the function inverse.

Ignoring Domain Restrictions

Failing to restrict the domain on even-powered functions (like x2 or x4) results in multi-valued relations that violate the definition of a function.

Non-Square Graph Aspect Ratios

If the visual scale on the x-axis differs from the y-axis, the line y = x will not appear at a 45° angle, visually distorting the reflection symmetry.

Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is an inverse function and how does it appear geometrically on a graph?
An inverse function, denoted f⁻¹(x), reverses the mathematical operation performed by the original function f(x). If f maps input a to output b (f(a) = b), then the inverse function maps b back to a (f⁻¹(b) = a). Geometrically, the graph of f⁻¹(x) is the exact reflection of the graph of f(x) across the diagonal identity line y = x.
Why is the notation f⁻¹(x) not equal to 1/f(x)?
The superscript "-1" in function notation represents functional inversion (reversing mapping direction), NOT a numerical reciprocal exponent. The reciprocal of a function is written as [f(x)]⁻¹ = 1/f(x). For example, if f(x) = 2x, its inverse is f⁻¹(x) = x/2, whereas its reciprocal is 1/(2x).
What is the Horizontal Line Test and why must a function pass it to have an inverse?
A function possesses a true single-valued inverse function if and only if it is one-to-one (injective). The Horizontal Line Test states that if any horizontal line y = c intersects the graph of f(x) in more than one point, then multiple distinct x-inputs yield the same y-output. Inverting such a relation produces a curve that fails the Vertical Line Test, meaning it is not a valid function unless its domain is restricted.
How do you restrict the domain of f(x) = x² so that its inverse is a valid function?
The standard parabola f(x) = x² fails the horizontal line test because f(-2) = 4 and f(2) = 4. To invert it, we restrict the domain to non-negative real numbers (x ≥ 0). On this restricted domain, f(x) is strictly increasing and bijective, yielding the unique inverse function f⁻¹(x) = √x with domain x ≥ 0 and range y ≥ 0.
How do the domain and range swap between a function and its inverse?
Because an inverse function swaps input coordinates with output coordinates (x ↔ y), the domain of the inverse function is identical to the range of the original function (Domain(f⁻¹) = Range(f)), and the range of the inverse function is identical to the domain of the original function (Range(f⁻¹) = Domain(f)).
How do you prove that two functions are inverses of each other algebraically?
Two functions f(x) and g(x) are inverses if and only if their compositions equal the identity function in both directions: f(g(x)) = x for all x in the domain of g, and g(f(x)) = x for all x in the domain of f.