An inverse function reverses a function’s input-output relationship. If f(4)=7f(4)=7, then f − 1 (7)=4f^{-1}(7)=4, provided the inverse is defined.

A function needs to be one-to-one on the domain being inverted: different inputs must produce different outputs. Otherwise reversing the relation would assign one input to more than one output.

On this page (8 sections)

When does an inverse function exist?

A function has an inverse function on its range when it is one-to-one: distinct inputs have distinct outputs. Reversing its pairs then gives exactly one output for each new input.

The horizontal line test checks this property. A horizontal line must meet the function’s graph at most once. This is separate from the vertical line test, which checks whether the original relation is a function at all.

If a codomain larger than the actual range has been named, the inverse is defined only on the range unless the function reaches the entire codomain. Always identify which inputs the inverse accepts.

Finding an inverse algebraically

For f(x)=3x−5f(x)=3x-5 on the real numbers, start with y=3x−5y=3x-5. Reversing the input-output labels gives x=3y−5x=3y-5.

x=3y−5 ⟺ x+5=3y ⟺ y= x + 5 3 x=3y-5\quad\Longleftrightarrow\quad x+5=3y\quad\Longleftrightarrow\quad y=\frac{x+5}{3}
f − 1 (x)= x + 5 3 f^{-1}(x)=\frac{x+5}{3}

Check both compositions

f( f − 1 (x))=3 ( x + 5 3 ) −5=xf(f^{-1}(x))=3\left(\frac{x+5}{3}\right)-5=x
f − 1 (f(x))= ( 3 x − 5 ) + 5 3 =xf^{-1}(f(x))=\frac{(3x-5)+5}{3}=x

Both functions have all real numbers as domain and range, so these checks apply to every real input.

Graphs reflect across y = x

Reversing (u,v)(u,v) to (v,u)(v,u) reflects a graph across the line y=xy=x. The plot below uses the same unit scale on both axes so that the reflection is represented correctly.

Inverse functions exchange coordinates

Inverse functions exchange coordinatesBoth axes use the same unit scale. Interchanging the two coordinates reflects the solid function onto the dashed inverse. The dotted diagonal is the reflection line, not a third inverse.−202468−202468xy(4, 7)(7, 4)
  • f(x)=3x−5f(x)=3x-5
  • f − 1 (x)=(x+5) / 3f^{-1}(x)=(x+5)/3
  • Reflection line: y=xy=x
The points (4,7)(4,7) and (7,4)(7,4) are reflections across y=xy=x.
Diagram explained

Both axes use the same unit scale. Interchanging the two coordinates reflects the solid function onto the dashed inverse. The dotted diagonal is the reflection line, not a third inverse.

Exact reference values for this graph
Original pointInverse point
(0,−5)(0,-5) (−5,0)(-5,0)
(2,1)(2,1) (1,2)(1,2)
(4,7)(4,7) (7,4)(7,4)

The original pair (4,7)(4,7) becomes (7,4)(7,4). The domain of the inverse is the original range, and its range is the original domain.

Restricting a domain

The function f(x)= x 2 f(x)=x^2 is not one-to-one on the real numbers because f(2)=f(−2)=4f(2)=f(-2)=4. Restricting it to [0,∞)[0,\infty) selects the non-negative branch and gives f − 1 (x)= x f^{-1}(x)=\sqrt x.

( x ) 2 =x (x≥0), x 2 =x (x≥0)(\sqrt x)^2=x\quad(x\ge0),\qquad\sqrt{x^2}=x\quad(x\ge0)

Without the input restriction, x 2 =|x|\sqrt{x^2}=|x|, not always xx. For instance, ( − 2 ) 2 =2\sqrt{(-2)^2}=2.

A different restriction gives a different inverse

On domain (−∞,0](-\infty,0], the same square rule is also one-to-one. Its inverse is f − 1 (x)=− x f^{-1}(x)=-\sqrt x, with domain [0,∞)[0,\infty) and range (−∞,0](-\infty,0]. The original domain determines which inverse branch is correct.

Inverse notation is not reciprocal notation

The notation f − 1 (x)f^{-1}(x) means the inverse function. It is not the reciprocal 1 / f(x)1/f(x). For f(x)=3x−5f(x)=3x-5, these rules are:

f − 1 (x)= x + 5 3 , 1 f ( x ) = 1 3 x − 5 f^{-1}(x)=\frac{x+5}{3},\qquad\frac1{f(x)}=\frac1{3x-5}

The inverse undoes the assignment. The reciprocal takes the multiplicative inverse of an output and is undefined at x=5 / 3x=5/3.

Practice questions

  1. Find the inverse of f(x)=3x−5f(x)=3x-5.

  2. Why does f(x)= x 2 f(x)=x^{2} not have an inverse on all real numbers?

  3. What geometric relationship connects a function and its inverse?

Check your answers
  1. Reverse y=3x−5y=3x-5 to x=3y−5x=3y-5 and solve: f − 1 (x)=(x+5) / 3f^{-1}(x)=(x+5)/3.

  2. It is not one-to-one: f(2)=f(−2)=4f(2)=f(-2)=4. An inverse would have to return two outputs for input 4 unless a branch is selected.

  3. Reverse each ordered pair. With equal axis scales, this is reflection across y=xy=x.

Related topics

See the inverse relationship in Exponential Functions and Logarithmic Functions; compare domain restrictions in Radical Functions.

Sources and further reading