IB Maths AI HLFunctions ToolkitPaper 1 & 2f(g(x)), domain, range~8 min read
Composite Functions
A composite function chains two functions together — the output of one becomes the input of the next. (f ∘ g)(x) = f(g(x)) means “do g first, then f“. Order matters: swapping it usually gives a different function.
📘 What you need to know
Notation: (f ∘ g)(x) = fg(x) = f(g(x)) — all the same thing.
Apply the inner function first: start with the one closest to x.
Order matters: (f ∘ g)(x) and (g ∘ f)(x) are generally different.
(f ∘ f)(x) is NOT [f(x)]2: the first composes f with itself, the second squares the output.
Domain: the outputs of the inner function must be valid inputs to the outer. Restrict the original domain accordingly.
Range: substitute the (restricted) domain through both functions in order.
How composition works
Think of each function as a machine. In (f ∘ g)(x), the input x is fed into the inner machine g first, producing g(x); that output then enters f, giving f(g(x)). To evaluate at a number, work inside-out: compute g(x), then apply f to that result. To find an algebraic expression, substitute the inner function’s formula wherever x appears in the outer formula, then simplify.
The same input x = 2 gives different outputs depending on which function acts first — (p ∘ q) and (q ∘ p) are different functions.
Composite function at a glance
(f ∘ g)(x) = f(g(x))
apply inner first · (f ∘ g) ≠ (g ∘ f) in general · (f ∘ f) ≠ [f(x)]2
Domain & range of a composite
For (f ∘ g)(x) to be defined at x, two things must hold: x must be in the domain of g, and g(x) must be in the domain of f. Start with g‘s domain, find the range of g on that domain, then intersect that range with f‘s domain. If the intersection is smaller, work backwards through g to restrict the original domain. The range of (f ∘ g) is then whatever values come out when you push the restricted domain through both functions in order.
Sketching helps. On the GDC, graph f(g(x)) directly — the visible portion of the curve immediately shows you the domain and range.
🧠Recipe — composite functions
Identify which function is inner: the one closest to x in the notation.
Apply inner first: compute g(x) numerically, or substitute g‘s formula wherever x appears in f.
Apply outer: feed the result into f, then simplify.
Domain: x must be in g‘s domain AND g(x) must lie in f‘s domain — restrict if needed.
Range: push the restricted domain through g then through f; the resulting interval is the range of the composite.
Worked examples
WE 1
Order matters at a number
Let p(x) = 3x − 5 and q(x) = x2 + 1. Find (a) (p ∘ q)(2) and (b) (q ∘ p)(2). What do you notice?
Let f(x) = 1x − 3 and g(x) = 2x + 5. (a) Find (f ∘ g)(x) and state the value of x for which it is undefined. (b) Find (g ∘ f)(x).
(a) sub g into f(f ∘ g)(x) = 1/((2x + 5) − 3)= 1/(2x + 2) = 1/[2(x + 1)](f ∘ g)(x) = 12x + 2denominator zero when2x + 2 = 0 ⇒ x = −1undefined at x = −1(b) sub f into g(g ∘ f)(x) = 2·(1/(x − 3)) + 5= (2 + 5(x − 3))/(x − 3)(g ∘ f)(x) = 5x − 13x − 3(g ∘ f) is undefined at x = 3.
WE 6
Applied: rocket pressure
A rocket’s altitude above the launch site after t minutes is h(t) = 2t2 + 5 km. The atmospheric pressure at altitude h km is P(h) = 100e−0.12h kPa. (a) Find (P ∘ h)(t). (b) Find the pressure 3 minutes after launch (2 d.p.).
(a) sub h into P(P ∘ h)(t) = 100 e⁻⁰·¹²(2t² + 5)(P ∘ h)(t) = 100 e⁻⁰·²⁴t² ⁻ ⁰·⁶(b) sub t = 3exponent: −0.24(9) − 0.6 = −2.76P = 100 e⁻²·⁷⁶ ≈ 100(0.06329)P ≈ 6.33 kPaat altitude h(3) = 23 km the air is very thin.
💡 Top tips
Read inside-out: the function next to x is applied first.
Use brackets when substituting — the entire inner expression goes wherever x appears in the outer.
Domain check before answering: outputs of inner must be valid inputs to outer.
For domain restrictions, work backwards through the inner function to translate the constraint into a restriction on the original x.
On the GDC, graph the composite directly to see domain/range visually.
âš Common mistakes
Applying the outer function first: (f ∘ g)(x) means g first, not f first.
Confusing (f ∘ f)(x) with [f(x)]2 — the first composes, the second multiplies.
Forgetting brackets when substituting an expression — turns f(2x + 1) into the wrong thing.
Reporting the inner function’s domain as the composite’s domain — you may need to restrict further so the inner output fits the outer’s domain.
Dividing by zero in a composite of rational functions — check where the denominator vanishes.
Next up: Inverse Functions — functions that undo each other, including how to find them, when they exist, and how restricting the domain rescues many-to-one functions.
Need help with AI HL Composite Functions?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.