2.3PureStretch

Composite Functions

A composite function applies one function and then another: fg(x)fg(x) means “do gg first, then ff”. Order matters, and the inner function’s output must be valid input for the outer one.

25 min Functions and Graphs
Edexcel A level Maths: 2.3 Composite FunctionsCurated by Kepler, not produced by us. Watch it before the notes below.
Open on YouTube

What you'll be able to do

  • Understand composite function notation
  • Evaluate fg(x) and gf(x)
  • Recognise that order matters
  • Build composite functions algebraically
1

Inside out

The composite fg(x)fg(x) means f(g(x))f(g(x)) — apply the inner\textbf{inner} function gg first, then feed its output into ff. Work from the inside out.

fg(x)=f(g(x))fg(x) = f\big(g(x)\big)
Do gg first, then ff.
Example 1If f(x)=x+1f(x) = x + 1 and g(x)=x2g(x) = x^2, find fg(2)fg(2).
1g(2)=4g(2) = 4.
2f(4)=5f(4) = 5.
Answer
55
2

Order matters

In general fg(x)≠gf(x)fg(x) \ne gf(x) — swapping the order changes the result. Always check which function is written first (it acts last).

Example 1With the same f and g, find gf(2)gf(2).
1f(2)=3f(2) = 3.
2g(3)=9g(3) = 9.
Answer
99 (≠ fg(2)=5fg(2) = 5)

Tip — fg means f outside, g inside. The function nearest the x acts first.

3

Building the expression

To get fg(x)fg(x) as a formula, substitute the whole of g(x)g(x) into ff wherever xx appears, then simplify.

Example 1For f(x)=2x+1f(x) = 2x + 1, g(x)=x2g(x) = x^2, find fg(x)fg(x).
1Replace xx in ff with g(x)=x2g(x) = x^2: 2(x2)+12(x^2) + 1.
Answer
2x2+12x^{2} + 1

Formula recap

fg(x)=f(g(x))fg(x) = f(g(x))
Inner function first.
fg(x)≠gf(x) in generalfg(x) \neq gf(x) \ \text{in general}
Order matters.
ff(x)=f(f(x))ff(x) = f(f(x))
A function composed with itself.

Common mistakes to avoid

Doing f first in fg(x).
fg(x) = f(g(x)) — the inner function g acts first.
Assuming fg(x) = gf(x).
They are usually different; check the order.

Key takeaways

  • fg(x) = f(g(x)): apply the inner function first.
  • Order matters — fg and gf are generally different.
  • Build the formula by substituting g(x) into f.

Test yourself

Answer a few questions, then review anything you missed.

Prefer paper? Open the written self-check

Answer each question before opening its answer. This self-check does not record a quiz score.

  1. fg(x)fg(x) means:

    • f(g(x))f(g(x))
    • g(f(x))g(f(x))
    • f(x)×g(x)f(x) \times g(x)
    • f(x)+g(x)f(x) + g(x)
    Show answer and explanation

    Answer: f(g(x))f(g(x))

    Inner function first.

  2. With f(x)=x+1f(x)=x+1, g(x)=x2g(x)=x^{2}, fg(2)=fg(2) =

    • 55
    • 99
    • 44
    • 66
    Show answer and explanation

    Answer: 55

    g(2)=4, f(4)=5.

  3. With the same functions, gf(2)=gf(2) =

    • 99
    • 55
    • 44
    • 33
    Show answer and explanation

    Answer: 99

    f(2)=3, g(3)=9.

  4. In fg(x)fg(x), which function acts first?

    • g
    • f
    • Both at once
    • Neither
    Show answer and explanation

    Answer: g

    The inner one.

  5. For f(x)=2x+1f(x)=2x+1, g(x)=x2g(x)=x^{2}, fg(x)=fg(x) =

    • 2x2+12x^{2} + 1
    • (2x+1)2(2x+1)^{2}
    • 2x22x^{2}
    • 4x2+14x^{2}+1
    Show answer and explanation

    Answer: 2x2+12x^{2} + 1

    Sub x² into f.

  6. For the same functions, gf(x)=gf(x) =

    • (2x+1)2(2x+1)^{2}
    • 2x2+12x^{2}+1
    • 2x22x^{2}
    • 2x+12x+1
    Show answer and explanation

    Answer: (2x+1)2(2x+1)^{2}

    Sub f into g: (2x+1)².

Next step

Keep practising

Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.

Browse practice topics

Related lessons

All 7 lessons

Put the methods into practice: see how A-Level maths duels work. An account is required to play; the overview and sample are public.