Mathematical Methods · Units 3 & 4

Composite Functions

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))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))f(g(x)), your eye sees ff first, but the maths happens inside out. The inner machine gg runs first on xx, and whatever it spits out is then dropped into the outer machine ff. People sometimes call this ff of gg of xx, 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))f(g(x)) = f\big(g(x)\big)

Swapping the order usually changes the answer. In general f(g(x))f(g(x)) and g(f(x))g(f(x)) are different functions, so the order you bolt the machines together genuinely matters.

-8-6-4-224 10203040506070
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 xx in the outer function with the entire inner expression. The single biggest trap is dropping the brackets. If f(x)=x2f(x) = x^2 and g(x)=x+4g(x) = x + 4, then

f(g(x))=(x+4)2=x2+8x+16,f(g(x)) = (x + 4)^2 = x^2 + 8x + 16,

not x2+16x^2 + 16. That missing 8x8x 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))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)f(g(x)) \text{ is defined} \iff \text{ran}(g) \subseteq \text{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  \sqrt{\ } with domain [0,∞)[0, \infty) and the inner is g(x)=x−5g(x) = x - 5, you need x−5≥0x - 5 \ge 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\sqrt{x - 5} as defined on (5,∞)(5, \infty) wrongly throws away x=5x = 5 where 0=0\sqrt{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))f(g(x)) equals g(f(x))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))f(g(x)), which machine runs first?
Does order matter: is f(g(x))=g(f(x))f(g(x)) = g(f(x))?
When is the composite f(g(x))f(g(x)) defined?
If ran⁡(g)\operatorname{ran}(g) does not fit inside dom⁡(f)\operatorname{dom}(f), what do you do?
What is the most common mistake when simplifying a composite?
For f(x)=xf(x) = \sqrt{x} on [0,∞)[0,\infty) and g(x)=x−7g(x) = x - 7, why is x=7x = 7 included in the domain of f(g(x))f(g(x))?
Recall · Circular Functions
What is the range of g∘fg \circ f where f(x)=sin⁡xf(x) = \sin x, g(x)=sin⁡(2x)g(x) = \sin(2x), over x∈[0,2π]x \in [0, 2\pi]?
Recall · Logarithmic Functions
For f(x)=log⁡exf(x) = \log_e x and g(x)=x2−9g(x) = x^2 - 9, what is the maximal domain of f(g(x))f(g(x))?

Worked examples

Worked Example 1Where a trig composite is defined, from a real exam

Let f1:(0,2π)→Rf_1 : (0, 2\pi) \to R, f1(x)=sin⁡(x)f_1(x) = \sin(x), and g(x)=sin⁡(2x)g(x) = \sin(2x). Find all values of xx in the interval (0,2π)(0, 2\pi) for which the composition f1∘gf_1 \circ g is defined.

  1. 1

    The composite f1∘gf_1 \circ g requires the inner output g(x)=sin⁡(2x)g(x) = \sin(2x) to land in the domain (0,2π)(0, 2\pi) of f1f_1. Since sin⁡(2x)∈[−1,1]\sin(2x) \in [-1, 1] always, the only binding condition is sin⁡(2x)>0\sin(2x) > 0.

    sin⁡(2x)∈(0,2π)∩[−1,1]  ⟹  sin⁡(2x)>0\sin(2x) \in (0, 2\pi) \cap [-1, 1] \implies \sin(2x) > 0
  2. 2

    Solve sin⁡(2x)>0\sin(2x) > 0 for x∈(0,2π)x \in (0, 2\pi). Sine is positive when its argument lies in (0,π)(0, \pi) or (2π,3π)(2\pi, 3\pi), so 2x∈(0,π)∪(2π,3π)2x \in (0, \pi) \cup (2\pi, 3\pi).

    2x∈(0,π)∪(2π,3π)2x \in (0, \pi) \cup (2\pi, 3\pi)
  3. 3

    Divide through by 22 to recover the xx intervals. The examiner report notes many students knew sin⁡(2x)>0\sin(2x) > 0 was required but could not produce the correct intervals.

    x∈(0,π2)∪(π,3π2)x \in \left(0, \tfrac{\pi}{2}\right) \cup \left(\pi, \tfrac{3\pi}{2}\right)
Answer
x∈(0,π2)∪(π,3π2)x \in \left(0, \dfrac{\pi}{2}\right) \cup \left(\pi, \dfrac{3\pi}{2}\right)

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)=log⁡exf(x) = \log_e x, where x>0x > 0, and g(x)=1−xg(x) = \sqrt{1 - x}, where x<1x < 1. Find the domain of the derivative of (f∘g)(x)(f \circ g)(x).

  1. 1

    Build the composite. (f∘g)(x)=log⁡e1−x(f \circ g)(x) = \log_e \sqrt{1 - x} requires the inner output to be a legal input for the log, so 1−x>0\sqrt{1 - x} > 0, which forces x<1x < 1.

    (f∘g)(x)=log⁡e1−x,x<1(f \circ g)(x) = \log_e \sqrt{1 - x}, \quad x < 1
  2. 2

    Differentiating does not enlarge the set of allowed xx values. The derivative is defined over exactly the same open interval as the composite itself.

    ddx(f∘g)(x)=−12(1−x),x∈(−∞,1)\frac{d}{dx}(f \circ g)(x) = \frac{-1}{2(1 - x)}, \quad x \in (-\infty, 1)
  3. 3

    So the domain of the derivative is the open interval (−∞,1)(-\infty, 1), closed at neither end.

    dom=(−∞,1)\text{dom} = (-\infty, 1)
Answer
x∈(−∞,1)x \in (-\infty, 1)

VCAA 2023 Mathematical Methods Exam 2, Section A Q7

Worked Example 3Range of a composite function, from a real exam

Consider f:(1,∞)→Rf : (1, \infty) \to R, f(x)=x2−4xf(x) = x^2 - 4x and g:R→Rg : R \to R, g(x)=e−xg(x) = e^{-x}. Find the range of the composite function g(f(x))g(f(x)).

  1. 1

    First find the range of the inner function ff on (1,∞)(1, \infty). The vertex is at x=2x = 2, giving the minimum f(2)=−4f(2) = -4, and f→∞f \to \infty as xx grows.

    ran(f)=[−4,∞)\text{ran}(f) = [-4, \infty)
  2. 2

    Now apply the outer function g(u)=e−ug(u) = e^{-u} to that range. Since gg is decreasing, the maximum occurs at the smallest input u=−4u = -4, giving e4e^{4}, while as u→∞u \to \infty, e−u→0+e^{-u} \to 0^+.

    ran(g∘f)=(0,e4]\text{ran}(g \circ f) = (0, e^4]
  3. 3

    The maximum e4e^4 is attained at u=−4u = -4 so the bracket is closed there, while 00 is approached but never reached so it stays open.

    ran(g(f(x)))=(0,e4]\text{ran}(g(f(x))) = (0, e^4]
Answer
ran(g(f(x)))=(0,e4]\text{ran}(g(f(x))) = (0, e^4]

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)f(x) = \sin(x) and g(x)=sin⁡(2x)g(x) = \sin(2x). (i) The graph of y=(g∘f)(x)y = (g \circ f)(x) has a local maximum whose xx-value lies in [0,π2]\left[0, \dfrac{\pi}{2}\right]. Find the coordinates of this local maximum, correct to one decimal place. (ii) State the range of g∘fg \circ f where x∈[0,2π]x \in [0, 2\pi].

  1. 1

    Build the composite by feeding ff into gg. (g∘f)(x)=sin⁡(2sin⁡x)(g \circ f)(x) = \sin(2 \sin x).

    (g∘f)(x)=sin⁡(2sin⁡x)(g \circ f)(x) = \sin(2 \sin x)
  2. 2

    (i) The maximum value of sin⁡\sin is 11, reached when its input is π2\tfrac{\pi}{2}. So set 2sin⁡x=π22 \sin x = \tfrac{\pi}{2}, giving x=sin⁡−1 ⁣(π4)≈0.9x = \sin^{-1}\!\left(\tfrac{\pi}{4}\right) \approx 0.9, where y=1y = 1.

    x=sin⁡−1 ⁣(π4)≈0.9, y=1x = \sin^{-1}\!\left(\tfrac{\pi}{4}\right) \approx 0.9, \ y = 1
  3. 3

    (ii) For x∈[0,2π]x \in [0, 2\pi], the inner expression 2sin⁡x2 \sin x ranges over [−2,2][-2, 2], which includes ±π2\pm \tfrac{\pi}{2}, so sin⁡(2sin⁡x)\sin(2 \sin x) attains every value in [−1,1][-1, 1].

    range=[−1,1]\text{range} = [-1, 1]
Answer
(i) (0.9,1.0); (ii) [−1,1](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+1f(x) = x^2 + 1 and g(x)=2x−3g(x) = 2x - 3. Find f(g(2))f(g(2)).

  1. 1

    Work from the inside out. Do the inner machine gg first, at x=2x = 2.

    g(2)=2(2)−3=1g(2) = 2(2) - 3 = 1
  2. 2

    Now feed that answer into the outer machine ff.

    f(g(2))=f(1)=12+1=2f(g(2)) = f(1) = 1^2 + 1 = 2
Answer
f(g(2))=2f(g(2)) = 2
Worked Example 6Build and simplify the rule

Let f(x)=x2+1f(x) = x^2 + 1 and g(x)=2x−3g(x) = 2x - 3. Find a simplified rule for f(g(x))f(g(x)).

  1. 1

    Replace every xx in ff with the whole expression g(x)g(x). Keep the bracket.

    f(g(x))=(g(x))2+1=(2x−3)2+1f(g(x)) = (g(x))^2 + 1 = (2x - 3)^2 + 1
  2. 2

    Expand (2x−3)2(2x-3)^2 carefully. The middle term is the one students drop.

    (2x−3)2=4x2−12x+9(2x - 3)^2 = 4x^2 - 12x + 9
  3. 3

    Add the +1+1 and collect like terms.

    f(g(x))=4x2−12x+10f(g(x)) = 4x^2 - 12x + 10
Answer
f(g(x))=4x2−12x+10f(g(x)) = 4x^2 - 12x + 10
Worked Example 7Check a composite is defined

Let f(x)=xf(x) = \sqrt{x} with domain [0,∞)[0, \infty) and g(x)=x−5g(x) = x - 5 with domain RR. Is f(g(x))f(g(x)) defined? If so, give its rule and domain.

  1. 1

    The composite f(g(x))f(g(x)) exists only if the range of the inner gg sits inside the domain of the outer ff.

    ran(g)=R,dom(f)=[0,∞)\text{ran}(g) = R, \quad \text{dom}(f) = [0, \infty)
  2. 2

    RR is not a subset of [0,∞)[0, \infty), so f(g(x))f(g(x)) is not defined on all of RR. Restrict gg so its outputs are at least 00, that is x−5≥0x - 5 \ge 0.

    x≥5x \ge 5
  3. 3

    On the restricted domain the rule is f(g(x))=g(x)f(g(x)) = \sqrt{g(x)}.

    f(g(x))=x−5,x∈[5,∞)f(g(x)) = \sqrt{x - 5}, \quad x \in [5, \infty)
Answer
f(g(x))=x−5, dom=[5,∞)f(g(x)) = \sqrt{x - 5}, \ \text{dom} = [5, \infty)

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+1f(x) = 3x + 1 and g(x)=x2g(x) = x^2. The value of f(g(2))f(g(2)) is:

1mark
Need a hint?
Work from the inside out. Compute the inner function g(2)g(2) first, then feed that result into ff.

Q2.Let f(x)=x2f(x) = x^2 and g(x)=x+4g(x) = x + 4. A simplified rule for f(g(x))f(g(x)) is:

1mark
Need a hint?
Replace xx in ff with the whole expression g(x)g(x), keep it in brackets, and expand fully including the middle term.

Q3.Let f(x)=xf(x) = \sqrt{x} with domain [0,∞)[0, \infty) and g(x)=x−7g(x) = x - 7 with domain RR. The maximal domain for which f(g(x))f(g(x)) is defined is:

1mark
Need a hint?
The inner output must land in dom(f)=[0,∞)\text{dom}(f) = [0, \infty), so set g(x)≥0g(x) \ge 0 and watch whether the endpoint is included.

Q4.Let f(x)=2x−1f(x) = 2x - 1 and g(x)=1xg(x) = \dfrac{1}{x}. A rule for g(f(x))g(f(x)) is:

1mark
Need a hint?
Read g(f(x))g(f(x)) carefully: ff is the inner function here, so substitute f(x)f(x) into gg, not the other way round.

Q5.Let f(x)=log⁡e(x)f(x) = \log_e(x) with domain (0,∞)(0, \infty) and g(x)=x2−9g(x) = x^2 - 9 with domain RR. The maximal domain for which f(g(x))f(g(x)) is defined is:

1mark
Need a hint?
The outer log needs a strictly positive input, so solve g(x)>0g(x) > 0 and decide whether the solution lies between or outside the critical values.

Q6.Let f(x)=(x−1)2f(x) = (x - 1)^2 with domain RR and g(x)=xg(x) = \sqrt{x} with domain [0,∞)[0, \infty). Find a simplified rule for f(g(x))f(g(x)) and state its maximal domain. Show your working.

3marks

Work this on paper. The worked solution appears once you submit.

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.