Inverse Functions Advanced. This lesson goes beyond core Algebra I. You can skip it.

Learning goals

  • Swap input and output, algebraically and in a diagram, to build the inverse
  • Read f−1f^{-1} as the inverse, never the reciprocal
  • Trade domain for range between a function and its inverse
  • Apply the horizontal line test to spot a one-to-one rule
  • Verify a pair by composing both ways to xx

Undoing what a function does

Take f(x)=x+3f(x)=x+3. It sends 55 to 88 and 1010 to 1313. Subtracting three reverses those pairings: 88 returns to 55, and 1313 returns to 1010. Thus g(x)=x−3g(x)=x-3 is the inverse of ff.

The forward pair (5,8)(5,8) becomes the inverse pair (8,5)(8,5). An inverse swaps the input and output in every pair. The original outputs become the inverse’s allowed inputs.

The inverse of ff has its own symbol, f−1f^{-1}, read aloud as ”ff inverse.” It is defined to undo ff, and “undo” can be stated precisely in two directions. If you run ff and then run f−1f^{-1}, you return to the input you started with, for every xx in the domain of ff:

f−1(f(x))=x.f^{-1}(f(x)) = x.

Reading from the inside out, ff turns xx into f(x)f(x), and f−1f^{-1} turns that back into xx. The reverse order must work too. If you start with any xx in the domain of f−1f^{-1} (the range of ff), you again come back to the start:

f(f−1(x))=x.f(f^{-1}(x)) = x.

Together, the two equations say that ff and f−1f^{-1} cancel each other, whichever one you apply first. For f(x)=x+3f(x) = x + 3 and f−1(x)=x−3f^{-1}(x) = x - 3, check both directions:

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

Adding three and then subtracting three lands you back where you began, and so does subtracting first and then adding.

A function and its inverse reverse the same pairingThe forward rule sends 5 to 8; the inverse sends 8 back to 5.58fadd 3inversesubtract 3
Follow the right arrow to add 3: 5 becomes 8. Follow the left arrow back to subtract 3: 8 becomes 5. Reversing the arrow swaps the input and output.

Check your understanding

A function gg pairs its input and output like this: (1,4)(1, 4), (2,6)(2, 6), (3,8)(3, 8), the same kind of pairing shown in the diagram above. Which pairs belong to g−1g^{-1}?

Answer choices

The superscript that is not a reciprocal

For numbers, a raised −1-1 means a reciprocal, as in 5−1=155^{-1}=\dfrac15. That can make f−1(x)f^{-1}(x) look like 1f(x)\dfrac1{f(x)}. In function notation, however, f−1f^{-1} names the function that undoes ff.

There is a useful analogy. A nonzero number times its reciprocal gives 11: 5⋅15=15\cdot\dfrac15=1. For functions, composition plays the role of multiplication: applying ff and then f−1f^{-1} returns every allowed input of ff unchanged, just as multiplying by 11 leaves a number unchanged. The operations differ, so the inverse function and the reciprocal are different objects.

Make the difference concrete. For f(x)=x+3f(x) = x + 3, the inverse function is f−1(x)=x−3f^{-1}(x) = x - 3, while the reciprocal is 1f(x)=1x+3\dfrac{1}{f(x)} = \dfrac{1}{x + 3}. At x=5x = 5,

f−1(5)=5−3=2,1f(5)=18.f^{-1}(5) = 5 - 3 = 2, \qquad \frac{1}{f(5)} = \frac{1}{8}.

One returns the input that produced the output 55; the other is one over the output that ff gives at 55, and it does not undo ff. Whenever you see f−1f^{-1}, read “the function that reverses ff,” never “one over ff.”

Check your understanding

Let f(x)=x+6f(x) = x + 6, so that f−1(x)=x−6f^{-1}(x) = x - 6. What is 1f(x)\dfrac{1}{f(x)}?

Answer choices

Finding an inverse: swap, then solve

To find an inverse algebraically, write y=f(x)y=f(x), swap xx and yy, then solve for yy. The swap turns each (input, output) pair into (output, input). Solving tells you how to recover the old input from the old output. You must still check that the reversal is a function: some rules send two inputs to the same output and cannot be undone.

Try it on f(x)=2x+3f(x) = 2x + 3. First, a few input-output pairs:

input xx001122
output yy335577

The inverse takes each output back to its input, so its pairs run the other way: 3→03 \to 0, 5→15 \to 1, 7→27 \to 2. Write the output as yy:

y=2x+3.y = 2x + 3.

Now swap their roles: the old output is the new input, and the old input is the value to recover.

x=2y+3.x = 2y + 3.

Solve this for yy by subtracting three and dividing by two:

x−3=2y⟹y=x−32.x - 3 = 2y \quad\Longrightarrow\quad y = \frac{x - 3}{2}.

Rename the result, and the inverse is f−1(x)=x−32f^{-1}(x) = \dfrac{x - 3}{2}. The rule “double, then add three” is undone by “subtract three, then halve”: the steps come in reverse order, and each one is undone.

Worked example 1 Inverting a simple rational, f(x)=1x−3f(x) = \dfrac{1}{x - 3}

This rule subtracts three and then takes the reciprocal, and it accepts every input except x=3x = 3, where the denominator would be zero. Find its inverse the same way. Start from

y=1x−3.y = \frac{1}{x - 3}.

Swap xx and yy:

x=1y−3.x = \frac{1}{y - 3}.

Solve for yy. Taking the reciprocal of both sides clears the fraction, and then add three:

y−3=1x⟹y=1x+3.y - 3 = \frac{1}{x} \quad\Longrightarrow\quad y = \frac{1}{x} + 3.

So f−1(x)=1x+3f^{-1}(x)=\dfrac1x+3, with x≠0x\ne0. The original function excludes input 33 and never produces output 00; its inverse excludes input 00 and never produces output 33. This is a swap of domain and range, as the next section explains. Check one direction for every allowed input x≠3x\ne3:

f−1(f(x))=11x−3+3=(x−3)+3=x.f^{-1}(f(x)) = \frac{1}{\frac{1}{x - 3}} + 3 = (x - 3) + 3 = x.

(A later section shows why checking the other direction, f(f−1(x))=xf(f^{-1}(x)) = x, matters too.)

Check your understanding

What is the inverse of f(x)=5x−2f(x) = 5x - 2?

Answer choices

Domain and range trade places

An inverse exchanges domain and range because it exchanges the two entries of every pair: the old outputs become inputs, and the old inputs become outputs. Therefore

For f(x)=1x−3f(x)=\dfrac1{x-3}, the domain excludes 33. The range excludes 00, since a reciprocal cannot be zero. Every other output rr is reached: choose x=3+1rx=3+\dfrac1r, which is allowed when r≠0r\ne0, and then f(x)=rf(x)=r. So its range is exactly all real numbers except 00.

The inverse f−1(x)=1x+3f^{-1}(x)=\dfrac1x+3 therefore has domain all real numbers except 00 and range all real numbers except 33.

Check your understanding

Suppose ff has an inverse, domain all numbers except 22 and range all numbers except 77. What are the domain and range of f−1f^{-1}?

Answer choices

When a function has no inverse

An inverse function cannot exist when two different inputs give the same output. For f(x)=x2f(x)=x^2 on all real numbers, both 33 and −3-3 give 99:

32=9and(−3)2=9.3^2 = 9 \qquad \text{and} \qquad (-3)^2 = 9.

An inverse would have to send the output 99 back to the input it came from, but here 99 came from two inputs. Should f−1(9)f^{-1}(9) be 33 or −3-3? Neither choice reverses both original pairs. A function is allowed only one output per input, and this would force the single input 99 to have two outputs. So squaring on all numbers has no inverse function.

A function is one-to-one when different inputs always give different outputs, that is, when no two inputs share an output. Squaring fails to be one-to-one because 33 and −3-3 collide. A line like f(x)=4x−7f(x) = 4x - 7 is one-to-one, because two different inputs, stretched and shifted the same way, stay different. In fact a function has an inverse function exactly when it is one-to-one: two colliding inputs always block a reversal, the way 33 and −3-3 just did, and if each output comes from exactly one input, sending it back gives one answer each time.

The horizontal line test

The vertical line test from What Is a Function? asks whether each input has at most one output. To test whether a function is one-to-one, ask the reverse question: does each output come from at most one input?

A horizontal line y=cy=c collects points with the same output cc. If it meets a function’s graph twice, two different inputs share that output. Therefore a function is one-to-one exactly when every horizontal line meets its graph at most once. First establish that the graph is a function; then the horizontal line test tells you whether that function has an inverse.

Horizontal lines test whether outputs repeatA rising line crossed once by a horizontal line versus an upward parabola crossed twice by a horizontal line.one-to-onenot one-to-one
The horizontal line test. On the left every horizontal line meets the rising graph at most once, so each output comes from a single input and the function is one-to-one. On the right a horizontal line meets the parabola twice, so one output comes from two inputs and the function is not one-to-one.

The rising line passes because it never returns to a height. The parabola fails because the marked horizontal line meets it twice. For y=x2y=x^2, the height 99 gives the earlier example: the two crossings have inputs 33 and −3-3.

Check your understanding

The graph of f(x)=∣x∣f(x) = |x| makes a V shape: it touches 00 at x=0x = 0 and rises in a straight line on both sides. Apply the horizontal line test using the line y=5y = 5. How many times does that horizontal line cross the graph, and what does it show?

Answer choices

A function that fails the test can often be repaired by shrinking its domain until it is one-to-one. Squaring collides because every positive output has two inputs that reach it, a positive one and its negative; only the output 00 is different, since it comes from the single input 00. Throw away the negative inputs, keeping f(x)=x2f(x) = x^2 for x≥0x \ge 0, and every output now comes from a single nonnegative input. On that restricted domain squaring is one-to-one, and its inverse is the square root.

Worked example 2 An inverse on a restricted domain

Find the inverse of f(x)=x2f(x) = x^2 with the domain restricted to x≥0x \ge 0.

With the domain restricted, the rule is one-to-one, so an inverse function exists. Swap and solve, watching the restriction travel with the variable. Start from

y=x2,x≥0.y = x^2, \qquad x \ge 0.

Swap xx and yy. The condition x≥0x \ge 0 was a statement about the input of ff, which becomes the output of f−1f^{-1}, so it attaches to yy:

x=y2,y≥0.x = y^2, \qquad y \ge 0.

Solve x=y2x = y^2 for yy. When x>0x > 0, two numbers square to xx, namely x\sqrt{x} and −x-\sqrt{x}; when x=0x = 0, the only number that squares to it is 00 itself. Either way, the restriction y≥0y \ge 0 keeps only the nonnegative choice:

y=x.y = \sqrt{x}.

So f−1(x)=xf^{-1}(x) = \sqrt{x}. Without the restriction, x=y2x = y^2 would give two values of yy for each positive xx, so it would not be a function. You can often do the same with other rules that fail the horizontal line test: cut the domain down to a piece on which the rule is one-to-one, then invert that piece.

Check your understanding

Which of these functions is one-to-one on all real numbers, so that it has an inverse function?

Answer choices

Verifying an inverse by composition

To check whether ff and gg are inverses, verify that they undo each other in both orders:

f(g(x))=xandg(f(x))=x.f(g(x)) = x \qquad \text{and} \qquad g(f(x)) = x.

These are compositions, the operation from the last lesson, so verifying an inverse is just building the two composite functions and checking that each one collapses to xx, on every input the inside function actually accepts. Both directions are required: one can hold while the other fails, and then the two functions are not inverses.

Worked example 3 Checking a pair in both directions

Show that f(x)=2x−6f(x) = 2x - 6 and g(x)=x+62g(x) = \dfrac{x + 6}{2} are inverses, then see why checking one direction alone is not enough.

Build both compositions. For g(f(x))g(f(x)), drop the whole rule for ff into gg:

g(f(x))=(2x−6)+62=2x2=x.g(f(x)) = \frac{(2x - 6) + 6}{2} = \frac{2x}{2} = x.

For f(g(x))f(g(x)), drop the whole rule for gg into ff:

f(g(x))=2⋅x+62−6=(x+6)−6=x.f(g(x)) = 2 \cdot \frac{x + 6}{2} - 6 = (x + 6) - 6 = x.

Both directions give xx, so ff and gg are inverses.

To see why both were worth checking, look at a pair that passes one test and fails the other. Take f(x)=x2f(x) = x^2 on all numbers and g(x)=xg(x) = \sqrt{x}. One direction works:

f(g(x))=(x)2=x,f(g(x)) = \left(\sqrt{x}\right)^2 = x,

valid for every x≥0x \ge 0 that gg accepts. But the other direction breaks:

g(f(x))=x2,g(f(x)) = \sqrt{x^2},

which is not xx for negative inputs. At x=−3x = -3 it gives (−3)2=9=3\sqrt{(-3)^2} = \sqrt{9} = 3, not −3-3. The square root cannot recover the sign that squaring destroyed. Because g(f(x))=xg(f(x)) = x fails, squaring on all numbers and the square root are not inverses. This is what the one-to-one test predicts, since squaring on all numbers is not one-to-one. Both directions hold only when squaring is restricted to x≥0x \ge 0, so that no sign is lost.

Check your understanding

Take h(x)=x2h(x) = x^2 for every real number xx, and k(x)=xk(x) = \sqrt{x}. It is true that h(k(x))=xh(k(x)) = x for every x≥0x \ge 0. To show that hh and kk are not actually inverses, which input would you plug into k(h(x))k(h(x)) to reveal the problem?

Answer choices

Running a process backward

An inverse lets you recover a starting value from a known result. Keep the units and allowed values with each direction.

Worked example 4 Recovering the input from the output

A phone plan charges a fixed 2020 dollars per month plus 0.100.10 dollars for each minute of calls, so the monthly cost for mm minutes, m≥0m \ge 0, is C(m)=20+0.1mC(m) = 20 + 0.1m. A bill comes to 3535 dollars. Find a formula that recovers the minutes from the cost, and use it.

The cost function runs forward, minutes in and dollars out. You want the reverse, dollars in and minutes out, which is the inverse. Write the cost as cc and solve for mm:

c=20+0.1m⟹c−20=0.1m⟹m=c−200.1=10(c−20).c = 20 + 0.1m \quad\Longrightarrow\quad c - 20 = 0.1m \quad\Longrightarrow\quad m = \frac{c - 20}{0.1} = 10(c - 20).

So the inverse is C−1(c)=10(c−20)C^{-1}(c) = 10(c - 20), which is 10c−20010c - 200. Since m≥0m \ge 0, the model only ever produces a cost c≥20c \ge 20, so this inverse is meant for bills of 2020 dollars or more. Apply it to the 3535 dollar bill:

C−1(35)=10(35−20)=10⋅15=150.C^{-1}(35) = 10(35 - 20) = 10 \cdot 15 = 150.

The bill accounts for 150150 minutes. Check it forward: C(150)=20+0.1(150)=20+15=35C(150) = 20 + 0.1(150) = 20 + 15 = 35 dollars, the original bill.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

Go deeper (optional)

You can skip this and keep going. Read it if you want to know more.

Why an inverse needs a one-to-one function

Why an inverse needs a one-to-one function#

First take f(x)=x2f(x)=x^2 on all real numbers. Both 44 and −4-4 produce 1616. If an inverse existed, it would have to send 1616 back to both 44 and −4-4. That would give one input two outputs, so the reversal could not be a function.

The same obstruction holds generally. If different inputs aa and bb give f(a)=f(b)=cf(a)=f(b)=c, an inverse would need both f−1(c)=af^{-1}(c)=a and f−1(c)=bf^{-1}(c)=b. A function cannot give these two different outputs to the same input. Thus a function with an inverse must be one-to-one.

For the other direction, consider f(x)=2x+1f(x)=2x+1 on exactly {0,1,2}\{0,1,2\}. Its pairs are (0,1)(0,1), (1,3)(1,3) and (2,5)(2,5). Each output has just one source, so reversing the pairs gives a function: 1→01\to0, 3→13\to1, 5→25\to2.

Generally, every number in the range of ff comes from at least one input. If ff is one-to-one, it comes from at most one input, hence exactly one. Sending each range value back to that unique input defines a function on the range of ff. Each reversed pair undoes the original pair in both directions, so this function is f−1f^{-1}.

Together, the two arguments show that a function has an inverse exactly when it is one-to-one.

A bit of history (optional)

A raised −1-1 can mean two different things on this page: the reciprocal 5−1=155^{-1}=\dfrac15, or an inverse function. John Herschel explained inverse-function notation in an 1813 paper. Later accounts also credit earlier related notation to the German analyst Bürmann.

Herschel used the notation for inverse trigonometric functions, which recover an angle from a trigonometric value. You need not know those functions yet: the issue was still how to name a rule that runs another rule backward. His notation connected reversal with repeated application of a function, where a raised 22 could mean applying the function twice, f(f(x))f(f(x)). Under that convention, a raised −1-1 suggests “undo once”: reverse an application instead of repeating it.

Another convention survived beside it: sin⁡2x\sin^2 x means (sin⁡x)2(\sin x)^2, the square of an output, while sin⁡−1\sin^{-1} names an inverse function. From the symbol alone, you cannot tell which operation is intended. In this lesson, read f−1f^{-1} as the rule that undoes ff, and write a reciprocal explicitly as 1f(x)\dfrac1{f(x)}.

Sources: Jeff Miller’s history of trigonometric notation and Cajori’s account of Herschel’s functional notation.

Your progress

See all your progress →