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

Start with a rule simple enough to see straight through: f(x)=x+3f(x) = x + 3, the rule “add three.” Feed it 55 and it returns 88; feed it 1010 and it returns 1313. To send those outputs back where they came from, you do the obvious thing and subtract three: 88 goes back to 55, and 1313 goes back to 1010. The rule “subtract three,” written g(x)=x−3g(x) = x - 3, reverses everything “add three” did. That reversing rule is the inverse of ff.

Look at what happens to a single input-output pair. The function ff ties the input 55 to the output 88, a pairing we can write as (5,8)(5, 8). Its inverse ties 88 back to 55, the pair (8,5)(8, 5). The inverse takes every pair of ff and swaps its two entries: whatever was the input becomes the output, and whatever was the output becomes the input. That one sentence, swap the input and the output, is the whole idea of an inverse, and everything else in this lesson follows from it.

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:

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 run f−1f^{-1} first and then ff, you again come back to the start:

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

Both equations say the same thing from opposite ends: 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 running in opposite directionsThe forward rule f sends the input 5 to the output 8 along the top arrow; the inverse sends 8 back to 5 along the bottom arrow.inputoutput58f: add 3f-1: subtract 3
An inverse runs a function backward. The forward rule f carries the input 5 to the output 8; the inverse f inverse carries 8 back to 5. Undoing a function means swapping the roles of 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

The symbol f−1f^{-1} carries a trap, and it is worth defusing before you use it. The raised −1-1 everywhere else in algebra makes a reciprocal, so f−1(x)f^{-1}(x) looks like it should mean 1f(x)\dfrac{1}{f(x)}. It does not. Here f−1f^{-1} is the name of the inverse function, and it has nothing to do with dividing 11 by anything.

Why reuse a symbol that invites the confusion? For a nonzero number, its reciprocal is the number that multiplies with it to give 11: the reciprocal of 55 is 15\dfrac{1}{5}, and 5⋅15=15 \cdot \dfrac{1}{5} = 1. Functions borrow the same idea with composition in place of multiplication: f−1f^{-1} is the function that, composed with ff, gives back the input unchanged, the same job 11 does for multiplication. The notation is a deliberate echo of that pattern, one inverse for each operation. Because the operations are different, the two inverses 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}. These are not close. 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 a small fraction with nothing to do with undoing 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

Guessing the inverse works for “add three,” but you need a method that works for any rule you are handed. The swap principle hands you one directly. The pairs of ff are (input, output), and the inverse’s pairs are (output, input). So to build the inverse you interchange the input and the output and then rearrange. In symbols, write y=f(x)y = f(x), swap xx and yy, and solve the new equation for yy. The recipe is not a ritual; each step is the input-output swap written in algebra. It always produces a candidate inverse; the section “When a function has no inverse” comes back to when that candidate is a genuine function.

Watch it work on f(x)=2x+3f(x) = 2x + 3. A few input-output pairs show the pattern before the algebra does:

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.

Here xx is the input and yy is the output. Swap them, so that the letter standing for the output now plays the role of the input we feed in. The letter standing for the input is then the value we want back:

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,” with the steps reversed and each one turned around, exactly as an undo should be.

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) = \dfrac{1}{x} + 3, defined for every input except x=0x = 0. The forbidden inputs have traded places: ff banned 33 and f−1f^{-1} bans 00. The next section explains why that swap always happens. A quick check confirms one direction of the reversal, for every x≠3x \ne 3, the one input ff does not accept:

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

The forbidden-input swap you just saw is one instance of a rule that always holds: an inverse turns the domain and range of ff around. It follows straight from swapping input and output. Every pair of ff has the form (input from the domain, output from the range). The inverse swaps each pair into (output, input). So the numbers that were outputs are now the inputs of f−1f^{-1}, and the numbers that were inputs are now its outputs. Therefore

Return to f(x)=1x−3f(x) = \dfrac{1}{x - 3} from the last example. Its domain is every number except 33, and its range is every number except 00, because the reciprocal of a nonzero quantity is never 00. Its inverse f−1(x)=1x+3f^{-1}(x) = \dfrac{1}{x} + 3 has domain every number except 00 and range every number except 33. Line them up and the trade is exact: the domain of one is the range of the other, both ways.

Check your understanding

Suppose ff has 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

Every example so far has had a clean inverse, but some functions have none, and it is important to see why. The trouble starts when two different inputs produce the same output. Consider the squaring rule on all numbers, f(x)=x2f(x) = x^2. It sends both 33 and −3-3 to 99:

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

Now ask the inverse to do its job. It must 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? There is no honest answer. 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.

The property that avoids this trap has a name. 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 no collision always allows one.

The horizontal line test

One-to-one has a picture, and it is the mirror image of a test you already know. In the lesson on functions you met the vertical line test: a graph represents a function when no vertical line crosses it more than once. The reason is that a vertical line gathers all the points with a single input, and a function may not give that input two outputs. One-to-one asks the reverse question, so it uses the reverse line.

A horizontal line gathers all the points that share a single output, since every point on the line y=cy = c sits at the same height cc. If some horizontal line meets the graph in two points, those two points have the same output but different inputs, and the function is not one-to-one. So a graph belongs to a one-to-one function exactly when no horizontal line crosses it more than once. The vertical line test checks “one output per input,” which makes the graph a function. The horizontal line test checks “one input per output,” which makes that function invertible.

The horizontal line test: one crossing is one-to-one, two is notA 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 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 on the left passes: every height is reached exactly once, so it is one-to-one and has an inverse. The parabola y=x2y = x^2 on the right fails: the horizontal line hits it twice, at x=3x = 3 and x=−3x = -3 for the height 99, the same collision that blocked its inverse.

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}. The restriction is what rescued the inverse. Without it, x=y2x = y^2 would hand back two values of yy for each positive xx, which is no function at all. This is the general fix for a rule that fails 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

You now have a way to find an inverse. But how do you check that a proposed answer is right, or test whether two functions handed to you are really inverses? The definition already said it: ff and gg are inverses exactly when they undo each other in both directions,

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, and the reason goes back to one-to-one. A single direction can hold while the other fails, and when it does 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 one direction alone would not settle it.

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 looks perfect:

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, exactly as the one-to-one test warned. Only after squaring is restricted to x≥0x \ge 0, so that no sign is ever lost, do both directions hold.

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 earns its keep whenever a function models a process and you need to run that process in reverse. If a rule turns a starting value into a result, its inverse turns the result back into the starting value, which answers a question the forward rule cannot.

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. The inverse turned a known cost back into the minutes that produced it.

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#

Suppose ff is not one-to-one, so two different inputs aa and bb, with a≠ba \ne b, share an output: f(a)=f(b)=cf(a) = f(b) = c. Any inverse of ff has one required job, to send each output back to the input that produced it. Applied to cc, that job is contradictory, because cc was produced by aa and also by bb. The inverse would need f−1(c)=af^{-1}(c) = a and f−1(c)=bf^{-1}(c) = b at the same time, giving the single input cc two different outputs. That is precisely what the definition of a function forbids, so no function can undo ff.

Now suppose instead that ff is one-to-one. Then every output of ff comes from exactly one input, never two. Sending each output back to that one input is therefore an unambiguous rule, with a single result each time. Producing a single result for each input is exactly what it means to be a function. So the reversal is a genuine function, the inverse f−1f^{-1}.

Putting the two halves together, ff has an inverse function if and only if ff is one-to-one. The condition is not an extra hoop to clear; it is the exact price of demanding that the reversal be single-valued.

A bit of history (optional)

A raised −1-1 already had a job before anyone attached it to a function. On a number it makes a reciprocal, so 5−15^{-1} is one fifth. The English astronomer John Herschel explained a new use for that same small symbol in a paper published in 1813, though an analyst named Burmann is reported to have used a similar notation earlier in Germany. It was Herschel’s explanation that reached English mathematics and stuck, so his name is the one usually attached to it.

Herschel wanted a compact way to name the angle with a given sine. He wrote sin⁡−1\sin^{-1} for it. He also wrote f−1f^{-1} for the function that undoes ff. The borrowing was deliberate. Some writers of his day used a raised 22 on a function to mean applying it twice, so f2(x)f^2(x) stood for f(f(x))f(f(x)), alongside other competing uses of the same mark. Herschel leaned on that reading: if a raised 22 can say do it twice, a raised −1-1 saying undo it fits the pattern neatly.

Mathematics never tidied the clash away. We still write f−1f^{-1} for the inverse function. We also still write sin⁡2x\sin^2 x for (sin⁡x)2(\sin x)^2, so one small superscript points in two directions depending on its sign.

Knowing where the notation came from is the surest way to keep it straight. Negative superscripts on a function were already being used for inverse and repeated operations before the meaning settled the way it has today, and the echo with the reciprocal is a likely reason −1-1 won out. Either way, f−1f^{-1} does not mean one over ff. It names the rule that sends every output back to the input it came from, the pairing you built here and then confirmed by composing both ways to xx.