M4.10.2 Chapter 2

Composite and inverse functions

If I put a number into g, and then put the answer into f, is that the same as doing f first?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Find fg(x) from two functions f and g
  • Find the inverse function f⁻¹(x)

You can join two functions, one after the other. Put a number into g. Then put the answer into f. The pair together is a new function, called a composite function.

A row of boxes joined by arrows. The first box is x. An arrow named + 3 leads to the box g(x). An arrow named × 2 leads to the box fg(x).x+ 3g(x)× 2fg(x)
Here g(x) = x + 3 and f(x) = 2x. The number goes through g first, which adds 3, then through f, which doubles it.

We write this composite as fg(x). It means f(g(x)). The function nearest to x goes first. So in fg(x), the function g is done first, and f second.

Worked example

f(x) = 2x and g(x) = x + 3. Find fg(4).

  1. fg(4) means f(g(4)). Work out g(4) first.
  2. g(4) = 4 + 3 = 7.
  3. Now put 7 into f: f(7) = 2 × 7.
  4. f(7) = 14.

Answer: fg(4) = 14.

Now turn the order round. The function gf(x) means g(f(x)). Now f goes first, and g second.

Worked example

f(x) = 2x and g(x) = x + 3. Find gf(4), and compare it with fg(4).

  1. gf(4) means g(f(4)). Work out f(4) first.
  2. f(4) = 2 × 4 = 8.
  3. Now put 8 into g: g(8) = 8 + 3.
  4. g(8) = 11.
  5. But fg(4) = 14. The two are different, so the order matters.

Answer: gf(4) = 11, and it differs from fg(4) = 14.

A composite can also be written with x, so that it works for every input. Put the whole of g(x) into f, in place of each x.

Worked example

f(x) = 2x + 1 and g(x) = x − 3. Find fg(x).

  1. fg(x) means f(g(x)). Put g(x) into f.
  2. g(x) = x − 3, so f(g(x)) = 2(x − 3) + 1.
  3. Multiply the bracket: 2 × x = 2x, and 2 × (−3) = −6.
  4. So the line reads 2x − 6 + 1.
  5. Collect the numbers: −6 + 1 = −5.
  6. So fg(x) = 2x − 5.

Answer: fg(x) = 2x − 5

Now go the other way. Sometimes you know the output of a function and want its input. A rule that takes you back is called the inverse function. For f, we write it f⁻¹.

Two columns joined by arrows. The column x holds 1, 2, 3 and 4. The column f(x) holds 3, 5, 7 and 9. The arrows run from x to f(x): 1 to 3, 2 to 5, 3 to 7 and 4 to 9.xf(x)12343579
f(x) = 2x + 1 takes each input to its output.
Two columns joined by arrows. The column x holds 1, 2, 3 and 4. The column f(x) holds 3, 5, 7 and 9. The arrows now run from f(x) back to x: 3 to 1, 5 to 2, 7 to 3 and 9 to 4.xf(x)12343579
The inverse f⁻¹ turns every arrow round. It takes each output back to its input.

An inverse works only when each output comes from one input only. The rule f(x) = 2x + 1 passes. But the rule x² does not: the output 4 comes from both 2 and −2. We keep to rules that can be undone.

Draw it first

Find f⁻¹ by undoing the steps

  1. A machine. The row named Do f goes x, then 2x, then f(x), with arrows × 2 and + 1. Step 2 adds the row named Undo f, which goes f(x), then 2x, then x, with arrows − 1 and ÷ 2. Step 3 writes f⁻¹(x) = (x − 1)/2 under it.Do fx× 22x+ 1f(x)

    1 Write the steps of f in order: multiply by 2, then add 1.

  2. A machine. The row named Do f goes x, then 2x, then f(x), with arrows × 2 and + 1. Step 2 adds the row named Undo f, which goes f(x), then 2x, then x, with arrows − 1 and ÷ 2. Step 3 writes f⁻¹(x) = (x − 1)/2 under it.Do fx× 22x+ 1f(x)Undo ff(x)− 12x÷ 2x

    2 Undo them in the reverse order. The last step was add 1, so undo it first with take away 1. Then undo × 2 with ÷ 2.

  3. A machine. The row named Do f goes x, then 2x, then f(x), with arrows × 2 and + 1. Step 2 adds the row named Undo f, which goes f(x), then 2x, then x, with arrows − 1 and ÷ 2. Step 3 writes f⁻¹(x) = (x − 1)/2 under it.Do fx× 22x+ 1f(x)Undo ff(x)− 12x÷ 2xf⁻¹(x) = (x − 1)/2

    3 The undo row, with the letter x for the input, is the rule of f⁻¹.

You can do the same with algebra. Write y = f(x), then make x the subject. The result gives the inverse, once you name its input x again.

Worked example

f(x) = 3x − 2. Find f⁻¹(x).

  1. Write y = 3x − 2.
  2. Add 2 to both sides to undo the take away: 3x = y + 2.
  3. Divide both sides by 3: x = (y + 2)/3.
  4. Call the input x, as always. So f⁻¹(x) = (x + 2)/3.

Answer: f⁻¹(x) = (x + 2)/3

There is a way to check an inverse. Put a number into f, then put the answer into f⁻¹. You must get back the number you began with.

Worked example

f(x) = 3x − 2 and f⁻¹(x) = (x + 2)/3. Show that f⁻¹ takes f(4) back to 4.

  1. First f(4) = 3 × 4 − 2 = 10.
  2. Now put 10 into the inverse: f⁻¹(10) = (10 + 2)/3.
  3. Add on the top: 10 + 2 = 12.
  4. Divide: 12 ÷ 3 = 4.
  5. We are back at 4, where we began.

Answer: f⁻¹(f(4)) = 4.

See it three ways

With things

Kofi thinks of a number. He doubles it and adds 1. He gets 9. What number did he think of?

As a picture

Two rows of boxes. The row named Kofi does goes x, then 2x, then 9, with arrows × 2 and + 1. The row named Undo it goes 9, then 2x, then x, with arrows − 1 and ÷ 2.Kofi doesx× 22x+ 19Undo it9− 12x÷ 2x

In words

Undo the steps backwards. Take away 1 from 9 to get 8, then halve 8 to get 4. Kofi thought of 4.

In symbols

f(x) = 2x + 1 and f⁻¹(x) = (x − 1)/2, so f⁻¹(9) = (9 − 1)/2 = 4.

Try it

Does the order matter?

You need: paper, a pencil.

  1. Start with the number 5. Add 3, then multiply the result by 2. Write the answer.
  2. Start with 5 again. This time multiply by 2 first, then add 3. Write the answer.
  3. Compare the two answers.

What you will see: The answers are 16 and 13. They differ, so the order of the two functions changes the result.

If you cannot try it, this is what happens.
A table with the heads order and result. Rows: add 3, then × 2 and 16; × 2, then add 3 and 13.orderresultadd 3, then × 216× 2, then add 313

A wrong idea many people have

fg(x) means do f first, then g.

Why it feels right: We read from left to right, so the f comes first and it seems to go first.

The test that breaks it: Take f(x) = 2x and g(x) = x + 3. If f went first, fg(4) would be g(f(4)) = g(8) = 11. But fg(4) means f(g(4)) = f(7) = 14, because the brackets show g working on 4.

What is true: In fg(x) = f(g(x)), the function next to x goes first. Read it from the right: g first, then f.

A wrong idea many people have

f⁻¹(x) means 1 divided by f(x).

Why it feels right: A small raised −1 on a number gives a reciprocal. For example, 2⁻¹ is 1/2. So the same mark on f seems to mean the same.

The test that breaks it: Take f(x) = 2x + 1. Then f(3) = 7. If f⁻¹ meant 1 divided by f, then f⁻¹(7) would be 1 ÷ f(7) = 1/15. But f⁻¹(7) = 3, because f takes 3 to 7 and the inverse takes 7 back to 3.

What is true: For a function, f⁻¹ is the inverse function, which undoes f. The reciprocal 1/f(x) is a different thing.

Key words

composite function
two functions joined, with the output of one put into the next, such as fg(x) = f(g(x)).
inverse function
the function f⁻¹ that undoes f, taking each output back to its input.

Back to your guess

The answer is B: No. Doing g first and then f usually gives a different result.

The order matters. Take f(x) = 2x and g(x) = x + 3, with the input 4. Doing g first gives 7, and then f gives 14. Doing f first gives 8, and then g gives 11. Joining functions is like putting on socks and then shoes: the other way round is not the same.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. f(x) = 3x + 1 and g(x) = x². Find fg(2).

    Tap your answer.
    1. Not this one. You did f first: f(2) = 7, then g(7) = 49. But in fg(2) the function g goes first. Go to M4.10.2. Try another.

    2. Yes, that is right. fg(2) means f(g(2)). First g(2) = 2² = 4. Then f(4) = 3 × 4 + 1 = 13.

    3. Not this one. You added f(2) = 7 and g(2) = 4. A composite is one function after the other, not the two answers added. Go to M4.10.2. Try another.

    See the answer

    13

    fg(2) means f(g(2)). First g(2) = 2² = 4. Then f(4) = 3 × 4 + 1 = 13.

    • If you chose A: You did f first: f(2) = 7, then g(7) = 49. But in fg(2) the function g goes first. Go to M4.10.2.
    • If you chose C: You added f(2) = 7 and g(2) = 4. A composite is one function after the other, not the two answers added. Go to M4.10.2.
  2. f(x) = x + 4 and g(x) = 3x. Which is gf(x)?

    Tap your answer.
    1. Yes, that is right. gf(x) means g(f(x)). Put x + 4 into g: 3(x + 4). Multiply the bracket: 3x + 12.

    2. Not this one. That is fg(x), with g first. For gf(x) = g(f(x)), the function f goes first and 3 multiplies the whole of x + 4. Go to M4.10.2. Try another.

    3. Not this one. You multiplied only the 4 by 3. The 3 multiplies the whole bracket 3(x + 4), so the x gets multiplied too. Go to M3.8.4. Try another.

    See the answer

    3x + 12

    gf(x) means g(f(x)). Put x + 4 into g: 3(x + 4). Multiply the bracket: 3x + 12.

    • If you chose B: That is fg(x), with g first. For gf(x) = g(f(x)), the function f goes first and 3 multiplies the whole of x + 4. Go to M4.10.2.
    • If you chose C: You multiplied only the 4 by 3. The 3 multiplies the whole bracket 3(x + 4), so the x gets multiplied too. Go to M3.8.4.
  3. f(x) = 5x − 4. Which is the inverse f⁻¹(x)?

    Tap your answer.
    1. Not this one. You took away 4 again. To undo "take away 4" you must add 4. Go to M4.10.2. Try another.

    2. Not this one. That is 1 divided by f(x), the reciprocal. The inverse undoes f, which is not the same thing. Go to M4.10.2. Try another.

    3. Not this one. You undid the steps in the same order as f. Undo the last step first: add 4, then divide by 5. Go to M4.10.2. Try another.

    4. Yes, that is right. The steps of f are: multiply by 5, then take away 4. Undo them in reverse order: add 4, then divide by 5. That gives (x + 4)/5.

    See the answer

    (x + 4)/5

    The steps of f are: multiply by 5, then take away 4. Undo them in reverse order: add 4, then divide by 5. That gives (x + 4)/5.

    • If you chose A: You took away 4 again. To undo "take away 4" you must add 4. Go to M4.10.2.
    • If you chose B: That is 1 divided by f(x), the reciprocal. The inverse undoes f, which is not the same thing. Go to M4.10.2.
    • If you chose C: You undid the steps in the same order as f. Undo the last step first: add 4, then divide by 5. Go to M4.10.2.
  4. f(x) = 3x + 1. What is f⁻¹(16)?

    Tap your answer.
    1. Not this one. That is f(16), which puts 16 into f. For f⁻¹(16) you go back: which input gives the output 16? Go to M4.10.2. Try another.

    2. Not this one. The mark −1 on f does not mean 1 divided by f. It means the inverse, which undoes f. Go to M4.10.2. Try another.

    3. Yes, that is right. f⁻¹(16) is the input that f turns into 16. Undo the steps: 16 − 1 = 15, and 15 ÷ 3 = 5. Check: f(5) = 3 × 5 + 1 = 16.

    See the answer

    5

    f⁻¹(16) is the input that f turns into 16. Undo the steps: 16 − 1 = 15, and 15 ÷ 3 = 5. Check: f(5) = 3 × 5 + 1 = 16.

    • If you chose A: That is f(16), which puts 16 into f. For f⁻¹(16) you go back: which input gives the output 16? Go to M4.10.2.
    • If you chose B: The mark −1 on f does not mean 1 divided by f. It means the inverse, which undoes f. Go to M4.10.2.
  5. The picture shows the function fg: g adds 2, then f multiplies by 5. What is the output when the input is 4?

    A row of boxes joined by arrows. The first box is x. An arrow named + 2 leads to the box g(x). An arrow named × 5 leads to the box fg(x).x+ 2g(x)× 5fg(x)
    Tap your answer.
    1. Yes, that is right. Follow the arrows. First add 2: 4 + 2 = 6. Then multiply by 5: 6 × 5 = 30.

    2. Not this one. You multiplied first: 4 × 5 = 20, then added 2. The picture adds 2 first, then multiplies by 5. Go to M4.10.2. Try another.

    3. Not this one. You added 4 + 2 + 5. The last step is to multiply by 5, not to add 5. Go to M4.10.2. Try another.

    See the answer

    30

    Follow the arrows. First add 2: 4 + 2 = 6. Then multiply by 5: 6 × 5 = 30.

    • If you chose B: You multiplied first: 4 × 5 = 20, then added 2. The picture adds 2 first, then multiplies by 5. Go to M4.10.2.
    • If you chose C: You added 4 + 2 + 5. The last step is to multiply by 5, not to add 5. Go to M4.10.2.
  6. From an earlier chapter

    f(x) = 2x + 5. What is the input when the output is 11?

    Tap your answer.
    1. Not this one. That is f(11), with 11 put in as the input. Here 11 is the output, so write 2x + 5 = 11 and solve it. Go to M4.10.1. Try another.

    2. Yes, that is right. Write 2x + 5 = 11. Take away 5 from both sides: 2x = 6. Divide by 2: x = 3. Check: 2 × 3 + 5 = 11.

    3. Not this one. You took away 5 from 11 but did not divide by 2. Undo every step: 2x = 6, so x = 3. Go to M4.10.1. Try another.

    See the answer

    3

    Write 2x + 5 = 11. Take away 5 from both sides: 2x = 6. Divide by 2: x = 3. Check: 2 × 3 + 5 = 11.

    • If you chose A: That is f(11), with 11 put in as the input. Here 11 is the output, so write 2x + 5 = 11 and solve it. Go to M4.10.1.
    • If you chose C: You took away 5 from 11 but did not divide by 2. Undo every step: 2x = 6, so x = 3. Go to M4.10.1.
  7. f(x) = 4x − 3. Find f⁻¹(13).

    See the answer

    4

    The input that f turns into 13: write 4x − 3 = 13. Add 3: 4x = 16. Divide by 4: x = 4. Check: 4 × 4 − 3 = 13.

  8. f(x) = 2x and g(x) = x + 5. Find fg(3).

    See the answer

    16

    fg(3) means f(g(3)). First g(3) = 3 + 5 = 8. Then f(8) = 2 × 8 = 16.

Keep it

Copy this into your exercise book.

fg(x) means f(g(x)): g goes first. The order matters. The inverse f⁻¹ undoes f: reverse the steps. Check it by putting a number through f, then f⁻¹.

Draw: A machine with two rows: the steps of f going right, and the undone steps going back.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (956 KB). It opens on any phone.