Websink Prep UKGCSE MathsTextbook contentsMaths textbooksYear 1Year 2Year 4Year 5Year 6GCSEBrowse allPast papersFind a tutorBecome a tutor
GCSE Maths · EdexcelChapter 25 · Functions and advanced graphs
GCSE Maths · Functions and Advanced Graphs · Higher · Lesson 25.3

GCSE Maths: Composite functions (Higher)

Part of the GCSE Maths functions and advanced graphs chapter (Higher). Chapter overview · whole chapter on one page · Download worksheet (PDF) · Answers (PDF)

Download worksheet (PDF)Answers (PDF)
25.3

Composite functions

Edexcel 1MA1: A7
Grade 6-9

A composite function is made by joining two functions: the output of the first becomes the input of the second. Suppose g(x) = x + 2 and f(x) = 3x. If we send a number through g and then straight into f, we have one new function.

xg: add 2f: × 3fg(x)
The composite function fg(x). The function g acts first, then f acts on the result.

We write this composite function as fg(x), which means f(g(x)). Be careful about the order. The function nearest the x acts first. So fg(x) means “do g, then do f”. It is read from right to left, which feels backwards at first.

With a number. To find fg(4), first work out g(4) = 4 + 2 = 6, then put the 6 into f: f(6) = 18. So fg(4) = 18.

With algebra. To find fg(x) as one rule, replace the x in f by the whole of g(x), in brackets: f(x) = 3x becomes 3(x + 2) = 3x + 6. So fg(x) = 3x + 6. Check: 3 × 4 + 6 = 18. ✓

The order matters. If we do it the other way, gf(x) = g(f(x)) = 3x + 2, which is a different function. Usually fg and gf are not equal. A function composed with itself is written ff(x) or f2(x).

Solving. To solve an equation such as fg(x) = 20, first build the single function fg(x), then solve it like any other equation.

Inverse of a composite. To undo “do g, then f” you must undo f first and then g. So (fg)−1 = g−1f−1. The order reverses, just like taking off your shoes and then your socks.

Key ideas

  • fg(x) means f(g(x)): do g first, then f.
  • For a number: work out the inside first, then put that answer into the outside function.
  • For algebra: replace the x in the outer function by the whole inner function (in brackets), expand and simplify.
  • fg(x) and gf(x) are usually different. ff(x) means f applied twice.
  • To solve fg(x) = k: find fg(x) first, then solve the equation.
  • (fg)−1 = g−1f−1: the order reverses.
Worked example 25.3.1
f(x) = 3x − 2 and g(x) = x2. Work out fg(3).

Method. Work from the inside out: put the number into the function nearest it, then put that answer into the other function.

  1. Remember what fg(3) means. The function nearest the number, g, is applied first. Its output is then used as the input to f.
    fg(3) = f(g(3))
  2. Work out the inside: g(3). Put 3 into g.
    g(3) = 32 = 9
  3. Use that answer as the input to f: work out f(9). The output 9 goes into f.
    f(9) = 3 × 9 − 2 = 25
  4. Write the answer.
    fg(3) = 25

Check. Another way: find fg(x) = 3x2 − 2 first, then put in 3: 3 × 32 − 2 = 25. ✓

Watch out. fg(3) is not f(3) × g(3). It means f of (g of 3).

Worked example 25.3.2
f(x) = 2x + 3 and g(x) = x2 − 1. Find fg(x).

Key words. A composite function is two functions joined: the output of the first becomes the input of the second.

Method. fg(x) means: do g first, then f. Replace the x in the outer function by the whole inner function.

  1. Remember what fg(x) means. fg(x) is the same as f(g(x)). The function written closest to the x (g) is applied first, then f is applied to the result.
    fg(x) = f(g(x))
  2. Write down the two functions.
    g(x) = x2 − 1
    f(x) = 2x + 3
  3. Put g(x) into f: replace the x in f(x) with x2 − 1. g(x) is the output of the first function, and it becomes the input of f. Use brackets.
    fg(x) = 2(x2 − 1) + 3
  4. Expand the brackets. Multiply out each bracket, one term at a time.
    2(x2 − 1) = 2x2 − 2
  5. Simplify. Collect like terms.
    fg(x) = 2x2 + 1

Check. Test with x = 2: g(2) = 3, then f(3) = 9. The answer gives 2 × 22 + 1 = 9. They match. ✓

Watch out. Order matters: fg(x) and gf(x) are usually different. The function nearest the x goes first.

Worked example 25.3.3
f(x) = 2x + 3 and g(x) = x2 − 1. Find gf(x). Is gf(x) the same as fg(x)?

Key words. A composite function is two functions joined: the output of the first becomes the input of the second.

Method. gf(x) means: do f first, then g. Replace the x in the outer function by the whole inner function.

  1. Remember what gf(x) means. gf(x) is the same as g(f(x)). The function written closest to the x (f) is applied first, then g is applied to the result.
    gf(x) = g(f(x))
  2. Write down the two functions.
    f(x) = 2x + 3
    g(x) = x2 − 1
  3. Put f(x) into g: replace the x in g(x) with 2x + 3. f(x) is the output of the first function, and it becomes the input of g. Use brackets.
    gf(x) = (2x + 3)2 − 1
  4. Expand the brackets. Multiply out each bracket, one term at a time.
    (2x + 3)2 = 4x2 + 12x + 9
  5. Simplify. Collect like terms.
    gf(x) = 4x2 + 12x + 8

Check. Test with x = 2: f(2) = 7, then g(7) = 48. The answer gives 4 × 22 + 12 × 2 + 8 = 48. They match. ✓

Watch out. Order matters: fg(x) and gf(x) are usually different. The function nearest the x goes first.

Worked example 25.3.4
f(x) = 3x − 1 and g(x) = x2 + 2. Solve fg(x) = 32.

Method. First find fg(x) by putting the inner function into the outer one. Then solve fg(x) = 32 as an ordinary equation.

  1. Remember what fg(x) means. fg(x) is the same as f(g(x)). The function written closest to the x (g) is applied first, then f is applied to the result.
    fg(x) = f(g(x))
  2. Write down the two functions.
    g(x) = x2 + 2
    f(x) = 3x − 1
  3. Put g(x) into f: replace the x in f(x) with x2 + 2. g(x) is the output of the first function, and it becomes the input of f. Use brackets.
    fg(x) = 3(x2 + 2) − 1
  4. Expand the brackets. Multiply out each bracket, one term at a time.
    3(x2 + 2) = 3x2 + 6
  5. Simplify. Collect like terms.
    fg(x) = 3x2 + 5
  6. Write the equation. We are told that the output is 32, so fg(x) = 32. Put the rule in for fg(x).
    3x2 + 5 = 32
  7. Subtract 5 from both sides. The last thing that happens to the x-part is that 5 is added. The opposite of adding 5 is subtracting 5. Do it to both sides to keep the equation balanced.
    3x2 = 27
  8. Divide both sides by 3. The unknown part is being multiplied by 3. The opposite of multiplying by 3 is dividing by 3.
    x2 = 9
  9. Take the square root of both sides. Remember the positive and negative roots. Both 3 and −3 square to give 9.
    x = 3 or x = −3
  10. Finish each equation. Solve each of the two equations with inverse operations.
    x = 3
    x = −3

Check. Test: fg(−3) = 3 × (−3)2 + 5 = 32; fg(3) = 3 × 32 + 5 = 32. ✓

Watch out. Do not put the number k into the functions one at a time. Build the single function first.

Worked example 25.3.5
f(x) = x + 2 and g(x) = 3x. Find (fg)−1(x), and show that it equals g−1f−1(x).

Method. Find fg(x), then invert it. Then find the two separate inverses and compose them in the reverse order.

  1. Find fg(x). Replace the x in f by g(x) = 3x.
    fg(x) = 3x + 2
  2. Invert it: y = 3x + 2. Subtract 2 from both sides, then divide by 3.
    y − 2 = 3x  ⇒  x = y − 23
  3. Write the inverse.
    (fg)−1(x) = x − 23
  4. Find the inverses of f and g separately. Reverse each operation.
    f−1(x) = x − 2 and g−1(x) = x ÷ 3
  5. Compose in the reverse order: g−1f−1(x). First undo f (subtract 2), then undo g (divide by 3).
    g−1(x − 2) = (x − 2) ÷ 3 = x − 23
  6. Compare. The two answers are the same.
    (fg)−1 = g−1f−1 ✓

Check. fg(5) = 3 × 5 + 2 = 17, and (fg)−1(17) = (17 − 2) ÷ 3 = 5. ✓

Watch out. If you apply the inverses in the same order as the functions (f−1 first) you get a different, wrong answer.

Watch out

The function nearest the x acts first. fg(2) is not f(2) × g(2) and it is not g(f(2)). It is f(g(2)): work out g(2) first. And when you replace x in the outer function, put brackets round the inner function: 3(x + 2) = 3x + 6, but 3x + 2 is wrong.

Exercise 25C  Composite functions

Non-calculator
1
Ff(x) = 2x + 1 and g(x) = x2. Work out
(a)fg(3)
(b)gf(3)
(c)ff(2)
(d)gg(−2)
2
Ff(x) = x − 4 and g(x) = 3x. Find, in its simplest form,
(a)fg(x)
(b)gf(x)
3
Ff(x) = x + 5 and g(x) = x2 − 1. Find, in its simplest form,
(a)fg(x)
(b)gf(x)
4
Ff(x) = 3x − 2 and g(x) = x2. Find
(a)fg(x)
(b)gf(x)
5
FFind ff(x) and gg(x) in each case.
(a)f(x) = 2x + 3:  ff(x)
(b)g(x) = x2:  gg(x)
(c)h(x) = 1 − 2x:  hh(x)
6
Ff(x) = 2x + 1 and g(x) = x − 3. Solve fg(x) = 9.
7
PSf(x) = x + 1 and g(x) = x2 − 1. Solve gf(x) = 15.
8
R(a) f(x) = x + 3 and g(x) = x − 5. Show that fg(x) = gf(x). (b) p(x) = 2x and q(x) = x + 1. Show that pq(x) ≠ qp(x).
9
PSA shop reduces all prices by 20% and then a 20% tax is added. Let p be the original price in pounds. (a) Write the reduction as f(x) = 0.8x and the tax as g(x) = 1.2x. Find gf(x). (b) Is the final price the same as the original price? Work out the final price of an item that originally cost £50.
10
PSf(x) = 1 ÷ x and g(x) = x + 2. Find, as simply as possible,
(a)fg(x)
(b)gf(x)
11
PSf(x) = √x and g(x) = x − 4.
(a)Work out fg(13).
(b)Work out fg(20).
(c)Find fg(x).
12
Rf(x) = 2x + 1 and fg(x) = 6x + 7. Find g(x).
13
RAisha says: “fg(2) means f(2) × g(2).” With f(x) = x + 3 and g(x) = x2, work out fg(2) and f(2) × g(2) to show that Aisha is wrong.
14
PSf(x) = 3x + 2 and g(x) = x2 + k, where k is a constant. Given that fg(1) = 20, find the value of k.
15
Rf(x) = 2x + a and g(x) = 3x + 4. Given that fg(x) = gf(x) for all x, find the value of a.
16
Rf(x) = x + 1, g(x) = 2x and h(x) = x2. Find hgf(x), giving your answer in its simplest expanded form.

Websink Prep UK is an independent site. It is not affiliated with, endorsed by or sponsored by AQA, Pearson Edexcel, OCR, WJEC, Eduqas, CCEA, SQA, GL Assessment, CEM or the Department for Education. All exam board names and trademarks belong to their owners. Past papers are linked from the exam boards' own websites and are not hosted here.

About Websink Prep UK · Find a tutor · Privacy · Terms · Cookie settings