Skip to content
MathClicksIGCSE← All notes Cambridge IGCSE® Mathematics 0580 Extended Chapter 22 — More Equations, Formulae and Functions

22.1  Functions and Function Notation

Reading f(x) with confidence — evaluating functions, building composite functions like gf(x), and finding inverse functions, exactly the way Paper 2 asks for them.

A function is a machine

A function is a rule that takes an input, does something definite to it, and hands back exactly one output. Think of it as a machine: you drop a number in the top, the machine applies its rule, and one number drops out of the bottom. The whole of this topic — evaluating, composing, inverting — is just asking sensible questions about that machine.

Key idea f(x) = 3x − 5 is read “f of x equals 3x minus 5”. It means: the function is called f, the input is called x, and the rule is “multiply by 3, then subtract 5”. f(x) is the output — it does not mean f multiplied by x.

Cambridge writes the same function in two ways, and you must recognise both:

Function notation

f(x) = 3x − 5

The everyday form. f(4) means “the output when the input is 4”.

Mapping notation

f : x ↦ 3x − 5

Read “f maps x to 3x minus 5”. Exactly the same rule, just written with the mapping arrow. Paper 2 occasionally uses this form, so do not let it throw you.

Domain and range

The domain is the set of inputs the function is allowed to take. The range is the set of outputs it actually produces. A mapping diagram shows both at once: every element of the domain fires exactly one arrow into the range.

Mapping diagram for f(x) = 2x + 1 with domain {1, 2, 3, 4}

f(x) = 2x + 1 1 2 3 4 3 5 7 9 Domain (inputs) Range (outputs)
Why “exactly one output” matters A rule that sends one input to two different outputs is not a function. That is why f(x) = x² is a fine function (every input gives one square) even though two different inputs, 3 and −3, can share the output 9. Arrows may arrive together; they may never leave together. With domain {−2, −1, 0, 1, 2}, the range of f(x) = x² is {0, 1, 4} — list each output once only.

Evaluating f(x) — numbers, letters, expressions

To evaluate a function, substitute the input in place of every x in the rule. That is the whole method — but Paper 2 tests it three ways: with a number, with an expression like 2a or x + 1, and in reverse, where you are told the output and must solve for the input.

Exam tip Always substitute in brackets: for f(−2) write 3(−2) − 5, not 3 × −2 − 5. The bracket habit is what stops sign errors, and the mark scheme awards the method mark for exactly that substitution line.
Example 1f(x) = 3x − 5. Find (a) f(4), (b) f(−2), and (c) solve f(x) = 16.
1
(a) Replace x with 4. f(4) = 3(4) − 5 = 12 − 5 = 7
2
(b) Replace x with −2, keeping the brackets. f(−2) = 3(−2) − 5 = −6 − 5 = −11
3
(c) “Solve f(x) = 16” means: which input gives output 16? Set the rule equal to 16 and solve the equation. 3x − 5 = 16
3x = 21
x = 7
(a) f(4) = 7    (b) f(−2) = −11    (c) x = 7
Spot the direction Part (a) goes input → output (substitute). Part (c) goes output → input (solve an equation). Read the question carefully to see which way you are travelling.
Example 2f(x) = 3x − 5. Find and simplify (a) f(2a) and (b) f(x + 1).
1
(a) The input is the whole expression 2a. Substitute it for x in brackets. f(2a) = 3(2a) − 5 = 6a − 5
2
(b) Same idea with x + 1 — the bracket is essential, because the whole of x + 1 is multiplied by 3. f(x + 1) = 3(x + 1) − 5
3
Expand and collect. = 3x + 3 − 5 = 3x − 2
f(2a) = 6a − 5    f(x + 1) = 3x − 2
Classic error Writing f(x + 1) = 3x + 1 − 5 — forgetting that the 3 multiplies the whole input. If the bracket is missing, the method mark usually goes with it.

Function machine playground

Two linear machines: f(x) = ax + b and g(x) = cx + d. Change any number and watch f, g, gf, fg and f−1 recompute step by step. Try a = 2, c = 3, then swap them — is gf still the same as fg?

Composite functions — gf(x) means g(f(x))

A composite function chains two machines together: the output of the first becomes the input of the second. The notation is the part students misread, so learn it cold:

gf(x) = g(f(x))   —   do f FIRST, then g Read composites from right to left, like brackets from the inside out

gf(x) is not g times f. The function written closest to the x acts first, exactly as in g(f(x)) the inner bracket is evaluated first.

The chain for gf(x), where f(x) = 2x + 1 and g(x) = x²

x f ×2 then +1 2x+1 g square it (2x+1)² Try x = 2:  2 → f gives 5 → g gives 25 gf means: f first, then g
Example 3f(x) = 2x + 1 and g(x) = x². Find (a) gf(x), (b) fg(x), and (c) show that gf(2) ≠ fg(2).
1
(a) gf(x) = g(f(x)): feed the whole of f(x) into g, i.e. square the whole of 2x + 1. gf(x) = g(2x + 1) = (2x + 1)²
2
(b) fg(x) = f(g(x)): feed x² into f — double it, add 1. fg(x) = f(x²) = 2x² + 1
3
(c) Substitute x = 2 into each. gf(2) = (2(2) + 1)² = 5² = 25
fg(2) = 2(2)² + 1 = 8 + 1 = 9
gf(x) = (2x + 1)²    fg(x) = 2x² + 1    25 ≠ 9
Order matters fg and gf are different functions almost always. If a question asks for fg(x) and you compute gf(x), every mark is gone — read the order twice before you start.
Numbers first, algebra second For a numeric composite like gf(3) you do not need the algebraic formula. Work in two quick stages: f(3) = 7, then g(7) = 49. Building gf(x) and then substituting gives the same answer but twice the opportunity for slips.

Inverse functions — the machine in reverse

The inverse function f−1(x) undoes f: it takes each output back to the input it came from. If f(4) = 7, then f−1(7) = 4. Running the machine backwards means undoing each operation, in the reverse order, with the opposite operation.

Watch out f−1(x) does not mean 1f(x). The little −1 is a label meaning “inverse”, not a power. For f(x) = 3x − 5, the reciprocal is 13x − 5 but the inverse is x + 53 — completely different objects.

Two reliable methods — use whichever feels natural, they always agree:

Method 1: swap and solve

  1. Write y = f(x).
  2. Rearrange to make x the subject.
  3. Swap the letters: replace y with x. The result is f−1(x).

Method 2: reverse the flow

List the operations f performs, then undo them backwards.

f(x) = 3x − 5:  ×3, then −5.
Reverse: +5, then ÷3, so f−1(x) = x + 53.

f−1(f(x)) = x   and   f(f−1(x)) = x The built-in checking device — a function composed with its inverse changes nothing
Example 4Find f−1(x) for f(x) = 3x − 25, and check your answer.
1
Write y for f(x). y = (3x − 2)/5
2
Make x the subject: multiply by 5, add 2, divide by 3. 5y = 3x − 2
5y + 2 = 3x
x = (5y + 2)/3
3
Swap the letter: replace y with x and rename. f⁻¹(x) = (5x + 2)/3
4
Check by composing: substitute f−1(x) into f. f(f⁻¹(x)) = (3 × (5x + 2)/3 − 2)/5
= (5x + 2 − 2)/5 = 5x/5 = x ✓
f−1(x) = 5x + 23
Exam tip The check costs 20 seconds and catches nearly every rearranging slip. If f(f−1(x)) does not simplify to plain x, go back to step 2.

More worked examples

Example 5f(x) = 3x + 2 and g(x) = x − 52. Find fg(x), giving your answer as a fraction in its simplest form.
1
fg(x) = f(g(x)): the whole of g(x) goes in place of x inside f. fg(x) = 3 / ( (x − 5)/2 + 2 )
2
Tidy the denominator by writing 2 as 4/2 so the two parts combine. (x − 5)/2 + 4/2 = (x − 1)/2
3
Dividing by a fraction means multiplying by its reciprocal. fg(x) = 3 ÷ (x − 1)/2 = 3 × 2/(x − 1)
4
Multiply out the numerator. State the value x cannot take, since the denominator must not be zero. fg(x) = 6/(x − 1),  x ≠ 1
fg(x) = 6x − 1  (x ≠ 1)
Mark-scheme language “Simplest form” means one single fraction with no fraction inside a fraction. Leaving the answer as 3 ÷ ((x − 5)/2 + 2) earns the method marks only.
Example 6f(x) = 2x − 3 and g(x) = 5x + 1. Find (a) gf(x), (b) (gf)−1(x), and (c) show that (gf)−1(x) = f−1g−1(x).
1
(a) Build the composite: f first, then g. gf(x) = g(2x − 3) = 5(2x − 3) + 1 = 10x − 14
2
(b) Invert the composite with swap-and-solve. y = 10x − 14
y + 14 = 10x
(gf)⁻¹(x) = (x + 14)/10
3
(c) Find the two separate inverses first. f⁻¹(x) = (x + 3)/2    g⁻¹(x) = (x − 1)/5
4
Compose them in the order f−1 after g−1 — note the order has reversed compared with gf. f⁻¹g⁻¹(x) = f⁻¹( (x − 1)/5 )
= ( (x − 1)/5 + 3 ) / 2
= (x − 1 + 15)/10 = (x + 14)/10 ✓
gf(x) = 10x − 14    (gf)−1(x) = x + 1410
Exam trap To undo “f then g” you must undo g first — socks on, shoes on; shoes off, socks off. Writing g−1f−1 instead of f−1g−1 is the classic final-part error on Paper 2 — and remember f−1 never means 1/f.

Your turn

Practice set

  1. f(x) = 4x + 1. Find f(3), f(−2) and f(½).
  2. g(x) = 5 − 2x. Solve g(x) = 11.
  3. f(x) = 3x − 5 and g(x) = x + 2. Find fg(x) and gf(x), both simplified.
  4. f(x) = x + 72. Find f−1(x).
  5. h(x) = 2x² + 3. Solve h(x) = 21, giving all solutions.

  1. f(3) = 4(3) + 1 = 13;  f(−2) = 4(−2) + 1 = −7;  f(½) = 4(½) + 1 = 2 + 1 = 3
  2. 5 − 2x = 11 → −2x = 6 → x = −3
  3. fg(x) = 3(x + 2) − 5 = 3x + 1;  gf(x) = (3x − 5) + 2 = 3x − 3 — different, as expected.
  4. y = (x + 7)/2 → 2y = x + 7 → x = 2y − 7 → f⁻¹(x) = 2x − 7
  5. 2x² + 3 = 21 → 2x² = 18 → x² = 9 → x = 3 or x = −3 — a square root in a solve step gives two answers; giving only x = 3 loses the final mark.

Key points to remember

  • f(x) is the output when x goes in — it is never f multiplied by x.
  • To evaluate, substitute in brackets for every x: f(−2) = 3(−2) − 5.
  • “Solve f(x) = k” means set the rule equal to k and solve the equation for x.
  • gf(x) = g(f(x)): the function nearest x acts first, and usually fg ≠ gf.
  • To find f⁻¹: write y = f(x), make x the subject, swap the letters.
  • f⁻¹(x) is the inverse, not the reciprocal — it is not 1/f(x).
  • Check every inverse with f(f⁻¹(x)) = x; the domain is the set of inputs, the range the set of outputs.

Where next?

✅ Mark scheme All notes

Progress is saved on this device only and appears on the notes home page.