STEP-BY-STEP LESSON · §7.3
Composition of Functions
Read composition from right to left and check compatible domains.
Before you begin
Functions Defined on General Sets
X is the set of allowed inputs; Y is the declared set of possible outputs. Both are part of the function specification.
f:X→Y
Every x∈X must have exactly one image in Y. Different inputs may share an output.
∀x∈X ∃!y∈Y: y=f(x)
Symbols
- g∘f
- first f, then g
Definitions and notation for this topic
Composition
(g∘f)(x)=g(f(x))
For f:A→B and g:B→C, the composite g∘f:A→C applies f first and then g to its output.
The inside function acts first. More generally composition is defined when every output of f used here lies in the domain of g; reversing the order can change the result or be undefined.
Separate glossary example
On ℝ, let f(x)=x+1 and g(x)=x². Then (g∘f)(x)=(x+1)², whereas (f∘g)(x)=x²+1.
Step by step
Step 1 / 6
Trace the input
In g∘f, input x first passes through f. The result f(x) becomes the input to g.
(g∘f)(x)=g(f(x))
The function closest to x acts first.
Worked example
f(x)=x+1 and g(x)=2x on ℝ. Compare the compositions.
- (g∘f)(x)=g(x+1)=2(x+1)=2x+2: add first, then double.
- (f∘g)(x)=f(2x)=2x+1: double first, then add.
- At x=0 the outputs are 2 and 1; this suffices to show the functions are unequal.
Optional self-check
For these f,g, what is (g∘f)(3)?
Show answer
8: f(3)=4, then g(4)=8.