Function Composition: f(g(x)) vs g(f(x))
Problem
If f(x)=x² and g(x)=x+3, visualize f(g(x))=(x+3)² vs g(f(x))=x²+3. Show they are different!
Explanation
Function composition: a pipeline
means "apply first, then feed the result into ." Think of it as a pipeline: input → → output₁ → → final output.
Step-by-step: ,
: Replace in with : .
: Replace in with : .
They're different! , but . Composition is not commutative.
The key rule
In : the inner function () gets applied first. Replace the in the outer function's formula with the entire inner function.
Common mistake
Confusing with . Composition is substitution, not multiplication!
Try it in the visualization
Both compositions are graphed. Trace an input through the pipeline: see it enter , then . The resulting curves are visibly different, proving . in general. For : vs .
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.