Composite Functions (AA HL)
A composite function chains two functions together: \((f\circ g)(x)=f(g(x))\) means "do \(g\) first, then feed the result into \(f\)". This page covers how to build and evaluate composites, work out the domain of a composite, and the order-of-operations mistakes that trip students up under exam pressure. It's part of the broader Composite & Inverse Functions topic.
20 questions on this sub-topic.
Notation and a special case
Covered under IB syllabus reference SL2.5: composite functions \((f\circ g)(x)=f(g(x))\), the identity function, and the link between composition and inverse functions.
Composite function notation
\((f\circ g)(x) = f(g(x))\)
Apply the inner function \(g\) first, then feed the result into the outer function \(f\). \((f\circ g)(x)\) and \((g\circ f)(x)\) are generally different functions.
Self-inverse functions
\[(f\circ f)(x)=x\]
A special case of composition: if composing \(f\) with itself gives back \(x\), then \(f\) is its own inverse and its graph is symmetric about \(y=x\).
Not in the formula booklet - prior knowledgeNeed the full syllabus wording and formula-booklet reference table? See Composite & Inverse Functions.
Worked examples
Let \(f(x) = 2x - 3\) and \(g(x) = x^2\).
(a) Find \((f\circ g)(x)\).
(b) Find \((g\circ f)(x)\).
Worked solution
(a) \(f(x^2)=2x^2-3.\) A1
(b) \((g\circ f)(x)=g(2x-3)=(2x-3)^2.\) M1 \((2x-3)^2=4x^2-12x+9.\) A1
\(f(x)=\sqrt{x},\ g(x)=x-5.\)
(a)(i) Find \((f\circ g)(x)\).
(a)(ii) State its domain.
Worked solution
(a)(i) \((f\circ g)(x)=f(g(x))=f(x-5)\) M1
\(=\sqrt{x-5}.\) A1
(a)(ii) The square root requires a non-negative argument: \(x-5\ge0\) M1
\(\Rightarrow x\ge5.\) A1
So the domain is \([5,\infty).\) A1
Given \(f(x)=x^2+1\) (\(x\in\mathbb R\)) and \(g(x)=2x\), find the range of \((f\circ g)(x).\)
Worked solution
\((f\circ g)(x)=(2x)^2+1\) M1 \(=4x^2+1.\) A1
\(4x^2\ge0\) with equality at \(x\) R1 \(=0\), so the least value is \(1.\) A1 Range: \(y\ge1.\) A1
For \(f(x)=x-3\) and \(g(x)=2x\), find \(f(g(x))\) and \(g(f(x)).\)
(a)(i) Find \(f(g(x))\).
(a)(ii) Find \(g(f(x))\).
Worked solution
(a)(i) Replace the input of \(f\) by \(g(x)=2x\): \(f(2x)\) M1
\(=2x-3.\) A1
(a)(ii) Replace the input of \(g\) by \(f(x)=x-3\): \(g(x-3)=2(x-3)\) M1
\(=2x-6.\) A1
Common mistakes
- Applying the functions in the wrong order. \((f\circ g)(x)\) means "do \(g\) first, then \(f\)" - reading it left to right and evaluating \(f\) first gives the wrong answer.
- Assuming \((f\circ g)(x)=(g\circ f)(x)\). Composition is not commutative in general; always recompute from scratch rather than reusing the other order's working.
- Ignoring how the inner function restricts the domain. The domain of \((f\circ g)(x)\) depends on which outputs of \(g\) are valid inputs for \(f\) (e.g. a square root needs a non-negative argument) - not just on the domain of \(g\) alone.
Ready to practise properly?
20 composite-function questions, marked instantly like the real exam.
Quick answers
What does \((f\circ g)(x)\) mean?
\((f\circ g)(x)\) means \(f(g(x))\): first substitute \(x\) into \(g\), then substitute that result into \(f\).
Does the order of composition matter?
Yes. \((f\circ g)(x)\) and \((g\circ f)(x)\) are generally different functions, so always apply the inner function first.