Math101learn.math101.caFunction Composition
Function composition sends an input through one function and then uses that output as the input of another.
Composition builds a multi-step process by placing one function inside another.
Reading the notation
The composition of $f$ with $g$ is written
Read it from right to left: apply $g$ first, then apply $f$ to the result. The circle is not multiplication. It signals that one output feeds another input.
A machine interpretation
Imagine $g$ as the first machine and $f$ as the second. An input $x$ enters $g$, producing $g(x)$. That entire expression then enters $f$.
If $g$ converts hours to kilometres and $f$ converts kilometres to cost, then $f\circ g$ converts hours directly to cost. Composition turns linked relationships into one function.
Evaluating from values or a table
To find $(f\circ g)(2)$, first find $g(2)$. Suppose $g(2)=5$. Then look for $f(5)$. If $f(5)=-1$, the composition equals $-1$.
The intermediate value must be a valid input for $f$. A table may contain $g(2)$ but not contain the necessary row for $f(g(2))$; in that case the composition cannot be evaluated from the supplied data.
Finding a composition formula
Replace every $x$ in the outside function with the complete inside function. Parentheses are essential.
If
then
Changing the order gives a different result:
Composition is generally not commutative.
Worked example with careful substitution
Domain restrictions
An input belongs to the domain of $f\circ g$ only when two conditions hold:
- $x$ is allowed by $g$;
- the output $g(x)$ is allowed as an input to $f$.
For example, if $f(x)=\sqrt{x}$ and $g(x)=x-5$, then
requires $x\ge5$. The domain is not automatically the intersection of the original domains; the inside output condition matters.
Composition and inverse functions
Inverse functions are special because they undo one another under composition:
on the appropriate domains. This identity is the strongest algebraic check that two candidate formulas are inverses.
Decomposing a function
Sometimes a complicated function can be recognized as a composition. For
one choice is $g(x)=5x+1$ and $f(x)=\sqrt{x}$, so $h=f\circ g$. Decomposition helps explain transformations and prepares for the chain rule in calculus.
There may be more than one valid decomposition, depending on which meaningful steps are isolated.
Modelling chained relationships
Suppose a taxi distance is $d(t)=40t$ kilometres after $t$ hours, and fuel cost is $C(d)=0.18d$ dollars for distance $d$. Then
The composite model converts hours directly to fuel cost. Tracking units through the chain helps confirm the order.
Common mistakes
Applying the left function first. In $f\circ g$, $g$ acts first.
Multiplying $f(x)g(x)$. Composition is substitution, not multiplication.
Dropping parentheses. $f(3x-2)$ requires replacing every input with the entire expression.
Assuming $f\circ g=g\circ f$. Test the two orders separately.
Ignoring the inside output restriction. A composite can have a narrower domain.
Quick self-check
- Which function acts first?
- Did I substitute the complete inside expression with parentheses?
- Are all intermediate outputs valid inputs for the next function?
- Does the order match the real-world units or process?
- If checking inverses, do both compositions return $x$?
Related topics
Try it yourself
Hints are part of learning. Open one whenever it makes the next step feel possible.
Let f(x) = 2x + 3 and g(x) = x² − 1. What is (f ∘ g)(x)?
- f(g(x)) = 2(x² − 1) + 3
- Distribute: 2x² − 2 + 3
- Therefore (f ∘ g)(x) = 2x² + 1.
End of lesson
Nice work making it this far.
Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.
