What is Composition?
Composition is feeding the output of one function into another.
f(g(x))
First evaluate g(x), then feed that result into f.
Notation
(f∘g)(x)=f(g(x))
Read as “f composed with g” or “f of g of x”.
Think of it as a chain: input → g → output → f → final output
Example
Let f(x)=x2 and g(x)=x+3.
Find (f∘g)(x):
(f∘g)(x)=f(g(x))=f(x+3)=(x+3)2 Find (g∘f)(x):
(g∘f)(x)=g(f(x))=g(x2)=x2+3
Order Matters!
Notice that (x+3)2=x2+3.
Composition is not commutative. In general, f∘g=g∘f.
Evaluating at a Point
Find (f∘g)(2) where f(x)=x2 and g(x)=x+3:
Method 1: Work from the inside out
g(2)f(g(2))=2+3=5=f(5)=25 Method 2: Find the composed function first
(f∘g)(x)(f∘g)(2)=(x+3)2=(2+3)2=25
Decomposing Functions
Sometimes you need to work backwards: express a function as a composition.
Example: Write h(x)=x2+1 as f(g(x)).
Think: what’s the “outer” operation and what’s the “inner” operation?
- Outer: taking a square root
- Inner: x2+1
So: f(x)=x and g(x)=x2+1
Check: f(g(x))=f(x2+1)=x2+1 ✓
Domain of Composed Functions
For (f∘g)(x)=f(g(x)):
- x must be in the domain of g
- g(x) must be in the domain of f
Example: f(x)=x and g(x)=x−4
- Domain of g: all real numbers
- Domain of f: x≥0
For f(g(x))=x−4:
- We need g(x)≥0
- So x−4≥0, meaning x≥4
Domain of f∘g: x≥4