Finding the inverse of a formula by swapping and solving
Leans on
Quick review (2 minutes)
Think of wrapping a gift.
For a one-to-one function f: write y = f(x), swap x and y to get x = f(y), solve for y, and name the result (x). If solving produces ±, the domain of f picks the sign, because the outputs of are the inputs of f. The domain of is the range of f.
Make sure f is a one-to-one function on its domain. Use the horizontal line test, or use the restricted domain you are given. If two inputs share an output, stop: there is no inverse function yet.
Write y in place of f(x). If the function comes with a domain condition such as x ≥ 0, write it beside the equation.
Swap the letters. Every x becomes y and every y becomes x, in the equation and in the domain condition. So x ≥ 0 becomes y ≥ 0.
Solve the swapped equation for y. One y: undo the steps in reverse order. Two y's in a fraction: clear the fraction, gather the y terms on one side, factor y out, divide. A squared y: take the square root of both sides and write ±.
If ± appeared, keep the one sign that fits the condition on y.
Write (x) = your result, and state its domain, which is the range of f.
Check. Send one number through f, then send the result through . You should land on the number you started with.
Confirm that f is a one-to-one function on its domain.
Write y = f(x), with the domain condition beside it if there is one.
Swap x and y everywhere, in the domain condition too.
Solve for y, using the branch of the map below that fits the formula.
If ± appeared, keep the sign that fits the condition on y.
Write (x) = the result. Its domain is the range of f.
Check with a number: through f, then through , back to the start. For full proof, compose both ways and get x each time.
Find (x) for f(x) = + 5. In plain words: f halves its input, then adds 5. Find the rule that takes each output back to its input.
The most common mistake comes with the square root. After x = , people write y = out of habit, or leave y = ± as the answer. Neither is safe. Write ± first, then look at the condition on y that came from the domain of f, and keep the one sign that fits it. For x ≥ 0 that is . For x ≤ 0 it is −. Then test with a number from the domain of f: it must come back to itself.
inverse function
A function that undoes another one. It takes each output of the first function back to the input it came from.
one-to-one function
A function in which no two different inputs share an output. Every output comes from exactly one input, so the function can be undone.
horizontal line test
A check done on a graph. If no horizontal line crosses the graph more than once, the function is a one-to-one function and has an inverse function.
domain
The set of all inputs a function accepts. For an inverse function, the domain is the range of the original function.
range
The set of all outputs a function actually produces. For an inverse function, the range is the domain of the original function.
the line y = x
The diagonal line through the origin where both coordinates are equal, such as (2, 2). The graph of a function and the graph of its inverse function are mirror images across it.
restricted domain
A domain made smaller on purpose. When the inputs kept are picked so that no two of them give the same output, the function becomes one-to-one on them and gains an inverse function.
1 In plain words
Think of wrapping a gift. First the box, then the paper, then the ribbon. To unwrap it you make the opposite moves in the opposite order: ribbon off, paper off, box open. A formula is a wrapping recipe. f(x) = 2x + 3 says: take the input, double it, then add 3. The inverse function is the unwrapping recipe: subtract 3, then halve. This lesson gives one method that writes the unwrapping recipe for you, even when the formula is too tangled to unwrap in your head. Write y for the output, trade the letters x and y, then get y alone. What stands on the other side is the inverse function.
2 Picture it
1. Write y = f(x)
2. Swap x and y
3. Solve for y
4. If ± appears, the domain of f picks the sign
5. Name the result (x)
6. Check: a number through f, then through , returns to the start
Reminder
Reminder: Undoing steps in reverse order, Clearing a fraction, Distributing, Factoring out a common letter, Two square roots, A negative on the bottom of a fraction, Domain and range trade places, Checking that two functions are inverses
- Undoing steps in reverse order. To solve 2x + 3 = 11, undo the last step first: subtract 3 to get 2x = 8, then divide by 2 to get x = 4.
- Clearing a fraction. Multiply both sides by the bottom and the bottom cancels: if 6 = , then 6n = 12, so n = 2.
- Distributing. A number or letter outside a bracket multiplies every term inside: x(y − 3) = xy − 3x. With numbers: 2(5 − 3) = 2 · 5 − 2 · 3 = 4.
- Factoring out a common letter. When every term has the same letter, pull it to the front: xy − 2y = y(x − 2). Check by distributing back: y · x − y · 2.
- Two square roots. Both = 9 and (−3 = 9, so = 9 has two answers, y = 3 and y = −3, written y = ±3 and read plus or minus 3. The symbol alone means only 3, the one that is not negative.
- A negative on the bottom of a fraction. Multiply the top and the bottom by −1 to move the sign: = . Every sign on top changes.
- Domain and range trade places. The inputs of are the outputs of f, and the outputs of are the inputs of f. If f takes only x ≥ 0, then gives only y ≥ 0.
- Checking that two functions are inverses. Compose both ways and get x each time. For f(x) = x + 6 and g(x) = x − 6: f(g(x)) = (x − 6) + 6 = x and g(f(x)) = (x + 6) − 6 = x.
3 Why
The equation y = f(x) is a list of pairs: each input x with its output y. The inverse function holds the same pairs turned around, so each old output becomes an input. Trading the letters x and y in the equation turns every pair around at once. That swapped equation already is the inverse, but it is written backwards, with the new output y buried inside the formula. Solving for y digs it out, so the equation reads output = rule again. Calling the input x and the output y is a convention, and the swap keeps that convention for the inverse.
4 The rule
For a one-to-one function f: write , swap x and y to get , solve for y, and name the result .
If solving produces , the domain of f picks the sign, because the outputs of are the inputs of f. The domain of is the range of f.
The same idea, five ways
when f is one-to-one, find f inverse by swapping x and y, then solving for y.
The inverse function of a one-to-one f is found by writing y = f(x), exchanging the letters x and y, and solving the new equation for y.
- y = f(x) becomes x = f(y)
- x = f(y), solved for y, reads y = (x)
- f(a) = b means (b) = a
- f(x) = with x ≥ 0 gives (x) =
Like turning driving directions around for the trip home: read the list from the bottom up, and turn every left into a right.
The same idea, other ways
In the morning you put on socks, then shoes. At night you take off shoes, then socks: the opposite moves in the opposite order. f(x) = 2x + 3 doubles, then adds 3. Its inverse function subtracts 3, then halves, so (x) = . Swapping and solving does this reversing for you. When you solve x = 2y + 3 for y, your first move is to subtract 3 and your second is to divide by 2.
f(x) = 2x + 3 sends 4 to 11, because 2 · 4 + 3 = 11. The inverse function must send 11 back to 4. Ask: which y gives 11 = 2y + 3? Subtract 3 to get 8, then halve to get 4. Now ask the same question for any output x in place of 11: x = 2y + 3, so y = . Swapping and solving is that one question, answered for every output at once.
An earlier lesson showed that the graph of an inverse function is the mirror image of the original graph in the line y = x, because each point (a, b) becomes (b, a). Swapping the letters x and y in the equation is that same flip, done in algebra. The point (1, 5) on y = 2x + 3 becomes the point (5, 1) on the inverse, y = .
The first lesson of this unit said that (b) = a exactly when f(a) = b. Put x in place of b and y in place of a: y = (x) exactly when x = f(y). So the swapped equation is the definition of the inverse function, written out for this formula. Solving for y changes how the equation looks, not which pairs satisfy it.
Write, swap, solve, check. One y after the swap: undo in reverse order. Two y's: gather them and factor. A squared y: take the root, then let the domain of f pick the sign.
| Kind of formula | After the swap | Key move | Inverse |
|---|---|---|---|
| f(x) = 2x + 3 | x = 2y + 3 | Undo in reverse order: subtract 3, then divide by 2 | |
| Clear the fraction, gather the y terms, factor y out | |||
| Square root of both sides, keep the plus sign | |||
| Square root of both sides, keep the minus sign |
Part 1: A linear function: f(x) = mx + b
A linear function does two things to its input: it multiplies by a number, then adds a number. After the swap, y sits in one place only. So you undo the two steps in reverse order, the same way you solve any linear equation.
- Shape: f(x) = mx + b, with m ≠ 0
- After the swap: x = my + b
- Inverse: (x) = . Rebuild it each time, it takes ten seconds.
- Domain and range of f and of : all real numbers
- If m = 0 the function is constant. Every input shares one output, so there is no inverse function.
Worked example
A linear function with a fraction in it
Find (x) for f(x) = + 5. In plain words: f halves its input, then adds 5. Find the rule that takes each output back to its input.
Show the steps and the answer
- Confirm an inverse function exists.The graph is a slanted straight line. A horizontal line meets a slanted line once, so f is a one-to-one function.
- Write .y is a short name for the output f(x).
- Swap the letters: .The inverse function uses the same pairs turned around. Now x stands for an old output and y for the input it came from.
- Subtract 5 from both sides: .Adding 5 was the last thing done to y, so it is the first thing to undo.
- Multiply both sides by 2: , which is .Multiplying by 2 undoes the halving. Distributing gives 2 · x − 2 · 5 = 2x − 10.
- Rename y: .y alone on one side is the output of the inverse function.
Part 2: A fraction with x on the top and the bottom: f(x) = (ax + b) ÷ (cx + d)
Here the input appears twice, once on the top and once on the bottom. After the swap, y appears twice, so you cannot peel the steps off one at a time. The plan has four moves: clear the fraction, bring every term that has y to one side, pull y out as a common factor, then divide by what is left in the bracket.
- Shape: f(x) = , with c ≠ 0 and ad − bc ≠ 0. When ad − bc = 0, f is constant wherever it is defined and has no inverse.
- After the swap: x =
- Clear the fraction: x(cy + d) = ay + b
- Gather and factor: y(cx − a) = b − dx
- Inverse: (x) = . Do not memorize this. Rebuild it with the four moves each time.
- The bottom of is zero at x = . That is the one output f never reaches, so it is the one input cannot take.
Worked example
X on the top and on the bottom
Find (x) for f(x) = . In plain words: find the formula that takes each output of f back to the input it came from.
Show the steps and the answer
- Confirm an inverse function exists.The graph of f is a shifted, stretched copy of y = , and no horizontal line meets that shape twice. So f is a one-to-one function.
- Write , then swap: .The swap turns every pair around. y is now the old input we want.
- Multiply both sides by (y − 5): .Multiplying by the bottom cancels it on the right, so no fraction is left.
- Distribute on the left: .x multiplies each term inside the bracket.
- Subtract y from both sides and add 5x to both sides: .This puts every term that has y on the left and every term without y on the right.
- Factor y out on the left: .Both left terms contain y. Distribute back to confirm: y · x − y · 1 = xy − y.
- Divide both sides by (x − 1): .The bracket is multiplying y, so dividing by it leaves y alone.
- Rename and state the domain: , with .x = 1 would make the bottom zero. This matches f, which never gives the output 1.
- Domain of : x ≠ 1
Part 3: on the restricted domain x ≥ 0
The full squaring function cannot be undone, because 3 and −3 both square to 9. Keep only the inputs that are zero or more, and each output comes from one input. After the swap you solve x = , which has two candidate answers, and −. The restricted domain tells you which sign to keep.
- Function: f(x) = with restricted domain x ≥ 0
- Range of f: y ≥ 0
- After the swap: x = with y ≥ 0
- Undo the square: y = or y = −
- The condition y ≥ 0 keeps the plus sign: (x) =
- Domain of : x ≥ 0. Range of : y ≥ 0.
- The same formula on x ≤ 0 keeps the other sign: (x) = −
Worked example
Squaring, right half only
Find (x) for f(x) = with x ≥ 0. In plain words: f squares numbers that are zero or more. Find the rule that takes each square back to the number it came from.
Show the steps and the answer
- Confirm an inverse function exists.On x ≥ 0 the graph is the right half of the bowl, which rises all the way. No horizontal line meets it twice, so on this restricted domain f is a one-to-one function.
- Write , with beside it.The domain condition is part of the function and must travel with the equation.
- Swap the letters everywhere: , with .After the swap, y stands for an old input, and old inputs were zero or more.
- Take the square root of both sides: .Both and − square to x. Write both until you have a reason to drop one.
- Keep the plus sign: .The condition y ≥ 0 rules out the minus sign, since − is below zero whenever x > 0.
- Rename and state the domain: , with .The domain of is the range of f, and squares are never below zero.
- Domain of : x ≥ 0
5 How
- Make sure f is a one-to-one function on its domain. Use the horizontal line test, or use the restricted domain you are given. If two inputs share an output, stop: there is no inverse function yet.
- Write y in place of f(x). If the function comes with a domain condition such as x ≥ 0, write it beside the equation.
- Swap the letters. Every x becomes y and every y becomes x, in the equation and in the domain condition. So x ≥ 0 becomes y ≥ 0.
- Solve the swapped equation for y. One y: undo the steps in reverse order. Two y's in a fraction: clear the fraction, gather the y terms on one side, factor y out, divide. A squared y: take the square root of both sides and write ±.
- If ± appeared, keep the one sign that fits the condition on y.
- Write (x) = your result, and state its domain, which is the range of f.
- Check. Send one number through f, then send the result through . You should land on the number you started with.
Finding an inverse by swapping and solving
- Confirm that f is a one-to-one function on its domain.
- Write y = f(x), with the domain condition beside it if there is one.
- Swap x and y everywhere, in the domain condition too.
- Solve for y, using the branch of the map below that fits the formula.
- If ± appeared, keep the sign that fits the condition on y.
- Write (x) = the result. Its domain is the range of f.
- Check with a number: through f, then through , back to the start. For full proof, compose both ways and get x each time.
6 Worked example
Worked example
First full run: a linear function
Find the inverse function of f(x) = 4x − 7. In plain words: f multiplies its input by 4, then subtracts 7. Find the formula that takes each output back to the input it came from.
Show the steps and the answer
- Confirm an inverse function exists.The graph of f is a slanted straight line, and a horizontal line meets a slanted line once. So f is a one-to-one function.
- Write .y is a short name for the output f(x). It makes the swap possible to write.
- Swap the letters: .The inverse function holds the same pairs turned around. From here on, x stands for an old output and y for the old input we are hunting.
- Add 7 to both sides: .Subtracting 7 was the last thing done to y, so it is undone first. This leaves the 4y term alone on its side.
- Divide both sides by 4: .The 4 multiplies y, so dividing by 4 leaves y alone. The whole of x + 7 is divided, not only the 7.
- Rename y: .y alone on one side is the output of the inverse function, written as a rule in x.
Ladder: from easy to exam-hard
Try each rung before you open its steps.
Rung 1 of 8
One step, adding
Find (x) for f(x) = x + 6. In plain words: f adds 6. Find the rule that takes each output back.
Show the steps and the answer
- Write .y names the output. The graph is a slanted line, so f is a one-to-one function and an inverse function exists.
- Swap the letters: .The inverse function uses the pairs turned around.
- Subtract 6 from both sides: .Subtracting 6 undoes adding 6 and leaves y alone.
- Rename y: .y alone is the output of the inverse function.
Rung 2 of 8
Two steps, with a negative number in front of x
Find (x) for f(x) = 9 − 2x. In plain words: f multiplies its input by −2, then adds 9. Find the rule that runs this backwards.
Show the steps and the answer
- Write y = 9 − 2x, then swap: .The graph is a slanted line, so f is a one-to-one function. The swap turns every pair around.
- Subtract 9 from both sides: .This removes the 9 from the side that holds y. The minus sign stays with the 2.
- Divide both sides by −2: .The number multiplying y is −2, not 2, so that is what you divide by.
- Tidy the signs: .Multiplying the top and the bottom by −1 keeps the value and changes every sign: −(x − 9) = 9 − x.
- Rename y: .y alone is the output of the inverse function.
Rung 3 of 8
A linear formula written as one fraction
Find (x) for f(x) = . In plain words: f doubles its input, adds 5, then divides by 3. Find the rule that undoes all three steps.
Show the steps and the answer
- Write , then swap: .The bottom is only a number, so this is still a slanted line and a one-to-one function.
- Multiply both sides by 3: .Dividing by 3 was the last step done, so it is undone first.
- Subtract 5 from both sides: .Adding 5 was the step before that.
- Divide both sides by 2: .Doubling was the first step done, so it is undone last.
- Rename y: .y alone is the output of the inverse function.
Rung 4 of 8
X on the bottom only
Find (x) for f(x) = . In plain words: f subtracts 2 from its input, then divides 3 by the result. Find the rule that takes each output back.
Show the steps and the answer
- Note the domain of f: . Then write and swap: .x = 2 would make the bottom zero. The graph is y = stretched and shifted, which no horizontal line meets twice, so f is a one-to-one function.
- Multiply both sides by (y − 2): .Multiplying by the bottom cancels it, so y is no longer trapped under a fraction bar.
- Divide both sides by x: .x multiplies the bracket, so dividing by x frees it. This is allowed because x is never 0 here: x stands for an output of f, and 3 divided by a number is never 0.
- Add 2 to both sides: .This undoes the subtraction and leaves y alone.
- Rename and state the domain: , with .The domain of is the range of f, and f never gives the output 0.
- Domain of : x ≠ 0
Rung 5 of 8
X on the top and the bottom
Find (x) for f(x) = . In plain words: find the formula that takes each output of f back to its input. After the swap, y will show up twice.
Show the steps and the answer
- Note the domain of f: . Write and swap: .The graph is a shifted, stretched copy of y = , so f is a one-to-one function and an inverse function exists.
- Multiply both sides by (y − 3): .This clears the fraction.
- Distribute on the left: .x multiplies each term inside the bracket. Now you can see both y terms.
- Subtract 2y from both sides and add 3x to both sides: .Every term with y is now on the left and every term without y is on the right.
- Factor y out on the left: .Both left terms contain y. Two y's have become one, which is the point of this move.
- Divide both sides by (x − 2): .The bracket multiplies y, so dividing by it leaves y alone.
- Rename and state the domain: , with .x = 2 would make the bottom zero. It is also the one output f never reaches.
- Domain of : x ≠ 2
Rung 6 of 8
Top and bottom, with numbers in front of every x
Find (x) for f(x) = . In plain words: the same job as rung 5, with more signs to watch.
Show the steps and the answer
- Write and swap: .The graph is again a shifted, stretched copy of y = , so f is a one-to-one function.
- Multiply both sides by (2y + 5): .This clears the fraction.
- Distribute on the left: .x multiplies both terms in the bracket.
- Subtract 3y from both sides and subtract 5x from both sides: .Terms with y go left, terms without y go right. Each term changes sign when it crosses over.
- Factor y out: .Check by distributing back: y · 2x − y · 3 = 2xy − 3y.
- Divide both sides by (2x − 3): .This leaves y alone.
- Tidy the signs: .Multiplying the top and the bottom by −1 changes every sign and keeps the value. Either form is correct.
- Rename and state the domain: , with .The bottom 3 − 2x is zero when x = , so that input is thrown out.
- Domain of : x ≠
Rung 7 of 8
on the other half, x ≤ 0
Find (x) for f(x) = with x ≤ 0. In plain words: f squares numbers that are zero or negative. Find the rule that takes each square back to the number it came from.
Show the steps and the answer
- Confirm an inverse function exists.On x ≤ 0 the graph is the left half of the bowl, which falls all the way. No horizontal line meets it twice, so on this restricted domain f is a one-to-one function.
- Write with , then swap everywhere: with .After the swap, y stands for an old input, and old inputs were zero or negative.
- Take the square root of both sides: .Both and − square to x. Write both, then choose.
- Keep the minus sign: .The condition y ≤ 0 rules out the plus sign, since is above zero whenever x > 0.
- Rename and state the domain: , with .The domain of is the range of f, and squares are never below zero.
- Domain of : x ≥ 0
Rung 8 of 8
A shifted square on a restricted domain
Find (x) for f(x) = (x − 1 + 2 with x ≥ 1. In plain words: f subtracts 1, squares, then adds 2, and only inputs of 1 or more are allowed. Find the rule that runs this backwards, and its domain.
Show the steps and the answer
- Confirm an inverse function exists.For x ≥ 1 the bracket x − 1 is zero or more, and two different numbers that are zero or more never have the same square. So no two inputs share an output.
- Find the range of f: outputs are 2 or more.(x − 1 is never below zero, and it equals zero at x = 1. Adding 2 makes the smallest output 2.
- Write with , then swap everywhere: with .The domain condition travels with the swap.
- Subtract 2 from both sides: .Adding 2 was the last step done, so it is undone first. The squared piece is now alone.
- Take the square root of both sides: .Both and − square to x − 2. The whole of x − 2 sits inside the root.
- Keep the plus sign: .y ≥ 1 means y − 1 is zero or more, so it cannot equal a negative number.
- Add 1 to both sides: .This undoes the subtraction inside the bracket and leaves y alone.
- Rename and state the domain: , with .The domain of is the range of f, which is 2 or more. It also keeps the inside of the root from going below zero.
- Domain of : x ≥ 2
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Four words to carry: write, swap, solve, check.
- The ten-second check: send one number through f, then send the result through . If you do not land on your starting number, there is a slip. Pick a starting number that keeps the arithmetic clean, and avoid 0 and 1, which can hide mistakes.
- A number check catches errors but does not prove the answer. Composing both ways and getting x each time is the proof.
- For a linear function you can skip the swap: list the steps f does, reverse the order, and replace each step with its opposite. Use the swap method to confirm.
- With y on the top and the bottom, say the plan out loud: clear, gather, factor, divide.
- After any square root, look back at the domain of f. Inputs of f are outputs of , so keep the sign whose outputs lie in that domain. For itself, x ≥ 0 keeps +√ and x ≤ 0 keeps −√.
- The domain of is the range of f, not whatever the finished formula seems to allow. Example: f(x) = has outputs that are zero or more, so its inverse is with x ≥ 0 only, even though the formula accepts any number.
- Do not memorize a formula for the inverse of . The four moves rebuild it in under a minute, and a memorized formula with one wrong sign is worse than none.
7 The trap
The most common mistake comes with the square root. After x = , people write y = out of habit, or leave y = ± as the answer. Neither is safe. Write ± first, then look at the condition on y that came from the domain of f, and keep the one sign that fits it. For x ≥ 0 that is . For x ≤ 0 it is −. Then test with a number from the domain of f: it must come back to itself.
Flash cards
Say the answer out loud, then flip.
What are the three main moves for finding the inverse function of a one-to-one formula?
- Write y in place of f(x).
- Swap the letters x and y.
- Solve for y, then name the result (x).
Why does trading the letters x and y produce the inverse function?
f(x) = with x ≤ 0. After the swap you have x = with y ≤ 0. What is (x)?
- Write y = ± first, then keep the sign that fits y ≤ 0.
- Check: f(−3) = 9, and − = −3, the number you started with.
f(x) = 2x + 3 wraps the input: double it, then add 3. What is the unwrapping recipe, and how do you check it?
- Opposite moves in the opposite order, like taking the ribbon off before the paper: subtract 3, then halve.
- Check: f(1) = 5, and (5) = = 1.
From earlier
Show answer
Checking that two functions are inverses
Show answer
g(f(x)) = x for every input that f accepts.
Like two bus routes: both round trips must end where they began.