A composite function feeds the output of one function straight into another. Learn the notation \(fg(x)\) and \(f^{2}(x)\), see why \(fg\) and \(gf\) are usually different, solve equations such as \(fg(x) = 5\), and find the domain and range of a composite.
\(fg(x) = f\big(g(x)\big)\): apply \(g\) FIRST, then \(f\). In general \(fg \ne gf\). \(f^{2}(x) = ff(x)\). The composite \(gf\) exists only when every output of \(f\) is an allowed input of \(g\); then the domain of \(gf\) lies within the domain of \(f\) and the range of \(gf\) lies within the range of \(g\).
Fig. 1: fg(x) with g(x) = x² + 2 and f(x) = 3x - 1. Each input goes through g first, then f. Reversing the order gives gf(2) = g(5) = 27, not fg(2) = 17
Section 01
Order matters.
In the lab, enter two functions and compare \(fg(x)\), where \(x\) goes into \(g\) first, with \(gf(x)\). Read a composite from the inside out: the function written nearest to \(x\) acts first.
\(fg(x)\) means \(f\big(g(x)\big)\): work out \(g(x)\), then put the result into \(f\).
\(gf(x)\) means \(g\big(f(x)\big)\): \(f\) first, then \(g\). Usually \(fg(x) \ne gf(x)\).
\(f^{2}(x)\) means \(ff(x) = f\big(f(x)\big)\), NOT \(\big(f(x)\big)^{2}\). This notation is never used with trigonometric functions, where \(\sin^{2} x\) means \((\sin x)^{2}\).
Worked example fg, gf and f squared
\(f(x) = 3x - 1\) and \(g(x) = x^{2} + 2\) for \(x \in \mathbb{R}\). Find (a) \(fg(2)\) and \(gf(2)\) (b) \(fg(x)\) and \(gf(x)\) (c) \(f^{2}(x)\).
(a) \(g(2) = 6\), so \(fg(2) = f(6) = 17\). \(f(2) = 5\), so \(gf(2) = g(5) = 27\).
\(fg(x)\) is not \(f(x) \times g(x)\), and \(f^{2}(x)\) is not \(\big(f(x)\big)^{2}\). For \(f(x) = 3x - 1\), \(f^{2}(x) = 9x - 4\), whereas \((3x - 1)^{2} = 9x^{2} - 6x + 1\).
Section 02
Solving with composites.
To solve an equation such as \(fg(x) = 6\), first write \(fg(x)\) as a single expression in \(x\), then solve as usual. On Paper 1 there is no calculator, so leave answers exact: fractions, surds and logarithms such as \(\ln 3\).
Worked example A quadratic composite
\(f(x) = x^{2} - 3\) and \(g(x) = 2x + 1\) for \(x \in \mathbb{R}\). Solve \(fg(x) = 6\).
\(f(x) = x + 4\) for \(x \in \mathbb{R}\) and \(g(x) = \dfrac{6}{x}\) for \(x \ne 0\). Solve \(gf(x) = x\), giving your answers in surd form.
\(gf(x) = \dfrac{6}{x + 4} = x\), so \(x^{2} + 4x - 6 = 0\) and \(x = \dfrac{-4 \pm \sqrt{40}}{2} = -2 \pm \sqrt{10}\). Neither value is \(-4\), so both are valid.
Examiner trap
From \((2x + 1)^{2} = 9\) you must take BOTH square roots, \(2x + 1 = \pm 3\). Writing only \(2x + 1 = 3\) loses \(x = -2\) and a mark.
Stage 1 · Learn
Check your understanding
Four quick checks. Each correct answer earns XP and records this skill on your profile.
\(f(x) = \mathrm{e}^{x}\) and \(g(x) = x + 2\). Find \(gf(x)\).
Quick check+10 XP
The composite function \(gf\) exists when
Section 03
Domain and range of a composite.
\(gf\) can only exist if every output of \(f\) is an allowed input of \(g\). If it is not, the domain of \(f\) must be restricted. To find the range of \(gf\), feed the RANGE of \(f\) into \(g\).
Existence: \(gf\) exists when the range of \(f\) lies within the domain of \(g\).
Domain: the domain of \(gf\) is part (or all) of the domain of \(f\): Domain \(gf \subseteq\) Domain \(f\).
Range: the outputs of \(gf\) are outputs of \(g\): Range \(gf \subseteq\) Range \(g\).
Worked example Range of gf and fg
\(f(x) = x^{2} + 1\) for \(x \in \mathbb{R}\) and \(g(x) = \ln x\) for \(x > 0\). Find \(gf(x)\) and \(fg(x)\), and state the range of each.
The range of \(f\) is \(f(x) \ge 1\), which lies inside \(x > 0\), so \(gf\) exists for all real \(x\).
\(gf(x) = \ln(x^{2} + 1)\). Its inputs to \(\ln\) are at least 1, and \(\ln 1 = 0\), so \(gf(x) \ge 0\).
\(fg(x) = (\ln x)^{2} + 1\) for \(x > 0\). \((\ln x)^{2} \ge 0\), with \(0\) when \(x = 1\), so \(fg(x) \ge 1\).
Answer: \(gf(x) = \ln(x^{2} + 1)\), range \(gf(x) \ge 0\); \(fg(x) = (\ln x)^{2} + 1\), range \(fg(x) \ge 1\)
Worked example Restricting the domain
\(f(x) = x - 3\) and \(g(x) = \ln x\) for \(x > 0\). Find the largest domain of \(f\) for which \(gf\) exists, and state the range of \(gf\).
\(gf(x) = \ln(x - 3)\), and \(\ln\) only accepts positive inputs.
So we need \(f(x) = x - 3 > 0\), that is \(x > 3\).
For \(x > 3\), \(x - 3\) takes every positive value, so \(\ln(x - 3)\) takes every real value.
Answer: Domain \(x > 3\); range of \(gf\) is all real numbers
Your turn
\(f(x) = \mathrm{e}^{x}\) and \(g(x) = 2x - 1\) for \(x \in \mathbb{R}\). Find \(gf(x)\) and its range.
\(gf(x) = 2\mathrm{e}^{x} - 1\). The range of \(f\) is \(f(x) > 0\), so \(gf(x) > 2(0) - 1\), giving \(gf(x) > -1\).
Examiner trap
Do not feed the DOMAIN of \(f\) into \(g\). For \(gf(x) = \ln(x^{2} + 1)\), putting 'all real numbers' into \(\ln\) wrongly suggests every real output; the inputs to \(\ln\) are only \(x^{2} + 1 \ge 1\), so \(gf(x) \ge 0\).
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Additional Mathematics Paper 1 and Paper 2 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
\(f(x) = x^{2} - 5\) and \(g(x) = 3x + 1\) for \(x \in \mathbb{R}\). Solve \(fg(x) = 11\).
Exam style+20 XP
\(f(x) = \mathrm{e}^{x}\) and \(g(x) = 2x - 1\) for \(x \in \mathbb{R}\). Solve \(gf(x) = 5\).
Exam style+20 XP
\(f(x) = x - 4\) and \(g(x) = \ln x\) for \(x > 0\). Find the largest domain of \(f\) for which \(gf\) exists.
Exam style+20 XP
\(f(x) = x^{2} - 2\) and \(g(x) = \mathrm{e}^{x}\) for \(x \in \mathbb{R}\). Find the range of \(gf\).
Skill unlocked
Composites built, solved and ranged.
This skill is now recorded on your profile. Keep the chain going.