Composite Functions fg(x), gf(x) and f²(x): Order Matters | Cambridge IGCSE Further Maths notes

Free preview: Composite Functions fg(x), gf(x) and f²(x): Order Matters

Two Machines in a Row

Cambridge Additional Maths

Put on socks, then shoes: fine. Put on shoes, then socks: a very different result. Doing two things in a row depends on the order. Functions are the same.

What a composite function is

  • A composite function is two functions done one after the other: the output of the first becomes the input of the second.
  • fg(x) means f(g(x)): do g first, then f.
  • gf(x) means g(f(x)): do f first, then g.
  • f2(x) means ff(x)=f(f(x)): do f twice.

fg(x)=f(g(x))the function next to the x acts first

Why does g go first when f is written first? Think of brackets: in f(g(x)) you work out the inside bracket g(x) before anything else.

Composite Functions fg(x), gf(x) and f²(x): Order Matters diagram

What the picture shows

  1. The same two machines: f adds 3 and g squares.
  2. Top row, fg(2): g first gives 22=4, then f gives 4+3=7.
  3. Bottom row, gf(2): f first gives 2+3=5, then g gives 52=25.
  4. 7 is not 25. So in general fg is not the same as gf.

Recipe: a composite with a number

  1. Find the function next to the number. That one acts first.
  2. Work it out and write the answer down.
  3. Feed that answer into the next function.
  4. For three letters, like fgh(2), work from right to left: h, then g, then f.

👀 Watch me do it: find fg(3), gf(3) and f2(3) where f(x)=5−x and g(x)=12x, x≠0

What I writeWhy I do it
g(3)=4, then f(4)=1. So fg(3)=1.g is next to the 3, so g acts first.
f(3)=2, then g(2)=6. So gf(3)=6.Now f acts first.
f(3)=2, then f(2)=3. So f2(3)=3.f twice.

💡 In plain words

  • fg: g first, then f. Read it from the right.
  • Swapping the order usually changes the answer.
  • f2 is f done twice, not a square.

✏️ YOUR TURN 1

Try this first:

f(x)=2x−1 and g(x)=x2+3. Find (a) fg(2) (b) gf(2) (c) f2(2) (d) g2(1).

Answer:

  • (a) g(2)=7, f(7)=13.
  • (b) f(2)=3, g(3)=12.
  • (c) f(2)=3, f(3)=5.
  • (d) g(1)=4, g(4)=19.

✏️ YOUR TURN 2

Try this first:

f(x)=x+1, g(x)=3x and h(x)=x2. Find fgh(2) and hgf(2).

Answer:

  • fgh(2): h first: h(2)=4, then g(4)=12, then f(12)=13.
  • hgf(2): f first: f(2)=3, then g(3)=9, then h(9)=81.

Forming fg(x), gf(x) and f²(x) with Algebra

Now we feed in a whole expression instead of a number. The idea is the same: replace every x in the outer function by the inner function, in brackets.

Recipe: forming fg(x)

  1. Write the outer function (f, for fg) with an empty bracket wherever x was.
  2. Fill each bracket with the whole of g(x).
  3. Simplify: expand and collect like terms.

👀 Watch me do it: form fg(x), gf(x) and f2(x) where f(x)=3x−1 and g(x)=x2+2

What I writeWhy I do it
fg(x)=3(x2+2)−1Outer is f: 3( ) − 1. Fill the bracket with g(x).
=3x2+5Expand: 3x2+6−1.
gf(x)=(3x−1)2+2Outer is g: ( )² + 2. Fill with f(x).
=9x2−6x+3Expand: 9x2−6x+1+2.
f2(x)=3(3x−1)−1=9x−4Outer is f, filled with f(x).
Check x = 1: g(1)=3, f(3)=8 and 3(1)+5=8. ✓Always test one number.

Notice 3x2+5 and 9x2−6x+3 are different expressions. That is the algebra version of "order matters".

Unlock the full note: start 7 days free.

Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.

Log in · Subscribe · Start free trial

All notes in Inverse and Composite Functions

  1. Finding f⁻¹(x) and Reflecting a Graph in y = x
  2. Composite Functions fg(x), gf(x) and f²(x): Order Matters

What's inside for this topic

2 teacher notes, 34 practice questions, 30 flashcards, 2 quizzes.

Get the full notes, every practice question, flashcards, quizzes and mock papers.

Start your free 7-day trial

Questions? Chat with us on WhatsApp · Try one live lesson

Previous note: Finding f⁻¹(x) and Reflecting a Graph in y = x

All Cambridge IGCSE Further Maths topics · IGCSE Further Maths