13.6 Composite Functions
A composite function is formed when one function is applied after another.
The most important idea is simple:
Do the inside function first.
For example:
(f ∘ g)(x) = f(g(x))
This means:
- Apply g first.
- Take the answer from g.
- Put that answer into f.
So a composite function is like using two function machines in sequence.

Concept
Suppose:
f(x) = 2x + 1
and:
g(x) = x²
Now consider:
(f ∘ g)(x)
This means:
f(g(x))
So we apply g first.
Since:
g(x) = x²
put x² into f.
We know:
f(x) = 2x + 1
Therefore:
f(g(x)) = 2(x²) + 1
So:
(f ∘ g)(x) = 2x² + 1
The key idea is:
The output of the first function becomes the input of the second function.
Function Machine Idea
Think of two machines.
For:
(f ∘ g)(x)
the order is:
x → g → f → final output
So:
g happens first
then:
f happens second
Even though f is written first in:
f ∘ g
the function closest to x is applied first.
Formula
Composite functions can be written as:
(f ∘ g)(x) = f(g(x))
and:
(g ∘ f)(x) = g(f(x))
Another common notation is:
fg(x) = f(g(x))
depending on how the question is written.
The safest way to think is:
Work from the inside out.
Understanding the Order
Consider:
f(x) = 2x + 1
g(x) = x²
Find:
(f ∘ g)(3)
This means:
f(g(3))
Start with the inside function:
g(3) = 3²
= 9
Now put 9 into f:
f(9) = 2(9) + 1
= 18 + 1
= 19
Therefore:
(f ∘ g)(3) = 19
Reverse the Order
Now find:
(g ∘ f)(3)
This means:
g(f(3))
Start with f:
f(3) = 2(3) + 1
= 7
Now put 7 into g:
g(7) = 7²
= 49
Therefore:
(g ∘ f)(3) = 49
Notice:
(f ∘ g)(3) = 19
but:
(g ∘ f)(3) = 49
So:
f ∘ g ≠ g ∘ f
in general.
Why Order Matters
Composite functions are usually not commutative.
That means:
f(g(x))
is generally different from:
g(f(x))
For example:
f(x) = 2x + 1
g(x) = x²
Then:
f(g(x)) = 2x² + 1
But:
g(f(x)) = (2x + 1)²
Expand:
= 4x² + 4x + 1
These are clearly different.
So:
order matters
Example Math 1
Given:
f(x) = x + 3
g(x) = 2x
find:
(f ∘ g)(x)
Start with:
g(x) = 2x
Now put this into f:
f(g(x)) = f(2x)
Since:
f(x) = x + 3
replace x with 2x:
f(2x) = 2x + 3
Therefore:
(f ∘ g)(x) = 2x + 3
Example Math 2
Using the same functions:
f(x) = x + 3
g(x) = 2x
find:
(g ∘ f)(x)
Start with:
f(x) = x + 3
Now put this into g.
Since:
g(x) = 2x
we get:
g(f(x)) = 2(x + 3)
= 2x + 6
Therefore:
(g ∘ f)(x) = 2x + 6
Again:
f ∘ g ≠ g ∘ f
Example Math 3
Given:
f(x) = 3x – 2
g(x) = x² + 1
find:
(f ∘ g)(x)
Start with:
g(x) = x² + 1
Substitute into f:
f(g(x)) = 3(x² + 1) – 2
Expand:
= 3x² + 3 – 2
= 3x² + 1
Therefore:
(f ∘ g)(x) = 3x² + 1
Example Math 4
Using:
f(x) = 3x – 2
g(x) = x² + 1
find:
(g ∘ f)(x)
Start with:
f(x) = 3x – 2
Put this into g:
g(f(x)) = (3x – 2)² + 1
Expand:
(3x – 2)² = 9x² – 12x + 4
So:
g(f(x)) = 9x² – 12x + 4 + 1
= 9x² – 12x + 5
Therefore:
(g ∘ f)(x) = 9x² – 12x + 5
Finding a Numerical Composite Function
Suppose:
f(x) = 5x + 2
g(x) = x – 4
Find:
f(g(10))
First:
g(10) = 10 – 4
= 6
Then:
f(6) = 5(6) + 2
= 32
Therefore:
f(g(10)) = 32
A/A* Technique
When you see:
f(g(x))
do not try to do everything at once.
Use this method:
Step 1
Identify the inside function.
Here:
g(x)
Step 2
Find or write g(x).
Step 3
Substitute the whole expression into f.
Step 4
Use brackets.
Step 5
Simplify carefully.
Why Brackets Are Important
Suppose:
f(x) = x² + 3
g(x) = 2x – 1
Find:
f(g(x))
Since:
g(x) = 2x – 1
we must replace x in f with the whole expression:
f(g(x)) = (2x – 1)² + 3
Do not write:
2x – 1² + 3
The brackets are essential.
Expand:
(2x – 1)²
= 4x² – 4x + 1
So:
f(g(x)) = 4x² – 4x + 4
Composite Functions with Negative Values
Suppose:
f(x) = x²
g(x) = x – 5
Find:
(f ∘ g)(2)
Start with:
g(2) = 2 – 5
= -3
Then:
f(-3) = (-3)²
= 9
Therefore:
(f ∘ g)(2) = 9
Always use brackets for negative numbers.
Composite Functions with Fractions
Suppose:
f(x) = 1/x
g(x) = x + 2
Find:
f(g(x))
Start with:
g(x) = x + 2
Now substitute into f:
f(g(x)) = 1/(x + 2)
Therefore:
(f ∘ g)(x) = 1/(x + 2)
But remember:
x + 2 ≠ 0
So:
x ≠ -2
This links composite functions with domain restrictions.
Domain of a Composite Function
When working with composite functions, you must sometimes consider whether the output from the first function is allowed as an input to the second.
For:
f(x) = 1/x
g(x) = x + 2
we found:
f(g(x)) = 1/(x + 2)
So:
x ≠ -2
because division by zero is undefined.
This is especially important in harder A/A* questions.
Composite Functions and Inverse Functions
Composite functions are closely connected to inverse functions.
If f⁻¹ is the inverse of f, then:
f⁻¹(f(x)) = x
and:
f(f⁻¹(x)) = x
This means a function and its inverse cancel each other.
You can think of them as special composite functions that return the original input.
Example Math 5
Given:
f(x) = 2x + 5
and:
f⁻¹(x) = (x – 5)/2
find:
f⁻¹(f(x))
Substitute:
f(x) = 2x + 5
into f⁻¹:
f⁻¹(2x + 5)
= [(2x + 5) – 5]/2
= 2x/2
= x
Therefore:
f⁻¹(f(x)) = x
Three Functions
Sometimes you may see three functions.
For example:
f(g(h(x)))
Always start with the innermost function.
The order is:
h first → g second → f last
So:
f(g(h(x)))
means:
- Find h(x).
- Put it into g.
- Put that result into f.
Example with Three Functions
Suppose:
f(x) = x + 1
g(x) = 2x
h(x) = x²
Find:
f(g(h(2)))
Start with:
h(2) = 2²
= 4
Then:
g(4) = 2(4)
= 8
Then:
f(8) = 8 + 1
= 9
Therefore:
f(g(h(2))) = 9
Function Machine Method
For:
f(g(x))
draw mentally:
x → g → f
For:
g(f(x))
draw:
x → f → g
For:
f(g(h(x)))
draw:
x → h → g → f
This simple visual method helps prevent order mistakes.
Exam Tip
When you see a composite function, look for the innermost brackets.
For:
f(g(4))
do:
g(4)
first.
Then put that answer into:
f
Remember:
inside first
A/A* Exam Technique
For algebraic composite functions:
- Write the inside function.
- Substitute the entire expression into the outside function.
- Use brackets.
- Expand carefully.
- Simplify fully.
- Check domain restrictions if fractions or square roots are involved.
For example:
f(x) = x² + 1
g(x) = 3x – 2
Then:
f(g(x)) = (3x – 2)² + 1
Do not skip the brackets.
Common Mistakes
Mistake 1: Doing the Outside Function First
For:
f(g(x))
do not apply f first.
Correct order:
g first, then f
Mistake 2: Assuming f(g(x)) = g(f(x))
Usually:
f(g(x)) ≠ g(f(x))
Order matters.
Mistake 3: Forgetting Brackets
If:
f(x) = x²
g(x) = 2x + 1
then:
f(g(x)) = (2x + 1)²
not:
2x + 1²
Mistake 4: Replacing Only One x
Suppose:
f(x) = x² + 3x
and:
g(x) = x + 1
Then:
f(g(x))
means replace every x in f with:
x + 1
So:
f(g(x)) = (x + 1)² + 3(x + 1)
Mistake 5: Expanding Incorrectly
Remember:
(a + b)² ≠ a² + b²
Instead:
(a + b)² = a² + 2ab + b²
So:
(2x + 1)²
= 4x² + 4x + 1
Question & Answer
1. What is a composite function?
A function formed by applying one function after another.
2. What does f(g(x)) mean?
Apply g first, then apply f.
3. What does (f ∘ g)(x) mean?
It means:
f(g(x))
4. Which function do I do first?
The inside function.
5. Does f ∘ g always equal g ∘ f?
No.
Usually:
f ∘ g ≠ g ∘ f
6. Given f(x) = 2x + 1 and g(x) = x², what is f(g(x))?
f(g(x)) = 2x² + 1
7. With the same functions, what is g(f(x))?
g(f(x)) = (2x + 1)²
= 4x² + 4x + 1
8. Why are brackets important?
Because the entire inside function must replace x in the outside function.
9. Can composite functions involve three functions?
Yes.
For example:
f(g(h(x)))
10. What is the safest rule to remember?
Inside function first.
Practice Questions
1
Given:
f(x) = 2x + 3
g(x) = x + 4
find:
f(g(x))
2
Using the same functions, find:
g(f(x))
3
Given:
f(x) = x²
g(x) = x – 2
find:
f(g(x))
4
Using the same functions, find:
g(f(x))
5
Given:
f(x) = 3x + 1
g(x) = x²
find:
(f ∘ g)(2)
6
Using the same functions, find:
(g ∘ f)(2)
7
Given:
f(x) = x + 5
g(x) = 2x – 1
find:
f(g(3))
8
Given:
f(x) = x² + 1
g(x) = 2x
find:
f(g(x))
9
Given:
f(x) = 1/x
g(x) = x + 3
find:
f(g(x))
and state the value of x that is not allowed.
10
Given:
f(x) = x + 1
g(x) = 2x
h(x) = x²
find:
f(g(h(3)))
Answers
1
g(x) = x + 4
f(g(x)) = 2(x + 4) + 3
= 2x + 8 + 3
= 2x + 11
2
f(x) = 2x + 3
g(f(x)) = (2x + 3) + 4
= 2x + 7
3
f(g(x)) = (x – 2)²
= x² – 4x + 4
4
g(f(x)) = x² – 2
Answer:
x² – 2
5
g(2) = 2²
= 4
Then:
f(4) = 3(4) + 1
= 13
Answer:
13
6
f(2) = 3(2) + 1
= 7
Then:
g(7) = 7²
= 49
Answer:
49
7
g(3) = 2(3) – 1
= 5
Then:
f(5) = 5 + 5
= 10
Answer:
10
8
g(x) = 2x
So:
f(g(x)) = (2x)² + 1
= 4x² + 1
9
f(g(x)) = 1/(x + 3)
Since:
x + 3 ≠ 0
we get:
x ≠ -3
10
Start with:
h(3) = 3²
= 9
Then:
g(9) = 18
Then:
f(18) = 19
Answer:
19
Want to Know More?
After mastering composite functions, continue with:
- Function Notation
- Domain of a Function
- Range of a Function
- Inverse Functions
- One-to-One Functions
- Composite and Inverse Functions
- Functions and Graphs
- Domain Restrictions
These topics work together and are especially important for higher-level function questions.
Final Exam Reminder
The most important rule for composite functions is:
Inside first.
For:
(f ∘ g)(x)
think:
x → g → f
For:
(g ∘ f)(x)
think:
x → f → g
And remember:
f ∘ g is not usually the same as g ∘ f.
For A-grade and A* questions, use brackets carefully, substitute the whole expression, simplify fully, and check domain restrictions whenever fractions or square roots appear.
