f(g(x)) means run g first, then feed its output into f.
Step 1: Let's Learn
Read it, or press Listen and follow the words.
Order matters
f(g(x)) and g(f(x)) are usually different functions entirely.
The domain shrinks
x must be allowed into g, and g(x) must be allowed into f. Both conditions apply.
The special case
When f(g(x)) = x and g(f(x)) = x, the two are inverses of each other.
The output of one becomes the input of the next
f(g(x)) applies g first and f second. The notation reads right to left, which is a genuine source of error. Writing the substitution out rather than doing it mentally is what keeps the order straight.
Composition restricts the domain
For f(g(x)) to be defined, x must be in the domain of g, and g(x) must be in the domain of f. The resulting domain is often smaller than either function's alone, and stating it is part of the answer.
Order changes the result
f(g(x)) and g(f(x)) are generally different functions. With f(x) = x² and g(x) = x + 1, one gives (x + 1)² and the other x² + 1. Composition is not commutative and assuming otherwise is a common slip.
Decomposition matters for calculus
Recognising √(x² + 1) as a composition of the square root with x² + 1 is exactly what the chain rule needs. Practising the decomposition now makes the chain rule feel routine rather than mysterious.
Step 2: Try It Yourself
Tap and try it out.
Step 3: Watch an Example
One step at a time.
Watch Yusuf Compose Both Ways
With f(x) = x + 3 and g(x) = x², Yusuf computes both composites at x = 2.
- Step 1
f(g(2)): g(2) = 4, then f(4) = 7.
Step 4: Your Turn
Practice makes it stick.
Inside First
Problem 1 of 2
f(x) = x + 1, g(x) = 2x. What is f(g(3))?
The Other Order
Problem 2 of 2
Same functions. What is g(f(3))?
Run Them In Order
1 of 8
f(x) = x + 5, g(x) = 3x. f(g(2))?
2 of 8
Same functions. g(f(2))?
3 of 8
f(x) = x², g(x) = x − 1. f(g(4))?
4 of 8
f(x) = 2x, g(x) = x/2. f(g(10))?
5 of 8
Are those two functions inverses? 1 for yes, 0 for no.
6 of 8
Order the steps for evaluating f(g(x)) at a number.
- 1Compute the output of g
- 2Substitute that output into f
- 3Substitute the number into g
7 of 8
f(x) = x + 4, g(x) = x − 4. f(g(9))?
8 of 8
Is f(g(x)) generally the same as g(f(x))? 1 for yes, 0 for no.
Step 5: Quick Check
Show what you know.
Question 1 of 1
f(x) = x + 2, g(x) = 5x. f(g(3))?
What You Learned
- f(g(x)) runs g first, then f.
- The order almost always changes the result.
- When both composites return x, the functions are inverses.