Quarry School

Checking that two functions are inverses

Subject: MathematicsLeans on: Composing two functionsLeans on: Substituting a whole expressionLeans on: DistributingLeans on: Multiplying cancels dividingLeans on: A fraction times its flipLeans on: Square rootsLeans on: Squaring a negativeLeans on: What f^{−1} means
Level 1 · FoundationsAbout 17 min read1 new term
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Think of a round trip.

    Rule

    Two functions f and g are inverses of each other exactly when both of these are true: f(g(x)) = x for every input x that g accepts, and g(f(x)) = x for every input x that f accepts. When both hold, g is f−1 and f is g−1. If either one fails, even for a single input, they are not inverses.

    Step

    1. Write down both rules, f(x) and g(x), side by side.

    2. First order, f(g(x)): copy the rule for f, but wherever it has x, write an empty pair of parentheses. Then put the whole formula for g(x) inside the parentheses.

    3. Simplify. The result must be exactly x. Not x + 2, not 3x, not −x.

    4. Second order, g(f(x)): copy the rule for g with empty parentheses in place of x, and put the whole formula for f(x) inside.

    5. Simplify. Again the result must be exactly x.

    6. Decide. If both orders gave x, for every input the inner function accepts, f and g are inverses. If either one gave anything else, they are not, and you can stop at the first failure.

    7. Spot check with one number: pick a number f accepts, run it through f and then g, and confirm it comes back. Then pick a number g accepts and run it through g and then f.

    Question

    Are f(x) = 3x − 5 and g(x) = x+53 inverses of each other? In plain words: if you run any number through one of them and then through the other, in either order, do you always get that number back?

    Answer

    f(g(x)) = x
    g(f(x)) = x
    Yes, f and g are inverses of each other, so g = f−1.

    Trap

    Stopping after one order. Getting f(g(x)) = x feels like the finish, but it is half of the test. With f(x) = x2 and g(x) = x, the first order gives (x)2 = x and passes, while the second order gives g(f(−3)) = 9 = 3, which is not −3. Always write both lines, f(g(x)) and g(f(x)), before you answer yes.

    Strategy

    1. Quick screen: pick one number a that f accepts, find f(a), then put that result into g. If you do not get a back, stop: they are not inverses.

    2. Write f(g(x)): the rule for f with the whole of g(x), in parentheses, in place of x. Simplify.

    3. If the result is not exactly x, stop: they are not inverses.

    4. Write g(f(x)): the rule for g with the whole of f(x), in parentheses, in place of x. Simplify.

    5. If this result is also exactly x for every input f accepts, f and g are inverses. If not, they are not, even though the first order passed.

    6. Check your algebra with a number in both orders.

    Term

    inverse function

    Definition

    A function that undoes another one. It takes each output of the first function back to the input it came from.

    1 In plain words

    Think of a round trip. One bus takes you from home to work. A second bus claims to run the same route backwards. To test the claim, ride the first bus and then the second, and see whether you step off where you started. Then test it from the other end: start at work, ride the second bus and then the first. If both round trips end where they began, from every stop, the two routes undo each other. Two functions are tested the same way. Put a number into one, feed the result into the other, and see whether your starting number comes back. Do it in both orders. If you always get your starting number back, each one is the inverse function of the other.

    2 Picture it

    xgffirstsecondg(x)x
    If f and g are inverses, whatever goes into the first machine comes out of the second unchanged.

    Reminder

    Reminder: Composing two functions, Substituting a whole expression, Distributing, Multiplying cancels dividing, A fraction times its flip, Square roots, Squaring a negative, What f−1 means
    • Composing two functions. f(g(x)) means do g first, then feed its output into f. Work from the inside out: if g(2) = 7 and f(7) = 1, then f(g(2)) = 1.
    • Substituting a whole expression. Replace x by the whole expression, in parentheses: with f(x) = 2x + 6, f(x − 3) = 2(x − 3) + 6, not 2x − 3 + 6.
    • Distributing. The number in front multiplies every term inside: 2(x − 3) = 2x − 6.
    • Multiplying cancels dividing. 3 · x+53 = x + 5, the same way 3 · 123 = 12.
    • A fraction times its flip. 23 · 32 = 66 = 1. Multiply top by top and bottom by bottom.
    • Square roots. 9 = 3 because 3 × 3 = 9. The √ sign always gives the answer that is not negative, so 9 is 3 and never −3.
    • Squaring a negative. (−3)2 = (−3) × (−3) = 9. A negative times a negative is positive.
    • What f−1 means. The −1 in f−1 is part of a name, not a power. f−1(x) is the inverse function, not 1f(x).

    3 Why

    An inverse function sends each output back to its input. So if f(a) = b, the inverse must give g(b) = a. Chain those two facts: g(f(a)) = g(b) = a. That is the statement g(f(x)) = x, and it says g undoes f. But being inverses is a two-way promise: f must also undo g, which is f(g(x)) = x. One order can pass while the other fails. Squaring sends both 3 and −3 to 9. A square root machine sends 9 back to 3 only, so the trip that starts at −3 never gets home. Checking one order would miss that.

    4 The rule

    Two functions f and g are inverses of each other exactly when both of these are true: f(g(x))=x for every input x that g accepts, and g(f(x))=x for every input x that f accepts.

    When both hold, g is f−1 and f is g−1. If either one fails, even for a single input, they are not inverses.

    The same idea, five ways

    Say it

    f of g of x equals x, and g of f of x equals x.

    Write it

    Doing g and then f returns every input unchanged, and doing f and then g returns every input unchanged.

    In math
    • f(g(x)) = x
    • g(f(x)) = x
    • (f ∘ g)(x) = x and (g ∘ f)(x) = x, where the small circle is another way to write f(g(x)) and g(f(x))
    • g = f−1 and f = g−1
    Like

    A round trip: out on one bus, back on the other, and you step off where you got on, whichever end you start from.

    See it

    f(g(x)) = x

    g(f(x)) = x

    Both must be true.

    Then g = f−1.

    The same idea, other ways

    As a picture

    Line up two machines. Drop 4 into f, which multiplies by 3 and subtracts 5: out comes 7. Drop that 7 into g, which adds 5 and divides by 3: out comes 4. The number you put in is the number you get out. Now swap the machines and do it again. If the number always survives, the machines are inverses.

    4f: times 3,then minus 5g: plus 5,then divide by3firstsecond74
    Follow the 4: it changes to 7 in the middle and returns to 4 at the end.
    As a story

    A secret code moves every letter 3 places forward in the alphabet. A decoder moves every letter 3 places back. To trust the pair, you test two things. Encode a message and then decode it: you should read the original message. Decode a message and then encode it: you should again read the original. If either test garbles the text, the two are not a matched pair.

    With small numbers

    Let f add 4 and let g subtract 4. Start with 10. Through f you get 14, then through g you get 10. Now the other order: through g you get 6, then through f you get 10. Any starting number behaves the same way, because (x − 4) + 4 = x and (x + 4) − 4 = x. Both orders return x, so f and g are inverses.

    Why one order is not enough

    Let f square its input and let g take the square root. Start with 9, g first: 9 = 3, then 32 = 9. Home again. Now start with −3, f first: (−3)2 = 9, then 9 = 3. You left from −3 and arrived at 3. The trouble is that f sends two different inputs, 3 and −3, to the same output 9, and g can send 9 back to only one of them. The first order never notices. The second order does.

    3−39function
    Two arrows land on 9, so no function can send 9 back to both 3 and −3.
    Rule of thumb

    Out and back, both ways. If either trip leaves you anywhere except x, the answer is no.

    CheckWhat you doWhat it shows
    f(g(x)) = xg first, then ff undoes g
    g(f(x)) = xf first, then gg undoes f
    Both give xBoth round trips come homef and g are inverses

    5 How

    1. Write down both rules, f(x) and g(x), side by side.
    2. First order, f(g(x)): copy the rule for f, but wherever it has x, write an empty pair of parentheses. Then put the whole formula for g(x) inside the parentheses.
    3. Simplify. The result must be exactly x. Not x + 2, not 3x, not −x.
    4. Second order, g(f(x)): copy the rule for g with empty parentheses in place of x, and put the whole formula for f(x) inside.
    5. Simplify. Again the result must be exactly x.
    6. Decide. If both orders gave x, for every input the inner function accepts, f and g are inverses. If either one gave anything else, they are not, and you can stop at the first failure.
    7. Spot check with one number: pick a number f accepts, run it through f and then g, and confirm it comes back. Then pick a number g accepts and run it through g and then f.

    Testing whether f and g are inverses

    1
    Pick a number a that f accepts. Does g(f(a)) come back to a?
    YesA good sign, but not proof. Go on and test with x.
    NoStop. They are not inverses. One failed number is enough.
    ↓
    2
    Does f(g(x)) simplify to exactly x?
    YesGo on to the other order.
    NoStop. They are not inverses.
    ↓
    3
    Does g(f(x)) simplify to exactly x?
    YesBoth orders passed for every input each inner function accepts: f and g are inverses.
    NoThey are not inverses, even though the first order passed.
    1. Quick screen: pick one number a that f accepts, find f(a), then put that result into g. If you do not get a back, stop: they are not inverses.
    2. Write f(g(x)): the rule for f with the whole of g(x), in parentheses, in place of x. Simplify.
    3. If the result is not exactly x, stop: they are not inverses.
    4. Write g(f(x)): the rule for g with the whole of f(x), in parentheses, in place of x. Simplify.
    5. If this result is also exactly x for every input f accepts, f and g are inverses. If not, they are not, even though the first order passed.
    6. Check your algebra with a number in both orders.

    6 Worked example

    Worked example

    A linear pair, checked in both orders

    Are f(x) = 3x − 5 and g(x) = x+53 inverses of each other? In plain words: if you run any number through one of them and then through the other, in either order, do you always get that number back?

    Show the steps and the answer
    4f: times 3,then minus 5g: plus 5,then divide by3firstsecond74
    The 4 that goes into f comes back out of g, which is what g(f(x)) = x looks like for one number.
    1. Write the plan: compute f(g(x)) and g(f(x)), and see whether each one simplifies to x.Being inverses is a two-way promise, so there are two things to test.
    2. Start f(g(x)). The rule for f is f( ) = 3( ) − 5. Put g(x) in the parentheses: f(g(x))=3·x+53−5.f(g(x)) means g goes first and its whole output becomes the input of f.
    3. Simplify 3·x+53 to x+5.Multiplying by 3 cancels dividing by 3, the same way 3 · 123 = 12.
    4. Now f(g(x))=x+5−5=x.Adding 5 and then subtracting 5 leaves nothing extra. The first order passes.
    5. Start g(f(x)). The rule for g is g()=()+53. Put f(x) in the parentheses: g(f(x))=(3x−5)+53.g(f(x)) means f goes first and its whole output becomes the input of g.
    6. Simplify the top: 3x−5+5=3x. So g(f(x))=3x3.−5 and +5 add to 0.
    7. 3x3=x.Dividing by 3 cancels multiplying by 3. The second order passes.
    8. Both orders gave exactly x, so f and g are inverses.That is the rule: f(g(x)) = x and g(f(x)) = x together.
    Answer
    • f(g(x)) = x
    • g(f(x)) = x
    • Yes, f and g are inverses of each other, so g = f−1.
    Double-check A second way, with a real number in place of x. Start with 4. f first: f(4) = 3 · 4 − 5 = 7, then g(7) = 7+53 = 123 = 4. Back to 4. Now g first: g(4) = 4+53 = 93 = 3, then f(3) = 3 · 3 − 5 = 4. Back to 4 again. Both round trips agree with the algebra.

    Ladder: from easy to exam-hard

    Try each rung before you open its steps.

    Rung 1 of 5

    Adding and subtracting

    Are f(x) = x + 4 and g(x) = x − 4 inverses? In plain words: does running a number through one and then the other, in either order, always return that number?

    Show the steps and the answer
    1. f(g(x))=(x−4)+4.f adds 4 to its input, and the input is all of g(x), which is x − 4.
    2. (x−4)+4=x.−4 and +4 add to 0. The first order passes.
    3. g(f(x))=(x+4)−4.g subtracts 4 from its input, and the input is all of f(x), which is x + 4.
    4. (x+4)−4=x.+4 and −4 add to 0. The second order passes.
    Answer
    • f(g(x)) = x
    • g(f(x)) = x
    • Yes, they are inverses.
    Double-check With the number 10: g(10) = 6 and f(6) = 10. The other order: f(10) = 14 and g(14) = 10. Both trips return 10.

    Rung 2 of 5

    Multiplying and dividing

    Are f(x) = 5x and g(x) = x5 inverses? The question asks whether both round trips return x.

    Show the steps and the answer
    1. f(g(x))=5·x5.f multiplies its input by 5, and the input is g(x) = x5.
    2. 5·x5=x.Multiplying by 5 cancels dividing by 5. The first order passes.
    3. g(f(x))=5x5.g divides its input by 5, and the input is f(x) = 5x.
    4. 5x5=x.Dividing by 5 cancels multiplying by 5. The second order passes.
    Answer
    • f(g(x)) = x
    • g(f(x)) = x
    • Yes, they are inverses.
    Double-check With the number 10: f(10) = 50 and g(50) = 10. The other order: g(10) = 2 and f(2) = 10. Both trips return 10.

    Rung 3 of 5

    A pair that looks right and is not

    Are f(x) = 2x + 6 and g(x) = x2 − 6 inverses? The question asks whether both round trips return x. One failure is enough to say no.

    Show the steps and the answer
    1. f(g(x))=2(x2−6)+6.f doubles its whole input and adds 6. The input is all of g(x), so it goes in parentheses.
    2. Distribute the 2: 2·x2=x and 2·(−6)=−12. So f(g(x))=x−12+6.The 2 multiplies both terms inside the parentheses.
    3. x−12+6=x−6.−12+6=−6.
    4. x−6 is not x, so stop here. They are not inverses.The result must be exactly x. A leftover −6 means the round trip lands 6 short every time.
    Answer
    • f(g(x)) = x − 6, which is not x.
    • No, they are not inverses.
    Double-check With the number 10: g(10) = 102 − 6 = −1, then f(−1) = 2 · (−1) + 6 = 4. You started at 10 and returned to 4, which is 10 − 6, as the algebra said. Changing the 6 in g to a 3 repairs the pair: with g(x) = x2 − 3, f(g(x)) = 2(x2 − 3) + 6 = x − 6 + 6 = x, and g(f(x)) = 2x+62 − 3 = (x + 3) − 3 = x.

    Rung 4 of 5

    Fractions in the rules

    Are f(x) = 23x − 4 and g(x) = 32(x + 4) inverses? The question asks whether both round trips return x.

    Show the steps and the answer
    1. f(g(x))=23·32(x+4)−4.f multiplies its input by 23 and subtracts 4. The input is all of g(x).
    2. 23·32=66=1, so f(g(x))=1·(x+4)−4=x+4−4.A fraction times its flip is 1, and multiplying by 1 changes nothing.
    3. x+4−4=x.+4 and −4 add to 0. The first order passes.
    4. g(f(x))=32((23x−4)+4).g adds 4 to its input and then multiplies by 32. The input is all of f(x).
    5. Inside the outer parentheses, −4+4=0, which leaves 32·23x.Simplify inside parentheses first.
    6. 32·23x=1·x=x.Again a fraction times its flip is 1. The second order passes.
    Answer
    • f(g(x)) = x
    • g(f(x)) = x
    • Yes, they are inverses.
    Double-check With the number 6: f(6) = 23 · 6 − 4 = 4 − 4 = 0, then g(0) = 32 · (0 + 4) = 6. The other order: g(6) = 32 · 10 = 15, then f(15) = 23 · 15 − 4 = 10 − 4 = 6. Both trips return 6.

    Rung 5 of 5

    One order passes, the other fails

    Are f(x) = x2 and g(x) = x inverses, when f accepts every number? The question asks whether both round trips return x for every input each function accepts.

    Show the steps and the answer
    −3f: square itg: take thesquare rootfirstsecond93
    The trip starts at −3 and ends at 3, so this order does not return the input.
    1. f(g(x))=(x)2.f squares its input, and the input is g(x) = x.
    2. (x)2=x for every x that g accepts, which is 0 and the positive numbers.x is the number whose square is x, so squaring it gives x back. The first order passes.
    3. g(f(x))=x2.g takes the square root of its input, and the input is f(x) = x2.
    4. Test a positive input, x = 5: 52=25=5.A quick number shows what x2 does. Here it returned the 5.
    5. Test a negative input, x = −3: (−3)2=9=3.f accepts negative numbers, so they must be tested too. (−3)2 = 9, and 9 is 3, never −3.
    6. 3 is not −3, so g(f(x)) is not x for every input. The second order fails.One input that does not come back is enough to fail the check.
    Answer
    • f(g(x)) = x, so the first order passes.
    • g(f(−3)) = 3, not −3, so the second order fails.
    • No, they are not inverses as given.
    Double-check A second way to see the failure: f(3) = 9 and f(−3) = 9, so two different inputs share the output 9. g(9) is one number, 3. No function g could return both 3 and −3 from the single input 9, so no g can undo this f on every number.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: Checking only f(g(x)) and saying yes. For f(x) = x2 and g(x) = x: f(g(x)) = (x)2 = x, so they are inverses.
    The other order fails. Take x = −3: f(−3) = 9 and g(9) = 9 = 3. You started at −3 and came back to 3. One order passing does not force the other to pass.
    ✓ Instead: Compute both f(g(x)) and g(f(x)). Here the second is not always x, so this f and g are not inverses.
    ✗ Not this: Trying one number and calling it proven. For f(x) = 2x − 1 and g(x) = 3x − 2, take x = 1: g(1) = 1 and f(1) = 1, so f(g(1)) = 1 and g(f(1)) = 1. They must be inverses.
    The number 1 happens to work. Take x = 2: g(2) = 4 and f(4) = 7, not 2. With the letter x, f(g(x)) = 2(3x − 2) − 1 = 6x − 5, which is not x.
    ✓ Instead: A number that fails proves they are not inverses. A number that works proves nothing by itself. When f and g accept endlessly many inputs, the algebra with x is what covers all of them at once.
    ✗ Not this: Multiplying the two formulas in place of composing them. For f(x) = 3x and g(x) = x3: f(x) · g(x) = 3x · x3 = x2, which is not x, so they are not inverses.
    The test is not about multiplying f by g. It is about feeding the output of one into the other.
    ✓ Instead: Put g(x) inside f: f(g(x)) = 3 · x3 = x. Then put f(x) inside g: g(f(x)) = 3x3 = x. They are inverses.
    ✗ Not this: Dropping the parentheses. For f(x) = 2x + 6 and g(x) = x2 − 3, writing f(g(x)) = 2 · x2 − 3 + 6 = x + 3 and deciding they are not inverses.
    The 2 in f multiplies its whole input. Without parentheses it only reached the x2 and missed the −3.
    ✓ Instead: f(g(x)) = 2(x2 − 3) + 6 = x − 6 + 6 = x. The other order is g(f(x)) = 2x+62 − 3 = (x + 3) − 3 = x. They are inverses.

    Tips and tricks

    • Memory device: out and back, both ways. Out through one function, back through the other, and you must land on x. Then again with the order reversed.
    • The answer to each check must be exactly x. If you get x plus or minus a leftover number, such as x − 6, the two functions are not inverses.
    • Always wrap the inserted formula in parentheses before you simplify. Most wrong answers here come from a lost pair of parentheses, not from the idea.
    • A number can show that two functions are not inverses. One number that works cannot show that they are. Use numbers to catch mistakes, and the letter x to prove.
    • You may stop at the first order that fails. One failure settles the question.
    • The order of the names does not matter for the verdict: if g is the inverse function of f, then f is the inverse function of g.

    7 The trap

    Stopping after one order. Getting f(g(x)) = x feels like the finish, but it is half of the test. With f(x) = x2 and g(x) = x, the first order gives (x)2 = x and passes, while the second order gives g(f(−3)) = 9 = 3, which is not −3. Always write both lines, f(g(x)) and g(f(x)), before you answer yes.

    Flash cards

    Say the answer out loud, then flip.

    What two things must both be true for f and g to be inverses of each other?
    • f(g(x)) = x for every input that g accepts.
    • g(f(x)) = x for every input that f accepts.
    • Like two bus routes: both round trips must end where they began.
    You worked out f(g(x)) and it came to x. Can you say yes, they are inverses?
    Not yet. That is half of the test. You rode the round trip from one end. Now work out g(f(x)) as well. One order can pass while the other fails.
    You simplify f(g(x)) and get x + 2. What do you conclude?
    f and g are not inverses. The result must be exactly x. Not x + 2, not 3x, not −x. You can stop at the first failure.
    With f(x) = (x − 1)2 and g(x) = x + 1, the order f(g(x)) hands back x for every x that g accepts. Why are they still not inverses?
    • The other order fails. Start at −2:
    • f(−2)=(−3)2=9
    • g(9) = 9 + 1 = 4, which is not −2.
    • Squaring sends both −2 and 4 to 9, and g can send 9 back to only one of them. The trip that starts at −2 never gets home.

    Comes back in