Learn composite functions the easy way, with plain English intuition, when a composite is defined, worked examples and an auto marked practice test. VCE Maths Methods Units 3 and 4.
Learn
Functions are machines. You drop a number in one end and a different number drops out the other. A composite function is just two of those machines bolted together, so the output of the first becomes the input of the second. That is the whole secret. Once you see it as a tiny assembly line, the scary looking notation f(g(x)) turns into something you can almost do in your head.
What the notation is really saying
When you read f(g(x)), your eye sees f first, but the maths happens inside out. The inner machine g runs first on x, and whatever it spits out is then dropped into the outer machine f. People sometimes call this f of g of x, and that phrasing is a good reminder of the order.
So the recipe is short. Work out the inside, then work out the outside.
f(g(x))=f(g(x))
Swapping the order usually changes the answer. In general f(g(x)) and g(f(x)) are different functions, so the order you bolt the machines together genuinely matters.
With f(x) = x² and g(x) = x + 4, the blue curve f(g(x)) = (x+4)² and the red curve g(f(x)) = x² + 4 are clearly different, showing that the order of composition changes the result.
Evaluating and simplifying
To evaluate a composite at a single number, plug the number into the inner function, get an output, then plug that output into the outer function. Nothing more.
To simplify a composite into one rule, you replace every x in the outer function with the entire inner expression. The single biggest trap is dropping the brackets. If f(x)=x2 and g(x)=x+4, then
f(g(x))=(x+4)2=x2+8x+16,
not x2+16. That missing 8x in the middle is the most common slip in the whole topic, so write the bracket every time and expand it in full.
When is a composite even allowed
Here is the part that separates a 1 mark answer from full marks. A composite f(g(x)) is only defined when every output of the inner machine is a legal input for the outer machine. In symbols, the range of the inner function must sit inside the domain of the outer function.
f(g(x)) is defined⟺ran(g)⊆dom(f)
If that containment fails, you cannot just give up. You restrict the domain of the inner function so that its outputs all become legal. For example, if the outer function is with domain [0,∞) and the inner is g(x)=x−5, you need x−5≥0, so the composite only lives on the part of the inner domain that keeps the inside legal.
Watch the exam habits that lose marks
Examiner reports flag the same avoidable errors year after year, and they all show up in composite questions. Use a square bracket when an endpoint is included and a curved bracket when it is not, because writing x−5 as defined on (5,∞) wrongly throws away x=5 where 0=0 is perfectly fine. Give exact values, not rounded decimals, unless the question says otherwise. Keep your bracket and vinculum clear so a reader can see exactly what is squared or what sits under a root. Finally, use the function names exactly as the question gives them, and never assume f(g(x)) equals g(f(x)).
See the inside out recipe in action in the Worked Examples tab, then test yourself in Try It.
Lock it in with active recall
Active recall
Answer from memory first, then flip. Rate yourself and each card returns on a spaced schedule (1 → 3 → 7 → 16 days).
In f(g(x)), which machine runs first?
The inner one, g (it sits next to the x). Work from the inside out, then feed its output into f.
Does order matter: is f(g(x))=g(f(x))?
No, in general they are different functions. The order you bolt the machines together changes the result.
When is the composite f(g(x))defined?
Exactly when ran(g)⊆dom(f) — every output of the inner machine is a legal input for the outer.
If ran(g) does not fit inside dom(f), what do you do?
Restrict the domain of the inner function so its outputs all become legal; that restricted set is the domain of the composite.
What is the most common mistake when simplifying a composite?
Dropping the bracket. (x+4)2=x2+8x+16, not x2+16 — the missing middle term loses the most marks.
For f(x)=x on [0,∞) and g(x)=x−7, why is x=7 included in the domain of f(g(x))?
Because g(7)=0 and 0=0 is fine, so the domain is [7,∞) with a square bracket, not (7,∞).
Recall · Circular Functions
What is the range of g∘f where f(x)=sinx, g(x)=sin(2x), over x∈[0,2π]?
[−1,1]. The inner 2sinx ranges over [−2,2], which includes ±2π, so sin(2sinx) attains every value in [−1,1].
Recall · Logarithmic Functions
For f(x)=logex and g(x)=x2−9, what is the maximal domain of f(g(x))?
(−∞,−3)∪(3,∞). The log needs x2−9>0, so x<−3 or x>3.
Worked examples
Worked Example 1Where a trig composite is defined, from a real exam
Let f1:(0,2π)→R, f1(x)=sin(x), and g(x)=sin(2x). Find all values of x in the interval (0,2π) for which the composition f1∘g is defined.
1
The composite f1∘g requires the inner output g(x)=sin(2x) to land in the domain (0,2π) of f1. Since sin(2x)∈[−1,1] always, the only binding condition is sin(2x)>0.
sin(2x)∈(0,2π)∩[−1,1]⟹sin(2x)>0
2
Solve sin(2x)>0 for x∈(0,2π). Sine is positive when its argument lies in (0,π) or (2π,3π), so 2x∈(0,π)∪(2π,3π).
2x∈(0,π)∪(2π,3π)
3
Divide through by 2 to recover the x intervals. The examiner report notes many students knew sin(2x)>0 was required but could not produce the correct intervals.
x∈(0,2π)∪(π,23π)
Answer
x∈(0,2π)∪(π,23π)
VCAA 2024 Mathematical Methods Exam 2, Section B Q5d
Worked Example 2Domain of the derivative of a composite, from a real exam
Let f(x)=logex, where x>0, and g(x)=1−x, where x<1. Find the domain of the derivative of (f∘g)(x).
1
Build the composite. (f∘g)(x)=loge1−x requires the inner output to be a legal input for the log, so 1−x>0, which forces x<1.
(f∘g)(x)=loge1−x,x<1
2
Differentiating does not enlarge the set of allowed x values. The derivative is defined over exactly the same open interval as the composite itself.
dxd(f∘g)(x)=2(1−x)−1,x∈(−∞,1)
3
So the domain of the derivative is the open interval (−∞,1), closed at neither end.
dom=(−∞,1)
Answer
x∈(−∞,1)
VCAA 2023 Mathematical Methods Exam 2, Section A Q7
Worked Example 3Range of a composite function, from a real exam
Consider f:(1,∞)→R, f(x)=x2−4x and g:R→R, g(x)=e−x. Find the range of the composite function g(f(x)).
1
First find the range of the inner function f on (1,∞). The vertex is at x=2, giving the minimum f(2)=−4, and f→∞ as x grows.
ran(f)=[−4,∞)
2
Now apply the outer function g(u)=e−u to that range. Since g is decreasing, the maximum occurs at the smallest input u=−4, giving e4, while as u→∞, e−u→0+.
ran(g∘f)=(0,e4]
3
The maximum e4 is attained at u=−4 so the bracket is closed there, while 0 is approached but never reached so it stays open.
ran(g(f(x)))=(0,e4]
Answer
ran(g(f(x)))=(0,e4]
VCAA 2024 Mathematical Methods Exam 2, Section A Q5
Worked Example 4Local maximum and range of a trig composite, from a real exam
Given f(x)=sin(x) and g(x)=sin(2x). (i) The graph of y=(g∘f)(x) has a local maximum whose x-value lies in [0,2π]. Find the coordinates of this local maximum, correct to one decimal place. (ii) State the range of g∘f where x∈[0,2π].
1
Build the composite by feeding f into g. (g∘f)(x)=sin(2sinx).
(g∘f)(x)=sin(2sinx)
2
(i) The maximum value of sin is 1, reached when its input is 2π. So set 2sinx=2π, giving x=sin−1(4π)≈0.9, where y=1.
x=sin−1(4π)≈0.9,y=1
3
(ii) For x∈[0,2π], the inner expression 2sinx ranges over [−2,2], which includes ±2π, so sin(2sinx) attains every value in [−1,1].
range=[−1,1]
Answer
(i)(0.9,1.0);(ii)[−1,1]
VCAA 2024 Mathematical Methods Exam 2, Section B Q5a
Worked Example 5Evaluate a composite at a point
Let f(x)=x2+1 and g(x)=2x−3. Find f(g(2)).
1
Work from the inside out. Do the inner machine g first, at x=2.
g(2)=2(2)−3=1
2
Now feed that answer into the outer machine f.
f(g(2))=f(1)=12+1=2
Answer
f(g(2))=2
Worked Example 6Build and simplify the rule
Let f(x)=x2+1 and g(x)=2x−3. Find a simplified rule for f(g(x)).
1
Replace every x in f with the whole expression g(x). Keep the bracket.
f(g(x))=(g(x))2+1=(2x−3)2+1
2
Expand (2x−3)2 carefully. The middle term is the one students drop.
(2x−3)2=4x2−12x+9
3
Add the +1 and collect like terms.
f(g(x))=4x2−12x+10
Answer
f(g(x))=4x2−12x+10
Worked Example 7Check a composite is defined
Let f(x)=x with domain [0,∞) and g(x)=x−5 with domain R. Is f(g(x)) defined? If so, give its rule and domain.
1
The composite f(g(x)) exists only if the range of the inner g sits inside the domain of the outer f.
ran(g)=R,dom(f)=[0,∞)
2
R is not a subset of [0,∞), so f(g(x)) is not defined on all of R. Restrict g so its outputs are at least 0, that is x−5≥0.
x≥5
3
On the restricted domain the rule is f(g(x))=g(x).
f(g(x))=x−5,x∈[5,∞)
Answer
f(g(x))=x−5,dom=[5,∞)
Practice questions
Practice test
Try it yourself
6 questions, 8 marks
Choose your answers, then submit to see your score and the full worked solutions.
Multiple choice is marked for you, just like Exam 2 Section A.
Q1.Let f(x)=3x+1 and g(x)=x2. The value of f(g(2)) is:
1mark
Need a hint?
Work from the inside out. Compute the inner function g(2) first, then feed that result into f.
Show worked solution
Work inside out. g(2)=22=4, then f(4)=3(4)+1=13.
Option D, 49, comes from computing g(f(2)) instead, that is f first: (3⋅2+1)2=72=49. Order matters, and f(g(x)) means do g first.
Q2.Let f(x)=x2 and g(x)=x+4. A simplified rule for f(g(x)) is:
1mark
Need a hint?
Replace x in f with the whole expression g(x), keep it in brackets, and expand fully including the middle term.
Show worked solution
f(g(x))=(g(x))2=(x+4)2=x2+8x+16.
Option D, x2+16, is the classic error of squaring each term separately and forgetting the middle term 2⋅x⋅4=8x. Always keep the bracket and expand fully.
Q3.Let f(x)=x with domain [0,∞) and g(x)=x−7 with domain R. The maximal domain for which f(g(x)) is defined is:
1mark
Need a hint?
The inner output must land in dom(f)=[0,∞), so set g(x)≥0 and watch whether the endpoint is included.
Show worked solution
The composite needs the inner output to land in dom(f)=[0,∞), so we need g(x)≥0, that is x−7≥0, giving x≥7, or [7,∞).
Option D uses a curved bracket and wrongly excludes x=7, but g(7)=0 is fine since 0=0. Square brackets include the endpoint and are essential here.
Q4.Let f(x)=2x−1 and g(x)=x1. A rule for g(f(x)) is:
1mark
Need a hint?
Read g(f(x)) carefully: f is the inner function here, so substitute f(x) into g, not the other way round.
Show worked solution
For g(f(x)) do f first, then feed it into g. So g(f(x))=f(x)1=2x−11.
Option D is f(g(x)) instead, the wrong order. The notation g(f(x)) means f is the inner function.
Q5.Let f(x)=loge(x) with domain (0,∞) and g(x)=x2−9 with domain R. The maximal domain for which f(g(x)) is defined is:
1mark
Need a hint?
The outer log needs a strictly positive input, so solve g(x)>0 and decide whether the solution lies between or outside the critical values.
Show worked solution
We need g(x) to land strictly inside dom(f)=(0,∞), so x2−9>0. This gives x2>9, so x<−3 or x>3, that is (−∞,−3)∪(3,∞).
Option A solves the inequality the wrong way around. Always check whether your solution must lie outside or between the critical values, just as you would reject invalid solutions against an implied domain.
Q6.Let f(x)=(x−1)2 with domain R and g(x)=x with domain [0,∞). Find a simplified rule for f(g(x)) and state its maximal domain. Show your working.
3marks
Work this on paper. The worked solution appears once you submit.
Show worked solution
First check the composite is defined. The range of the inner function is ran(g)=[0,∞) and the domain of the outer is dom(f)=R. Since [0,∞)⊆R, the composite f(g(x)) is defined wherever g is defined.
Build the rule by replacing x in f with g(x)=x:
f(g(x))=(x−1)2=x−2x+1.
The maximal domain is inherited from the inner function g, so
dom(f(g(x)))=[0,∞).
Frequently asked questions
Does the order matter in a composite function?
Yes. In general f of g of x is not the same as g of f of x, because you run the two machines in a different order. Always do the inner function first, then feed its output into the outer function.
How do I find the domain of a composite function?
The composite is only allowed where the outputs of the inner function are legal inputs for the outer function, so the range of the inner must sit inside the domain of the outer. When that fails, restrict the domain of the inner function so its outputs stay legal, and that restricted set becomes the domain of the composite.
What is the most common mistake when simplifying a composite function?
Dropping the brackets when you substitute. If you replace x with the whole inner expression you must keep it in brackets and expand fully, so a square of x plus four becomes x squared plus eight x plus sixteen, not x squared plus sixteen. The missing middle term is where most marks are lost.