Algebra

Functions

21 past-paper questions, easiest first. Try each one, then reveal the answer.

Foundation & Higher7 of 21 from Foundation papers

Revision guide by The Full Marks

Functions: what you need to know

A function takes an input, does something to it and gives an output. Foundation questions use number machines and word formulae; Higher questions use function notation, inverse functions and composite functions, which are usually aimed at grades 7–8.

Foundation students need number machines and simple input–output functions; function notation, inverse and composite functions are Higher only.

Key facts

  • f(x)=3x−2f(x) = 3x - 2 means "multiply by 3, then subtract 2". f(4)f(4) means put 4 in: f(4)=10f(4) = 10.
  • The inverse f−1(x)f^{-1}(x) undoes ff: it takes the output back to the input.
  • fg(x)fg(x) means do gg first, then ff: fg(x)=f(g(x))fg(x) = f(g(x)).
  • For the inverse of a composite, such as (fg)−1(x)(fg)^{-1}(x), first write fg(x)fg(x) as one expression, then find its inverse in the usual way: for f(x)=3x−2f(x) = 3x - 2 and h(x)=x+5h(x) = x + 5, fh(x)=3x+13fh(x) = 3x + 13, so (fh)−1(x)=x−133(fh)^{-1}(x) = \frac{x - 13}{3}.
  • To find f(x+2)f(x + 2), replace every xx in ff with (x+2)(x + 2) in brackets, then expand and simplify.
  • To go backwards through a number machine, do the inverse operations in reverse order.

Finding an inverse function (Higher)

  1. Write y=f(x)y = f(x).
  2. Rearrange to make xx the subject.
  3. Replace yy with xx and write f−1(x)=…f^{-1}(x) = \ldots

Finding a composite function (Higher)

  1. For fg(x)fg(x), write f(…)f(\ldots) and put the whole of g(x)g(x) inside it.
  2. Replace every xx in ff with g(x)g(x) in brackets, then simplify.

Worked examples

Example 1 Foundation · grade 2

A number machine does: input →×3→−7→\rightarrow \times 3 \rightarrow -7 \rightarrow output. (a) Find the output when the input is 6. (b) Find the input when the output is 32.

Show the solution

(a) 6×3=186 \times 3 = 18, 18−7=1118 - 7 = 11
(b) Work backwards: 32+7=3932 + 7 = 39, 39÷3=1339 \div 3 = 13
Input is 13.

Example 2 Higher · grade 7

f(x)=3x−2f(x) = 3x - 2 and g(x)=x2+1g(x) = x^2 + 1. (a) Find f−1(x)f^{-1}(x). (b) Find fg(2)fg(2). (c) Find fg(x)fg(x). (d) Solve fg(x)=28fg(x) = 28.

Show the solution

(a) y=3x−2y = 3x - 2, so y+2=3xy + 2 = 3x and x=y+23x = \frac{y + 2}{3}
f−1(x)=x+23f^{-1}(x) = \frac{x + 2}{3}
(b) gg first: g(2)=22+1=5g(2) = 2^2 + 1 = 5, then f(5)=3×5−2=13f(5) = 3 \times 5 - 2 = 13
(c) fg(x)=3(x2+1)−2=3x2+1fg(x) = 3(x^2 + 1) - 2 = 3x^2 + 1
(d) 3x2+1=283x^2 + 1 = 28, 3x2=273x^2 = 27, x2=9x^2 = 9
x=3x = 3 or x=−3x = -3

Common mistakes

  • Doing a composite in the wrong order: fg(x)fg(x) means gg first. Work from the letter nearest xx.
  • Undoing a number machine in the wrong order: reverse the order as well as the operations.
  • Thinking f−1(x)f^{-1}(x) means 1f(x)\frac{1}{f(x)}. It means the inverse, not the reciprocal.
  • Writing (x+2)2(x + 2)^2 as x2+4x^2 + 4. Expand properly: (x+2)2=x2+4x+4(x + 2)^2 = x^2 + 4x + 4.

Exam tips

  • Write your final inverse as f−1(x)=…f^{-1}(x) = \ldots in terms of xx, not in terms of yy.
  • Check an inverse by putting a number through ff and then through f−1f^{-1}: you should get back to where you started.
  • To find f−1(a)f^{-1}(a) for a number aa, you can find f−1(x)f^{-1}(x) and substitute, or solve f(x)=af(x) = a.

Questions people ask

What is a composite function?

It is two functions applied one after the other. fg(x)fg(x) means apply gg first, then apply ff to the result.

How do you find an inverse function?

Write y=f(x)y = f(x), rearrange to make xx the subject, then replace yy with xx to get f−1(x)f^{-1}(x).

Exam questions: Functions (21, easiest first)

Functions2 marksGrade 1CalculatorFoundation
November 2019 · Paper 2 Foundation · Q8
Find the output of a two-step number machine, then fill in the missing operation of another.

© Pearson Education Ltd. November 2019 Paper 2 (Foundation, calculator), question 8.

Show answer
(a)431 mark
(b)÷3\div 3 (or −20-20)1 mark

Worked solution Checked against the mark scheme

(a) 6×8=486 \times 8 = 48, then 48−5=4348 - 5 = 43

(b) After the first box: 17+13=3017 + 13 = 30

The second box must turn 30 into 10: 30÷3=1030 \div 3 = 10 (or 30−20=1030 - 20 = 10)

So the missing box is ÷3\div 3 (or −20-20).

Watch out: Doing the operations in the wrong order in (a), giving 8.

Functions4 marksGrade 2No calculatorFoundation
November 2024 · Paper 1 Foundation · Q13
Use a two-step number machine forwards, then find a missing second operation.

© Pearson Education Ltd. November 2024 Paper 1 (Foundation, non-calculator), question 13.

Show answer
(a)882 marks
(b)−3-3 (or ×0.7\times 0.7)2 marks

Worked solution Checked against the mark scheme

(a) 11+5=1611 + 5 = 16, then 16÷2=816 \div 2 = 8

(b) Work backwards from the output: 28÷4=728 \div 4 = 7

The first box turns 10 into 7, so it is −3-3 (or ×0.7\times 0.7).

Watch out: In (b), writing −12 by applying ×4 first.

Functions3 marksGrade 2CalculatorFoundation
June 2022 · Paper 2 Foundation · Q12
Use a two-step number machine forwards, then find the missing step in another machine.

© Pearson Education Ltd. June 2022 Paper 2 (Foundation, calculator), question 12.

Show answer
(a)91 mark
(b)+6+62 marks

Worked solution Checked against the mark scheme

(a) 28÷7=428 \div 7 = 4, then 4+5=94 + 5 = 9.

(b) Work backwards from 154: 154÷11=14154 \div 11 = 14.

The missing step turns 8 into 14, so it is +6+6.

Watch out: In (b), doing 154−8154 - 8 before dividing.

Functions3 marksGrade 2No calculatorFoundation
November 2020 · Paper 1 Foundation · Q12
Use a two-step number machine forwards and then backwards with inverse operations.

© Pearson Education Ltd. November 2020 Paper 1 (Foundation, non-calculator), question 12.

Show answer
(a)111 mark
(b)222 marks

Worked solution Checked against the mark scheme

(a) 7×2=147 \times 2 = 14, then 14−3=1114 - 3 = 11.

(b) Work backwards with inverses: 41+3=4441 + 3 = 44, then 44÷2=2244 \div 2 = 22.

Watch out: In (b) doing the inverses in the wrong order: 41÷2+341 \div 2 + 3.

Functions3 marksGrade 2CalculatorFoundation
November 2018 · Paper 2 Foundation · Q10
Use a two-step number machine forwards and backwards.

© Pearson Education Ltd. November 2018 Paper 2 (Foundation, calculator), question 10.

Show answer
(a)381 mark
(b)62 marks

Worked solution Checked against the mark scheme

(a) 8×5=408 \times 5 = 40, 40−2=3840 - 2 = 38

(b) Work backwards: 28+2=3028 + 2 = 30, 30÷5=630 \div 5 = 6

Watch out: In (b), doing the inverses in the wrong order.

Functions5 marksGrade 3No calculatorFoundation
June 2024 · Paper 1 Foundation · Q9
Use a two-step number machine forwards and backwards, and show a number maps to itself.

© Pearson Education Ltd. June 2024 Paper 1 (Foundation, non-calculator), question 9.

Show answer
(a)16161 mark
(b)19192 marks
(c)An input of 10 gives 10×2−10=1010\times2-10=102 marks

Worked solution Checked against the mark scheme

(a) 13×2=2613 \times 2 = 26, 26−10=1626 - 10 = 16

(b) Work backwards: 28+10=3828 + 10 = 38, 38÷2=1938 \div 2 = 19

(c) Solve 2x−10=x2x - 10 = x to get x=10x = 10. Check: 10×2=2010 \times 2 = 20, 20−10=1020 - 10 = 10.

Watch out: In (b), doing the inverse operations in the wrong order (28 ÷ 2 + 10 = 24).

Functions4 marksGrade 3CalculatorFoundation
June 2019 · Paper 3 Foundation · Q15
Use a word formula for hire charges forwards and backwards.

© Pearson Education Ltd. June 2019 Paper 3 (Foundation, calculator), question 15.

Show answer
(a)£3302 marks
(b)92 marks

Worked solution Checked against the mark scheme

(a) 4×70+50=280+50=£3304 \times 70 + 50 = 280 + 50 = £330

(b) Undo the rule: 680−50=630680 - 50 = 630, then 630÷70=9630 \div 70 = 9 weeks.

Watch out: In (a), working out 4 × (70 + 50) = 480.

Functions3 marksGrade 6CalculatorHigher
June 2018 · Paper 2 Higher · Q11
Evaluate a function at a negative input and find a composite function value.

© Pearson Education Ltd. June 2018 Paper 2 (Higher, calculator), question 11.

Show answer
(a)225\frac{2}{25}1 mark
(b)18\frac{1}{8}2 marks

Worked solution Checked against the mark scheme

f(x)=2x2f(x) = \frac{2}{x^2} and g(x)=4x3g(x) = 4x^3

(a) f(−5)=2(−5)2=225f(-5) = \frac{2}{(-5)^2} = \frac{2}{25}

(b) g(1)=4g(1) = 4, then f(4)=216=18f(4) = \frac{2}{16} = \frac{1}{8}

Watch out: In (b), working out f first and then g, i.e. doing gf(1).

Functions4 marksGrade 7No calculatorHigher
November 2024 · Paper 1 Higher · Q18
Find the inverse of a linear function and evaluate a composite function.

© Pearson Education Ltd. November 2024 Paper 1 (Higher, non-calculator), question 18.

Show answer
(a)4x+35\frac{4x + 3}{5}2 marks
(b)1001002 marks

Worked solution Checked against the mark scheme

(a) Let y=5x−34y = \frac{5x - 3}{4}. Then 4y=5x−34y = 5x - 3, 5x=4y+35x = 4y + 3, x=4y+35x = \frac{4y + 3}{5}

So f−1(x)=4x+35f^{-1}(x) = \frac{4x + 3}{5}

(b) h(5)=1−10=−9h(5) = 1 - 10 = -9

g(−9)=(−9−1)2=100g(-9) = (-9 - 1)^2 = 100

Watch out: In (b), working out h(g(5)) instead of g(h(5)).

Functions5 marksGrade 7CalculatorHigher
June 2024 · Paper 3 Higher · Q16
Evaluate a function, a composite function and an inverse function.

© Pearson Education Ltd. June 2024 Paper 3 (Higher, calculator), question 16.

Show answer
(a)−6-61 mark
(b)442 marks
(c)13\frac132 marks

Worked solution Checked against the mark scheme

f(x)=12x+1f(x) = \dfrac{12}{x+1}, g(x)=5−3xg(x) = 5 - 3x

(a) f(−3)=12−2=−6f(-3) = \dfrac{12}{-2} = -6

(b) g(1)=2g(1) = 2, so fg(1)=f(2)=123=4fg(1) = f(2) = \dfrac{12}{3} = 4

(c) Solve 5−3x=45 - 3x = 4: x=13x = \frac13

Watch out: In (b), working out f first then g (i.e. gf(1)).

Functions5 marksGrade 7No calculatorHigher
June 2023 · Paper 1 Higher · Q20
Find the inverse of a function involving a square root, then solve an equation involving a composite function.

© Pearson Education Ltd. June 2023 Paper 1 (Higher, non-calculator), question 20.

Show answer
(a)(5x−2)2(5x - 2)^22 marks
(b)x=55x = 553 marks

Worked solution Checked against the mark scheme

(a) Let y=x+25y = \frac{\sqrt{x} + 2}{5}. Then 5y=x+25y = \sqrt{x} + 2, so x=5y−2\sqrt{x} = 5y - 2 and x=(5y−2)2x = (5y - 2)^2

g−1(x)=(5x−2)2g^{-1}(x) = (5x - 2)^2

(b) gf(x)=3gf(x) = 3 means f(x)=g−1(3)=(15−2)2=169f(x) = g^{-1}(3) = (15 - 2)^2 = 169

3x+4=1693x + 4 = 169, so 3x=1653x = 165 and x=55x = 55

Watch out: Applying the functions in the wrong order (working out fg instead of gf).

Functions4 marksGrade 7CalculatorHigher
November 2023 · Paper 2 Higher · Q19
Evaluate a composite function at a value and find the inverse of a linear function.

© Pearson Education Ltd. November 2023 Paper 2 (Higher, calculator), question 19.

Show answer
(a)17172 marks
(b)x+12\frac{x + 1}{2}2 marks

Worked solution Checked against the mark scheme

(a) f(−3)=(2(−3)+3)2=(−3)2=9f(-3) = (2(-3) + 3)^2 = (-3)^2 = 9, then g(9)=2×9−1=17g(9) = 2 \times 9 - 1 = 17.

(b) Let y=2x−1y = 2x - 1. Then y+1=2xy + 1 = 2x, so x=y+12x = \frac{y + 1}{2}.

g−1(x)=x+12g^{-1}(x) = \frac{x + 1}{2}

Watch out: In (a), working out fg(−3) instead of gf(−3).

Functions4 marksGrade 7CalculatorHigher
June 2022 · Paper 2 Higher · Q19
Evaluate a cube-root function, then find the composite of a reciprocal function with an inverse function.

© Pearson Education Ltd. June 2022 Paper 2 (Higher, calculator), question 19.

Show answer
(a)331 mark
(b)2x3+5\frac{2}{x^3 + 5}3 marks

Worked solution Checked against the mark scheme

(a) g(16)=32−53=273=3g(16) = \sqrt[3]{32 - 5} = \sqrt[3]{27} = 3

(b) Let y=2x−53y = \sqrt[3]{2x - 5}. Cube: y3=2x−5y^3 = 2x - 5, so x=y3+52x = \frac{y^3 + 5}{2}

g−1(x)=x3+52g^{-1}(x) = \frac{x^3 + 5}{2}

hg−1(x)=1x3+52=2x3+5hg^{-1}(x) = \frac{1}{\frac{x^3 + 5}{2}} = \frac{2}{x^3 + 5}

Watch out: Doing g⁻¹ of h instead of h of g⁻¹.

Functions5 marksGrade 7No calculatorHigher
November 2020 · Paper 1 Higher · Q19
Evaluate a function, a composite function and an inverse function at given values.

© Pearson Education Ltd. November 2020 Paper 1 (Higher, non-calculator), question 19.

Show answer
(a)331 mark
(b)272 marks
(c)12\frac{1}{2}2 marks

Worked solution Checked against the mark scheme

(a) g(5)=3(2×5+1)=3×11=33g(5) = 3(2 \times 5 + 1) = 3 \times 11 = 33

(b) f(9)=129=4f(9) = \frac{12}{\sqrt{9}} = 4, then g(4)=3(9)=27g(4) = 3(9) = 27

(c) Solve 3(2x+1)=63(2x + 1) = 6: 2x+1=22x + 1 = 2, so x=12x = \frac{1}{2}

Watch out: In (b), working out f(g(9)) instead of g(f(9)).

Functions7 marksGrade 7No calculatorHigher
June 2019 · Paper 1 Higher · Q21
Find an inverse function, then use composite functions to show that a given quadratic equation holds.

© Pearson Education Ltd. June 2019 Paper 1 (Higher, non-calculator), question 21.

Show answer
(a)x+13\frac{x + 1}{3}2 marks
(b)15x2−12x−1=015x^2 - 12x - 1 = 0 shown5 marks

Worked solution Checked against the mark scheme

(a) y=3x−1⇒x=y+13y = 3x - 1 \Rightarrow x = \frac{y + 1}{3}, so f−1(x)=x+13f^{-1}(x) = \frac{x + 1}{3}

(b) fg(x)=3(x2+4)−1=3x2+11fg(x) = 3(x^2 + 4) - 1 = 3x^2 + 11

gf(x)=(3x−1)2+4=9x2−6x+5gf(x) = (3x - 1)^2 + 4 = 9x^2 - 6x + 5

3x2+11=2(9x2−6x+5)=18x2−12x+103x^2 + 11 = 2(9x^2 - 6x + 5) = 18x^2 - 12x + 10

0=15x2−12x−10 = 15x^2 - 12x - 1

Watch out: Working out gf(x) when fg(x) is needed (applying the functions in the wrong order).

Functions6 marksGrade 7No calculatorHigher
November 2019 · Paper 1 Higher · Q18
Show a value of an inverse function, then solve an equation involving a composite function.

© Pearson Education Ltd. November 2019 Paper 1 (Higher, non-calculator), question 18.

Show answer
(a)f(3)=2×27−4=50f(3) = 2 \times 27 - 4 = 50, so f−1(50)=3f^{-1}(50) = 32 marks
(b)x=−1x = -1 and x=2.5x = 2.54 marks

Worked solution Checked against the mark scheme

(a) f(3)=2×33−4=54−4=50f(3) = 2 \times 3^3 - 4 = 54 - 4 = 50, so f−1(50)=3f^{-1}(50) = 3

(b) hg(x)=(x+2)2=x2+4x+4hg(x) = (x+2)^2 = x^2 + 4x + 4

x2+4x+4=3x2+x−1x^2 + 4x + 4 = 3x^2 + x - 1

0=2x2−3x−5=(2x−5)(x+1)0 = 2x^2 - 3x - 5 = (2x - 5)(x + 1)

x=2.5x = 2.5 or x=−1x = -1

Watch out: Finding gh(x) = x² + 2 instead of hg(x).

Functions4 marksGrade 7No calculatorHigher
November 2018 · Paper 1 Higher · Q19
Form a composite function and show it equals a given expression, then evaluate an inverse function.

© Pearson Education Ltd. November 2018 Paper 1 (Higher, non-calculator), question 19.

Show answer
(a)gf(x)=2((x+1)2−1)=2(x2+2x)=2x(x+2)gf(x) = 2((x+1)^2 - 1) = 2(x^2 + 2x) = 2x(x+2)2 marks
(b)4.54.52 marks

Worked solution Checked against the mark scheme

(a) gf(x)=g((x+1)2)=2((x+1)2−1)gf(x) = g\big((x+1)^2\big) = 2\big((x+1)^2 - 1\big)

=2(x2+2x+1−1)=2(x2+2x)=2x(x+2)= 2(x^2 + 2x + 1 - 1) = 2(x^2 + 2x) = 2x(x + 2)

(b) Solve g(x)=7g(x) = 7: 2(x−1)=72(x - 1) = 7, so x−1=3.5x - 1 = 3.5 and x=4.5x = 4.5

Watch out: Working out fg(x)fg(x) instead of gf(x)gf(x).

Functions4 marksGrade 7CalculatorHigher
November 2018 · Paper 3 Higher · Q10
Evaluate a trig function and a composite function, and explain the missing solution when square-rooting both sides of an equation.

© Pearson Education Ltd. November 2018 Paper 3 (Higher, calculator), question 10.

Show answer
(a)1.561.561 mark
(b)3.633.632 marks
(c)He ignored the negative square root: x+4=−5x + 4 = -5 also works, giving x=−9x = -91 mark

Worked solution Checked against the mark scheme

(a) f(23)=4sin⁡23°=1.56f(23) = 4\sin 23° = 1.56

(b) g(34)=2×34−3=65g(34) = 2 \times 34 - 3 = 65, then f(65)=4sin⁡65°=3.63f(65) = 4\sin 65° = 3.63

(c) 2525 has two square roots, 55 and −5-5. So x+4=−5x + 4 = -5 is also possible, giving a second answer x=−9x = -9.

Watch out: In (b), working out f first and then g (doing gf instead of fg).

Functions3 marksGrade 7CalculatorHigher
Specimen · Paper 2 Higher · Q18
Substitute x + 2 into a quadratic function and simplify to the form ax² + bx.

© Pearson Education Ltd. Specimen Paper 2 (Higher, calculator), question 18.

Show answer
Answer3x2+10x3x^2 + 10x3 marks

Worked solution Checked against the mark scheme

f(x+2)=3(x+2)2−2(x+2)−8f(x + 2) = 3(x + 2)^2 - 2(x + 2) - 8

=3(x2+4x+4)−2x−4−8= 3(x^2 + 4x + 4) - 2x - 4 - 8

=3x2+12x+12−2x−12= 3x^2 + 12x + 12 - 2x - 12

=3x2+10x= 3x^2 + 10x

Watch out: Writing (x+2)2=x2+4(x + 2)^2 = x^2 + 4.

Functions3 marksGrade 8CalculatorHigher
November 2022 · Paper 2 Higher · Q22
Form a composite function and find its inverse.

© Pearson Education Ltd. November 2022 Paper 2 (Higher, calculator), question 22.

Show answer
Answerh−1(x)=x3−32h^{-1}(x) = \frac{x^3 - 3}{2}3 marks

Worked solution Checked against the mark scheme

h(x)=f(g(x))=2x+33h(x) = f(g(x)) = \sqrt[3]{2x + 3}

Let y=2x+33y = \sqrt[3]{2x + 3}, so y3=2x+3y^3 = 2x + 3 and x=y3−32x = \frac{y^3 - 3}{2}

h−1(x)=x3−32h^{-1}(x) = \frac{x^3 - 3}{2}

Watch out: Doing g first and f second the wrong way, i.e. finding g(f(x)).

Functions6 marksGrade 8No calculatorHigher
November 2021 · Paper 1 Higher · Q21
Evaluate a composite function at a point, then find the inverse of a composite function.

© Pearson Education Ltd. November 2021 Paper 1 (Higher, non-calculator), question 21.

Show answer
(a)14\frac{1}{4}2 marks
(b)h(x)=48x−14h(x) = \sqrt[4]{\frac{48}{x - 1}}4 marks

Worked solution Checked against the mark scheme

(a) f(1)=3+1=4f(1) = 3 + 1 = 4, then g(4)=416=14g(4) = \frac{4}{16} = \frac{1}{4}

(b) fg(x)=3(4x2)2+1=48x4+1fg(x) = 3\left(\frac{4}{x^2}\right)^2 + 1 = \frac{48}{x^4} + 1

Let y=48x4+1y = \frac{48}{x^4} + 1, so x4=48y−1x^4 = \frac{48}{y - 1}

h(x)=48x−14h(x) = \sqrt[4]{\frac{48}{x - 1}}

Watch out: Working out fg the wrong way round, i.e. finding gf(x) instead.

Also tested in these questions

Their main topic is different, but part of each one tests this topic.