IB Maths AA HL Topic 2 โ€” Functions Paper 1 & 2 ~7 min read

Composite Functions

A composite function is one function applied to the output of another โ€” like a two-stage machine. Feed x into g, take whatever pops out, then feed that into f. The whole chain is written f(g(x)) or (f โˆ˜ g)(x). The single thing you must remember: the order matters. f(g(x)) and g(f(x)) are usually different functions.

๐Ÿ“˜ What you need to know

The two-stage machine

f(g(x)) โ€” apply g first, then f
x g apply g g(x) f apply f f(g(x))composition reads inside-out โ€” the function closest to the input goes first
Composition (f โˆ˜ g)(x)  =  f(g(x))

How to compute f(g(x))

Two scenarios โ€” at a number or as an expression:

At a number
f(g(5))
work inside-out: compute g(5) first, then put that into f
As an expression
f(g(x))
substitute the whole expression for g(x) into f wherever x appears
For “at a number” questions, never expand the algebra โ€” just plug in numbers. It’s faster and harder to mess up.

Order matters โ€” f(g(x)) โ‰  g(f(x))

Quick demo with f(x) = x + 1 and g(x) = 2x:

f(g(x))
f(2x) = 2x + 1
double, then add 1
g(f(x))
g(x + 1) = 2(x + 1) = 2x + 2
add 1, then double

Same two functions, two completely different composites. Always check which one the question is asking for.

Watch out โ€” ff(x) is not [f(x)]2

Common confusion ff(x)  =  f(f(x))   โ‰    [f(x)]2

Take f(x) = x + 3:

ff(x) โ€” apply f twice
f(x + 3) = x + 6
composition
[f(x)]2 โ€” square the output
(x + 3)2 = x2 + 6x + 9
multiplication

Domain of a composite function

The input x has to satisfy two conditions:

๐Ÿงญ Recipe โ€” domain of f(g(x))

  1. Start with the domain of g โ€” only inputs that g can accept.
  2. Find the outputs of g on that domain (the range of g).
  3. Restrict further so those outputs lie inside the domain of f. Whatever inputs of g produce that restricted set become the domain of the composite.

Worked examples

WE 1

Evaluate composites at a number โ€” both orders

Given f(x) = x2 + 3 and g(x) = 2x โˆ’ 1, find:
(a) (f โˆ˜ g)(4)   (b) (g โˆ˜ f)(4)

(a) Inside-out: g first g(4) = 2(4) โˆ’ 1 = 7 f(7) = 49 + 3 = 52 (a) (f โˆ˜ g)(4) = 52 (b) Inside-out: f first f(4) = 16 + 3 = 19 g(19) = 2(19) โˆ’ 1 = 37 (b) (g โˆ˜ f)(4) = 37 52 โ‰  37 โ€” same functions, different order, completely different answer
WE 2

Find an expression for f(g(x))

Given f(x) = 3x + 5 and g(x) = x2 โˆ’ 2, find an expression for (f โˆ˜ g)(x).

Step 1: Substitute g(x) = xยฒ โˆ’ 2 into f wherever x appears (f โˆ˜ g)(x) = f(xยฒ โˆ’ 2) = 3(xยฒ โˆ’ 2) + 5 Step 2: Expand and simplify = 3xยฒ โˆ’ 6 + 5 = 3xยฒ โˆ’ 1 (f โˆ˜ g)(x) = 3xยฒ โˆ’ 1 check: g(2) = 2, f(2) = 11; via the composite: 3(4) โˆ’ 1 = 11 โœ“
WE 3

Reverse the order โ€” find g(f(x))

Using the same f and g as WE 2, find an expression for (g โˆ˜ f)(x).

Step 1: Substitute f(x) = 3x + 5 into g wherever x appears (g โˆ˜ f)(x) = g(3x + 5) = (3x + 5)ยฒ โˆ’ 2 Step 2: Expand the square (3x + 5)ยฒ = 9xยฒ + 30x + 25 (g โˆ˜ f)(x) = 9xยฒ + 30x + 25 โˆ’ 2 (g โˆ˜ f)(x) = 9xยฒ + 30x + 23 notice this is completely different from (f โˆ˜ g)(x) = 3xยฒ โˆ’ 1 โ€” same f and g, different order
WE 4

Compose a function with itself

Given f(x) = 2x + 7, find an expression for ff(x) and compare with [f(x)]2.

Step 1: ff(x) = f(f(x)) โ€” apply f twice ff(x) = f(2x + 7) = 2(2x + 7) + 7 = 4x + 14 + 7 ff(x) = 4x + 21 For comparison: [f(x)]ยฒ is just squaring the output [f(x)]ยฒ = (2x + 7)ยฒ = 4xยฒ + 28x + 49 very different โ€” ff(x) = 4x + 21 (linear); [f(x)]ยฒ = 4xยฒ + 28x + 49 (quadratic)
WE 5

Find the domain of a composite

Let f(x) = 3x โˆ’ 2 with domain โˆ’2 โ‰ค x โ‰ค 4, and let g(x) = โˆšx with domain 1 โ‰ค x โ‰ค 49. Find the domain of (f โˆ˜ g)(x).

Step 1: g acts first โ†’ input must be in g’s domain 1 โ‰ค x โ‰ค 49 Step 2: g’s outputs (range of g) g(x) = โˆšx โ†’ 1 โ‰ค g(x) โ‰ค 7 Step 3: These outputs must fit f’s domain โˆ’2 โ‰ค input โ‰ค 4 need g(x) โ‰ค 4 โ†’ โˆšx โ‰ค 4 โ†’ x โ‰ค 16 (g(x) โ‰ฅ โˆ’2 is automatic since โˆšx โ‰ฅ 0) Step 4: Combine with original 1 โ‰ค x โ‰ค 49 domain of (f โˆ˜ g): 1 โ‰ค x โ‰ค 16 f’s restricted domain shrinks the composite’s domain from 1 โ‰ค x โ‰ค 49 down to 1 โ‰ค x โ‰ค 16
WE 6

Solve an equation involving a composite

Given f(x) = x + 4 and g(x) = 2x โˆ’ 1, find the value of x for which (f โˆ˜ g)(x) = 11.

Step 1: Find the expression for (f โˆ˜ g)(x) (f โˆ˜ g)(x) = f(2x โˆ’ 1) = (2x โˆ’ 1) + 4 = 2x + 3 Step 2: Set equal to 11 and solve 2x + 3 = 11 2x = 8 x = 4 check: g(4) = 7, then f(7) = 11 โœ“

๐Ÿ’ก Top tips

โš  Common mistakes

Composition becomes the foundation for the next big idea: inverse functions. An inverse fโˆ’1 is the function that “undoes” f, so f(fโˆ’1(x)) = x. That’s a composition equal to the identity โ€” and we’ll explore exactly when an inverse can exist in the next note.

Need help with Composite Functions?

Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.

Book Free Session โ†’