Composite Functions (Cambridge (CIE) IGCSE Maths: Extended): Revision Note

Exam code: 0580 & 0980

Guided study available on this topic

Understand this topic with deeper explanations and understanding checks.

Composite functions

What is a composite function?

  • A composite function is a function applied to the output of another function

    • The input goes through the 1st function to become an output

    • This output goes through the 2nd function to become a new output

What notation is used for composite functions?

  • If f(x) and g(x) are two functions, then

    • g(f(x)) is a composite function

    • It means the input xgoes through function f first

      • This gives the output f(x)

      • Then this output, f(x), becomes the input of function g, giving g(f(x))

    • gf(x) is the shorthand notation used for g(f(x))

      • It means do f first, then g

      • The order of applying the functions goes from right to left

      • (the letter nearest the bracket goes first)

      • This is often the opposite of what people expect!

    • fg(x) means do g(x) first then f(x) second

    • ff(x) means apply f(x) twice!

      • This can be written f2(x)

      • This does not mean the same as [f(x)]2

Examiner Tips and Tricks

A good trick in the exam is to write brackets around gf(x) to make it g(f(x)), to see that it is "g" of "f(x)".

How do I substitute numbers into composite functions?

  • If you are putting a number into a composite function

    • put the number into the function closest to (x)

    • then make the output of the first function the input of the second function

  • For example, if f(x)=2x+1 and g(x)=1x

    • to find gf(2):

      • Put the 2 in as the input of f first

      • f(2)=2(2)+1=5 

      • Then put 5 in as the input of g

      • So gf(2)=g(f(2))=g(5)=15

    • to find fg(2):

      • Put the 2 in as the input of g first

      • g(2)=12

      • Then put 12 in as the input of f

      • So fg(2)=f(g(2))=f(12)=2(12)+1=2

    • to find ff(2):

      • f(2)=2×2+1=5

      • f(5)=2×5+1=11

      • so ff(2)=11

How do I find composite functions algebraically?

  • If you are using algebra, substitute the whole algebraic expression as your input

    • For example, if f(x)=2x+1 and g(x)=1x

      • fg(x)=f(g(x))=f(1x)=2×(1x)+1=2x+1

      • gf(x)=g(f(x))=g(2x+1)=12x+1

      • ff(x)=f(f(x))=f(2x+1)=2(2x+1)+1 which simplifies to ff(x)=4x+3

Worked Example

In this question, f(x) = 2x − 1 and g(x) = (x + 2)2.

(a) Find  fg(4).

Answer:

"g" is on the inside of the composite function, so apply g first

g(4)=(4+2)2=62=36

Now apply the function "f" to 36

 f(36)=2(36)−1=72−1

fg(4)=71

(b) Find  gf(x).

Answer:

"f" is on the inside of the composite function so substitute the function f(x) into g(x)
It can help to write gf(x)=g(f(x))

 gf(x)=g(f(x)) =g(2x−1)=((2x−1)+2)2

Simplify inside the bracket

gf(x)=(2x−1+2)2

gf(x)=(2x+1)2

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Build on this topic

Questions students ask about Composite Functions

Real questions from students revising this topic on Save My Exams

Does fg(x) mean multiplying f(x) by g(x)?

No — fg(x) is not a multiplication; it means put x into g first, then put that answer into f.

  • fg(x) is shorthand for f(g(x))
  • Work right to left: the letter nearest the bracket goes first
  • The output of the first function becomes the input of the second
  • Multiplying would be written f(x) × g(x), which is a different thing
  • Writing the extra brackets, f(g(x)), helps you see it is “f of g(x)”

Example from this page: f(x) = 2x − 1 and g(x) = (x + 2)². Find fg(4).

  1. g is nearest the bracket, so do g first: g(4) = (4 + 2)² = 6² = 36
  2. Put 36 into f: f(36) = 2(36) − 1 = 71

So fg(4) = 71.

Multiplying instead would give f(4) × g(4) = 7 × 36 = 252 — nowhere near 71.

The same idea works in algebra: for gf(x) you replace the x in g with the whole of f(x).

Do you need to find the domain of a composite function?

Not for the questions on this page — they only ask you to work out a composite function's value or its expression — but it is worth knowing which inputs a composite function cannot take.

The domain is the set of x-values you are allowed to put in. A composite function cannot take any x that breaks either step.

Example using this page's functions: f(x) = 2x + 1 and g(x) = 1/x

  • g(x) = 1/x cannot take x = 0
  • gf(x) = 1/(2x + 1): the denominator is zero when x = −½, so that value is excluded
  • fg(x) = 2/x + 1: x = 0 is excluded, because g(0) does not exist

You would write gf(x) = 1/(2x + 1), x ≠ −½.

If a question does ask for a domain, find the values that would break either step and leave them out. Otherwise, just answer what is asked.

Do you always need to expand brackets when finding a composite function?

No — gf(x) = (2x + 1)² is already a correct, fully simplified answer; expanding just rewrites the same function.

The page's working for part (b): f(x) = 2x − 1 and g(x) = (x + 2)²

  • gf(x) = g(2x − 1) = ((2x − 1) + 2)²
  • Simplify inside the bracket: (2x + 1)²

The question only says “Find gf(x)”, so stopping there is fine. Do always tidy up inside the bracket, though.

If you did expand:

  • (2x + 1)² = (2x + 1)(2x + 1) = 4x² + 4x + 1
  • Same function, different form — check with x = 1: 3² = 9 and 4 + 4 + 1 = 9

Expand only when the question asks for it, for example “in the form ax² + bx + c”. Expanding for no reason just gives you another chance to slip up.

On this page ff(x) = 2(2x + 1) + 1 is tidied to 4x + 3, because collecting like terms genuinely simplifies it.

Amber

Author: Amber

Expertise: Maths Content Creator

Amber gained a first class degree in Mathematics & Meteorology from the University of Reading before training to become a teacher. She is passionate about teaching, having spent 8 years teaching GCSE and A Level Mathematics both in the UK and internationally. Amber loves creating bright and informative resources to help students reach their potential.

Dan Finlay

Reviewer: Dan Finlay

Expertise: Portfolio Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.