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.
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.
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).
- fg(4) means f(g(4)). Work out g(4) first.
- g(4) = 4 + 3 = 7.
- Now put 7 into f: f(7) = 2 × 7.
- 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).
- gf(4) means g(f(4)). Work out f(4) first.
- f(4) = 2 × 4 = 8.
- Now put 8 into g: g(8) = 8 + 3.
- g(8) = 11.
- 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).
- fg(x) means f(g(x)). Put g(x) into f.
- g(x) = x − 3, so f(g(x)) = 2(x − 3) + 1.
- Multiply the bracket: 2 × x = 2x, and 2 × (−3) = −6.
- So the line reads 2x − 6 + 1.
- Collect the numbers: −6 + 1 = −5.
- 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⁻¹.
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 Write the steps of f in order: multiply by 2, then add 1.
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 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).
- Write y = 3x − 2.
- Add 2 to both sides to undo the take away: 3x = y + 2.
- Divide both sides by 3: x = (y + 2)/3.
- 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.
- First f(4) = 3 × 4 − 2 = 10.
- Now put 10 into the inverse: f⁻¹(10) = (10 + 2)/3.
- Add on the top: 10 + 2 = 12.
- Divide: 12 ÷ 3 = 4.
- 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
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.
- Start with the number 5. Add 3, then multiply the result by 2. Write the answer.
- Start with 5 again. This time multiply by 2 first, then add 3. Write the answer.
- 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.
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.
f(x) = 3x + 1 and g(x) = x². Find fg(2).
See the answer
13
fg(2) means f(g(2)). First g(2) = 2² = 4. Then f(4) = 3 × 4 + 1 = 13.
f(x) = x + 4 and g(x) = 3x. Which is gf(x)?
See the answer
3x + 12
gf(x) means g(f(x)). Put x + 4 into g: 3(x + 4). Multiply the bracket: 3x + 12.
f(x) = 5x − 4. Which is the inverse f⁻¹(x)?
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.
f(x) = 3x + 1. What is f⁻¹(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.
The picture shows the function fg: g adds 2, then f multiplies by 5. What is the output when the input is 4?
See the answer
30
Follow the arrows. First add 2: 4 + 2 = 6. Then multiply by 5: 6 × 5 = 30.
From an earlier chapter
f(x) = 2x + 5. What is the input when the output is 11?
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.
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.
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.