Compose Two
Functions
Learn how to feed one function into another to build powerful new relationships: from notation to real-world applications.
What Is Function Composition?
Function composition takes the output of one function and uses it as the input of another. If you have two functions \( f \) and \( g \), the composition \( f(g(x)) \) means: first evaluate \( g(x) \), then plug that result into \( f \).
The Machine Analogy
Step 1: Feed \( x \) into the green machine \( g \) to get \( g(x) \).
Step 2: Feed that result into the purple machine \( f \) to get \( f(g(x)) \).
Why Does It Matter?
The Notation
The composition of \( f \) with \( g \) is written as:
$$ (f \circ g)(x) = f(g(x)) $$
Visualizing \( f(g(x)) \)
\( f \circ g \) vs \( g \circ f \)
| \( f \circ g \) | \( g \circ f \) | |
|---|---|---|
| Meaning | \( f(g(x)) \) | \( g(f(x)) \) |
| Inner function | \( g \) | \( f \) |
| Outer function | \( f \) | \( g \) |
| Generally equal? | No: \( f \circ g \neq g \circ f \) in most cases | |
How to Evaluate a Composition
Example 1: Linear Composition
Let \( f(x) = 2x + 3 \) and \( g(x) = x - 1 \). Find \( (f \circ g)(x) \).
Example 2: Composition with a Quadratic
Let \( f(x) = x^2 \) and \( g(x) = 3x + 2 \). Find \( (f \circ g)(x) \).
Example 3: Both Directions
Let \( f(x) = x + 4 \) and \( g(x) = x^2 \). Compare \( f \circ g \) and \( g \circ f \).
| \( (f \circ g)(x) \) | \( (g \circ f)(x) \) | |
|---|---|---|
| Setup | \( f(g(x)) = g(x) + 4 \) | \( g(f(x)) = (f(x))^2 \) |
| Substitute | \( x^2 + 4 \) | \( (x + 4)^2 \) |
| Simplified | \( x^2 + 4 \) | \( x^2 + 8x + 16 \) |
| At \( x = 2 \) | 8 | 36 |
Evaluating at a Point
Given \( f(x) = 5x - 1 \) and \( g(x) = x^2 + 3 \), find \( (f \circ g)(2) \).
Extending to Three Functions
Composition works with more than two functions. For \( (f \circ g \circ h)(x) \), evaluate right to left:
Domain Restrictions
When composing \( f(g(x)) \), the domain requires two conditions:
Common Mistakes
Summary Table
| Concept | Details |
|---|---|
| Notation | \( (f \circ g)(x) = f(g(x)) \) |
| Read as | "f composed with g" or "f of g of x" |
| Order | Inner (\( g \)) first, outer (\( f \)) second |
| Commutative? | No: \( f \circ g \neq g \circ f \) generally |
| Domain | \( x \in \text{dom}(g) \) and \( g(x) \in \text{dom}(f) \) |
| Key method | Replace the variable in the outer with the entire inner expression |
Question 1 of 5
If \( f(x) = 3x \) and \( g(x) = x + 5 \), what is \( (f \circ g)(x) \)?
Question 2 of 5
If \( f(x) = x^2 \) and \( g(x) = x - 3 \), what is \( (f \circ g)(4) \)?
Question 3 of 5
Given \( f(x) = x + 1 \) and \( g(x) = 2x \), which statement is true?
Question 4 of 5
The expression \( (f \circ g)(x) \) means:
Question 5 of 5
If \( f(x) = \sqrt{x} \) and \( g(x) = x - 9 \), what is the domain of \( (f \circ g)(x) \)?