Functions: Composite and Inverse Higher
A function is a rule that turns each input into exactly one output, like a machine. Join two machines end to end and you get a composite function. Run a machine backwards and you get its inverse. This page builds both ideas from function machines and then does them with algebra.
GCSE subject content: interpret simple expressions as functions with inputs and outputs; Higher: interpret the reverse process as the "inverse function" and the succession of two functions as a "composite function"; use function notation f(x), fg(x), f⁻¹(x)Before you start. You'll need substitution (putting numbers into expressions; see Substitution), expanding brackets (Double brackets) and rearranging formulae to change the subject (Rearranging formulae). Inverse operations undo each other: + and −, × and ÷, squaring and square-rooting.
1 · Function machines
A function machine applies operations in order. Put x in, and the machine builds an expression step by step. Build your own machine below: add operations one at a time, then slide the input and watch the number flow through. Notice where brackets appear: "add 3 then multiply by 2" gives 2(x + 3), not 2x + 3.
2 · Function notation: f(x)
Instead of drawing the machine, we give the function a name, usually f, and write f(x) = 3x − 5. Read "f of x". Then f(4) means "the output when the input is 4": replace every x with 4. Questions also ask you to solve f(x) = 13: that means "which input gives output 13?", an ordinary equation.
f(x) is not f × x. The brackets show the input, they don't mean multiply. And with negatives use brackets when you substitute: if f(x) = x² + 1 then f(−3) = (−3)² + 1 = 10, not −9 + 1.
3 · Composite functions: fg(x) Higher
A composite function joins two machines: the output of the first becomes the input of the second. fg(x) means f(g(x)): do g first, then f. Read it from the inside out, the function nearest the x goes first. The order matters: fg(x) and gf(x) are usually different. Compare them below.
Common mistakes. Doing f first in fg(x). Multiplying: fg(3) is not f(3) × g(3). And when you substitute an expression, put it in a bracket: if f(x) = 2x + 1 and g(x) = x − 3, then fg(x) = 2(x − 3) + 1 = 2x − 5.
4 · ff(x), and equations with composites Higher
ff(x) means put x through f twice: f(f(x)). Questions also ask you to solve an equation like fg(x) = 51: find fg(x) as an expression first, then solve. Try these; the feedback spots the order mistake.
5 · Inverse functions: run the machine backwards Higher
The inverse function f⁻¹(x) undoes f: if f turns 4 into 7, then f⁻¹ turns 7 back into 4. To build it, reverse the machine: do the inverse operations in the reverse order, like taking off your shoes before your socks. (The ⁻¹ is a label, not a power: f⁻¹(x) does not mean 1 ÷ f(x).)
6 · Finding f⁻¹(x) algebraically Higher
For any function you can find the inverse with algebra: write y = f(x), swap x and y, then rearrange to make y the subject. (Swapping x and y is exactly why the graph of y = f⁻¹(x) is the reflection of y = f(x) in the line y = x.) Always check: f⁻¹(f(a)) should give back a.
Worked examples
f(x) = 3x − 5. Find f(4), f(−2), and solve f(x) = 13.
f(x) = 2x + 1 and g(x) = x². Find fg(3) and gf(3). Higher
With the same f and g, find fg(x) and gf(x) Higher
f(x) = 2x + 1 and g(x) = x². Solve fg(x) = 51. Higher
f(x) = 2x + 1. Find ff(x). Higher
f(x) = (2x + 1)/4. Find f⁻¹(x). Higher
f(x) = 3/(x − 1). Find f⁻¹(x). Higher
Quick check
What you've learned
- A function turns each input into one output. f(4) means "substitute 4 for x"; solving f(x) = k means finding the input that gives k.
- Higher fg(x) = f(g(x)): do g first (the one nearest x), then f. Order matters. Substitute whole expressions in brackets.
- Higher ff(x) applies f twice.
- Higher f⁻¹(x) undoes f: reverse the machine (inverse operations, reverse order), or write y = f(x), swap x and y, and make y the subject. f⁻¹ is not 1/f.
- Higher The graph of y = f⁻¹(x) is the reflection of y = f(x) in the line y = x.