The idea of a composite
You already know a function is a machine: a number goes in, a number comes out. A composite function is what you get when you line up two machines and feed the output of the first straight into the second. The whole pair acts like one bigger machine.
- Composite function
- A function made by applying one function and then another. We write \(fg(x)\) to mean "do \(g\) first, then put its output into \(f\)". It can also be written \(f(g(x))\).
The notation catches many students out, so read it carefully. In \(fg(x)\), the function nearer the \(x\), which is \(g\), acts first. Then \(f\) acts on the result. Working from the inside bracket outwards, \(f(g(x))\), makes the order obvious: you cannot work out the outer \(f\) until you know \(g(x)\).
Where this is assessed
Knowing what \(fg(x)\) means and building it is Criterion A (knowing and understanding). Setting out each substitution clearly is Criterion C (communicating), and choosing the right order to model a two-step process reaches into Criterion D (applying maths in context).
Finding \(fg(x)\)
There are two neat ways to work with a composite, and both are worth knowing.
If you only need one value, do it in stages. Take \(f(x) = 3x - 1\) and \(g(x) = x + 4\), and find \(fg(2)\). First do \(g\): \(g(2) = 2 + 4 = 6\). Then put that \(6\) into \(f\): \(f(6) = 3(6) - 1 = 17\). So \(fg(2) = 17\).
If you need a general rule, substitute the whole of \(g(x)\) into \(f\) wherever \(x\) appears. With the same functions,
Now any value drops straight in: \(fg(2) = 3(2) + 11 = 17\), matching the staged answer.
Inside out
Always evaluate the inner bracket first. For a single number, the staged method is quickest and hardest to slip up on. Build the general rule only when the question actually asks for \(fg(x)\) as an expression.
Order matters
Swapping the order usually gives a different function. \(fg(x)\) means "\(g\) then \(f\)", while \(gf(x)\) means "\(f\) then \(g\)". These are rarely the same.
Keep \(f(x) = 3x - 1\) and \(g(x) = x + 4\). We found \(fg(2) = 17\). Now try the other order: \(gf(2)\). Do \(f\) first: \(f(2) = 3(2) - 1 = 5\). Then \(g\): \(g(5) = 5 + 4 = 9\). So \(gf(2) = 9\), which is not \(17\). Same two functions, same input, different answer, all because of the order.
Given \(f(x) = 2x + 3\) and \(g(x) = x^2\), find \(fg(x)\) and \(gf(x)\), then show they are different at \(x = 1\).
Check yourself
Try these before opening the answers. Show the working, not just the final value.
1. If \(f(x) = x + 3\) and \(g(x) = 2x\), find \(fg(4)\). +
Do \(g\) first: \(g(4) = 2(4) = 8\). Then \(f\): \(f(8) = 8 + 3 = 11\). So \(fg(4) = 11\).
2. If \(f(x) = 2x\) and \(g(x) = x - 5\), find \(gf(3)\). +
\(gf\) means do \(f\) first: \(f(3) = 2(3) = 6\). Then \(g\): \(g(6) = 6 - 5 = 1\). So \(gf(3) = 1\).
3. With \(f(x) = x^2\) and \(g(x) = x + 1\), show that \(fg(2)\) and \(gf(2)\) are different. +
\(fg(2)\): do \(g\) first, \(g(2) = 3\), then \(f(3) = 3^2 = 9\). \(gf(2)\): do \(f\) first, \(f(2) = 4\), then \(g(4) = 4 + 1 = 5\). Since \(9 \neq 5\), the order changes the answer.
Part of the Standard Maths library. Spotted an error or want a topic added? That feedback makes the notes better.