GCSE · Algebra

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(4) = 3 × 4 − 5 = 7.
f(−2) = 3 × (−2) − 5 = −6 − 5 = −11.
f(x) = 13: 3x − 5 = 13, 3x = 18, x = 6. Check: f(6) = 13 ✓
f(x) = 2x + 1 and g(x) = x². Find fg(3) and gf(3). Higher
fg(3): g first. g(3) = 9. Then f(9) = 2 × 9 + 1 = 19.
gf(3): f first. f(3) = 7. Then g(7) = 49. So gf(3) = 49.
Different answers: the order matters.
With the same f and g, find fg(x) and gf(x) Higher
fg(x) = f(g(x)) = f(x²): replace the x in 2x + 1 by x²: 2x² + 1.
gf(x) = g(f(x)) = g(2x + 1): square the whole thing: (2x + 1)² = 4x² + 4x + 1.
Check with x = 3: 2(9) + 1 = 19 ✓ and 36 + 12 + 1 = 49 ✓
f(x) = 2x + 1 and g(x) = x². Solve fg(x) = 51. Higher
Expression: fg(x) = 2x² + 1.
Solve: 2x² + 1 = 51 → 2x² = 50 → x² = 25 → x = 5 or x = −5.
f(x) = 2x + 1. Find ff(x). Higher
f(f(x)) = f(2x + 1) = 2(2x + 1) + 1 = 4x + 2 + 1 = 4x + 3.
f(x) = (2x + 1)/4. Find f⁻¹(x). Higher
Write y =: y = (2x + 1)/4.
Swap x and y: x = (2y + 1)/4.
Rearrange: × 4: 4x = 2y + 1; − 1: 4x − 1 = 2y; ÷ 2: y = (4x − 1)/2.
Answer: f⁻¹(x) = (4x − 1)/2. Check: f(3) = 7/4 and f⁻¹(7/4) = (7 − 1)/2 = 3 ✓
f(x) = 3/(x − 1). Find f⁻¹(x). Higher
Swap: x = 3/(y − 1).
Multiply by (y − 1): x(y − 1) = 3. Divide by x: y − 1 = 3/x.
Answer: f⁻¹(x) = 3/x + 1. Check: f(4) = 1, and f⁻¹(1) = 3 + 1 = 4 ✓

Quick check

What you've learned