Composite Functions
In a supply chain, raw materials go to a factory, and the factory's output goes to a distribution centre. The final product depends on two connected processes — one after the other. Composite functions work exactly the same way: one function feeds its output directly into another.
Practise this lesson
Three printable worksheets that build from foundations to mastery — or build your own from any module’s questions.
Imagine two machines. Machine A doubles its input. Machine B adds 3 to its input. If you put a number into Machine A, then take the output and feed it into Machine B, what is the overall rule? Does it matter whether Machine A or Machine B goes first?
$$(f \circ g)(x) = f(g(x))$$
Key insight: Order matters. In almost all cases, $f(g(x)) \neq g(f(x))$.
Key facts
- the notation $(f \circ g)(x) = f(g(x))$
- how to evaluate composite functions numerically
- the domain conditions for composite functions
Concepts
- why composite functions model chained processes
- why order matters in composition
- how the domain of a composite is restricted by both inner and outer functions
Skills
- evaluate composite functions for given inputs
- find the algebraic expression for a composite function
- determine the domain of a composite function
- compare $f \circ g$ and $g \circ f$ and explain when they differ
A composite function is formed when the output of one function becomes the input of another. We write this as $(f \circ g)(x)$, which means $f(g(x))$: first apply $g$, then apply $f$ to the result.
The notation can be confusing at first. Remember:
- $(f \circ g)(x)$ is read "$f$ composed with $g$" or "$f$ of $g$ of $x$"
- The function on the right ($g$) is applied first
- The function on the left ($f$) is applied second
How to evaluate a composite function
- Start with the inner function. Evaluate $g(x)$ for the given input.
- Take that result and use it as the input for the outer function $f$.
- Simplify.
How to find the algebraic expression
To find $(f \circ g)(x)$ algebraically, substitute the entire expression for $g(x)$ into every $x$ in $f(x)$. Use brackets to avoid errors.
Domain of a composite function
The domain of $f \circ g$ has two requirements:
- $x$ must be in the domain of $g$
- $g(x)$ must be in the domain of $f$
Both conditions must be satisfied. If either fails, the composite is undefined at that point.
$(f \circ g)(x) = f(g(x))$ — $g$ is the inner function (applied first), $f$ is the outer function (applied second); Evaluation: Step 1: evaluate $g(x)$; Step 2: use that result as input for $f$; Step 3: simplify
Pause — copy the composite notation $(f \circ g)(x) = f(g(x))$ and the three-step evaluation procedure (evaluate inner $g$ first, feed result into outer $f$, simplify) into your book.
Did you get this? True or false: in $(f \circ g)(x)$, the function $f$ is applied first.
Quick check: If $f(x) = 2x$ and $g(x) = x + 3$, what is $(f \circ g)(x)$?
We just saw that $f(g(x))$ means: apply $g$ first, then feed the result into $f$. That raises a question: what if we reverse the order — does $f(g(x))$ always equal $g(f(x))$? This card answers it → composition is not commutative: swapping the order almost always gives a different function.
In most cases, $f(g(x)) \neq g(f(x))$. Composition is not commutative. The order in which you apply the functions usually changes the result.
For example, if $f(x) = x + 1$ and $g(x) = x^2$:
- $(f \circ g)(x) = f(g(x)) = f(x^2) = x^2 + 1$
- $(g \circ f)(x) = g(f(x)) = g(x + 1) = (x + 1)^2 = x^2 + 2x + 1$
These are clearly different expressions. In real-world terms, it matters whether you double a price and then add tax, or add tax and then double the price.
$f(g(x))$ is generally NOT equal to $g(f(x))$; Composition is not commutative — order always matters
Pause — copy the non-commutativity rule ($f(g(x)) \neq g(f(x))$ in general) with a worked counter-example showing the two different results into your book.
Odd one out: Which statement about composite functions is FALSE?
Worked examples · reveal as you go
If $f(x) = 2x + 1$ and $g(x) = x^2 - 3$, find $(f \circ g)(2)$ and $(g \circ f)(2)$.
If $f(x) = 3x - 2$ and $g(x) = x + 4$, find $(f \circ g)(x)$ and $(g \circ f)(x)$.
Find the domain of $(f \circ g)(x)$ where $f(x) = \sqrt{x}$ and $g(x) = x - 5$.
Common mistakes · the 4 traps that cost marks
Applying the functions in the wrong order
$(f \circ g)(x)$ means $g$ first, then $f$. Many students do the opposite, especially when both functions are simple. This almost always leads to a wrong answer.
✓ Fix: Write "INNER = $g(x)$" and "OUTER = $f(\text{inner})$" before you substitute any numbers.
Assuming $f(g(x)) = g(f(x))$
Composition is not commutative. Unless there is a specific reason (like when $f$ and $g$ are inverses), the order matters.
✓ Fix: Treat every composition problem as order-dependent unless you have proven otherwise.
Forgetting brackets when substituting algebraic expressions
If $f(x) = x^2 + 1$ and you want $f(x + 3)$, writing $x + 3^2 + 1$ is wrong. The entire expression $x + 3$ must be squared: $(x + 3)^2 + 1$.
✓ Fix: Always use brackets around the substituted expression before simplifying.
Ignoring the domain of the inner function
When finding the domain of a composite, students often check only the outer function's domain and forget that the input $x$ must first be valid for the inner function $g$.
✓ Fix: Domain of $f \circ g$ = domain of $g$ intersected with the set of $x$ where $g(x)$ is in the domain of $f$.
Activity 1 — Evaluate the composites
Let $f(x) = 2x + 3$ and $g(x) = x^2 - 1$. Find each of the following.
$(f \circ g)(1)$
$(g \circ f)(1)$
$(f \circ g)(x)$ in simplified form
$(g \circ f)(x)$ in simplified form
Fill the blanks: drag each token into the matching blank.
In $(f \circ g)(x)$, the function $g$ is the ___ function and is applied ___. The function $f$ is the ___ function and is applied ___.
Quick-fire practice · 5 reps +2 XP per reveal
If $f(x) = 2x$ and $g(x) = x + 3$, find $(f \circ g)(4)$.
If $f(x) = x^2$ and $g(x) = x - 1$, find $(g \circ f)(3)$.
Find $(f \circ g)(x)$ where $f(x) = 3x + 1$ and $g(x) = x^2$.
Find the domain of $(f \circ g)(x)$ where $f(x) = \sqrt{x}$ and $g(x) = x + 2$.
Is there a case where $(f \circ g)(x) = (g \circ f)(x)$? Give an example.
Earlier you were asked: If Machine A doubles its input and Machine B adds 3, what is the overall rule? Does it matter which machine goes first?
If A goes first and then B, the overall rule is $B(A(x)) = 2x + 3$. If B goes first and then A, the overall rule is $A(B(x)) = 2(x + 3) = 2x + 6$. These are different results, so yes — the order matters. This is the fundamental nature of composite functions: $(f \circ g)(x)$ is not the same as $(g \circ f)(x)$ unless the functions have a special relationship (like being inverses). In supply chains, manufacturing, and even cooking, the order in which you apply processes almost always changes the final outcome.
Pick your answer, then rate your confidence — that tells the system what to drill next.
Q8. Let $f(x) = 2x - 1$ and $g(x) = x^2 + 3$. (a) Find $(f \circ g)(x)$ in expanded form. (b) Find $(g \circ f)(x)$ in expanded form. (c) Show that $(f \circ g)(x) \neq (g \circ f)(x)$. (4 marks)
Q9. Find the domain of $(f \circ g)(x)$ where $f(x) = \sqrt{x + 2}$ and $g(x) = x - 3$. Show the inequality you solve and write your final answer in interval notation. (3 marks)
Q10. A student claims that $(f \circ g)(x)$ and $(g \circ f)(x)$ are always different. Evaluate this claim by considering the functions $f(x) = x + 2$ and $g(x) = x - 2$. Calculate both composites and explain what this example tells you about the student's claim. (3 marks)
Comprehensive answers (click to reveal)
Multiple choice — drill bank
MC answers and feedback are shown inline as you complete each question. Use the retry button to attempt a fresh set.
1. B — $(f \circ g)(x) = f(g(x)) = f(x + 3) = 2(x + 3) = 2x + 6$.
2. B — $(g \circ f)(2) = g(f(2)) = g(4) = 4 + 1 = 5$.
3. B — $(f \circ g)(x) = f(g(x))$.
4. C — $\sqrt{x - 4}$ requires $x \geq 4$.
5. A — $(f \circ g)(x) = f(x^2) = 3x^2 - 1$.
Activity 1 — Evaluate the composites model answers
1. $g(1) = 1^2 - 1 = 0$, so $(f \circ g)(1) = f(0) = 2(0) + 3 = 3$.
2. $f(1) = 2(1) + 3 = 5$, so $(g \circ f)(1) = g(5) = 5^2 - 1 = 24$.
3. $(f \circ g)(x) = f(x^2 - 1) = 2(x^2 - 1) + 3 = 2x^2 + 1$.
4. $(g \circ f)(x) = g(2x + 3) = (2x + 3)^2 - 1 = 4x^2 + 12x + 9 - 1 = 4x^2 + 12x + 8$.
Short answer model answers
Q8 (4 marks):
(a) $(f \circ g)(x) = f(x^2 + 3) = 2(x^2 + 3) - 1 = 2x^2 + 5$ [1]
(b) $(g \circ f)(x) = g(2x - 1) = (2x - 1)^2 + 3 = 4x^2 - 4x + 1 + 3 = 4x^2 - 4x + 4$ [1]
(c) $2x^2 + 5 \neq 4x^2 - 4x + 4$ for most values of $x$ [1]. Therefore $(f \circ g)(x) \neq (g \circ f)(x)$ [1].
Q9 (3 marks): $(f \circ g)(x) = f(x - 3) = \sqrt{(x - 3) + 2} = \sqrt{x - 1}$ [1]. We need $x - 1 \geq 0$ [1]. Domain: $[1, \infty)$ [1].
Q10 (3 marks): The student's claim is false [1]. $(f \circ g)(x) = f(x - 2) = (x - 2) + 2 = x$ [0.5]. $(g \circ f)(x) = g(x + 2) = (x + 2) - 2 = x$ [0.5]. In this case, both composites equal $x$ because $f$ and $g$ are inverses of each other [1]. This shows that while composition is not generally commutative, there are special cases where the two composites are the same.
Five timed questions on composite functions. Beat the boss to bank a tier — gold (perfect + fast), silver (80%+), or bronze (cleared).
Enter the arenaClimb platforms, hit checkpoints, and answer composite functions questions. Quick recall, lighter than the boss.
Mark lesson as complete
Tick when you've finished the practice and review.