Combining two functions by substituting
one function's formula in place
of each x in
the other function's formula. The composition of functions
f and g is
written f ° g,
and is read aloud "f composed with g." The formula for f ° g
is written (f ° g)(x). This is read aloud "f composed with g of x."
Note: Composition is not commutative. That is, (f ° g)(x) is usually different from (g ° f)(x). The example below illustrates this.
g(x) = The output of g, which becomes the input to f
Worked Example
Problem:Let f(x)=2x+3 and g(x)=x2. Find (f∘g)(x) and evaluate it at x=4.
Step 1:Write the composition definition. (f∘g)(x) means apply g first, then f.
(f∘g)(x)=f(g(x))
Step 2:Substitute g(x)=x2 into f. Everywhere f has its input variable, replace it with x2.
f(x2)=2(x2)+3=2x2+3
Step 3: So the composed function is:
(f∘g)(x)=2x2+3
Step 4:Evaluate at x=4 by substituting into the result.
(f∘g)(4)=2(4)2+3=2(16)+3=32+3=35
Answer:(f∘g)(x)=2x2+3, and (f∘g)(4)=35.
Another Example
This example reverses the order of composition to demonstrate that f∘g and g∘f generally produce different results — a key property students must understand.
Problem:Using the same functions f(x)=2x+3 and g(x)=x2, find (g∘f)(x) and evaluate it at x=4. Compare to the first example to see that composition is not commutative.
Step 1:Write the composition in the reversed order. (g∘f)(x) means apply f first, then g.
(g∘f)(x)=g(f(x))
Step 2:Substitute f(x)=2x+3 into g. Since g squares its input, square the entire expression (2x+3).
g(2x+3)=(2x+3)2
Step 3: Expand the squared binomial.
(2x+3)2=4x2+12x+9
Step 4:Evaluate at x=4.
(g∘f)(4)=4(16)+12(4)+9=64+48+9=121
Step 5:Compare: (f∘g)(4)=35 but (g∘f)(4)=121. The order matters.
(f∘g)(4)=(g∘f)(4)
Answer:(g∘f)(x)=4x2+12x+9, and (g∘f)(4)=121. This differs from (f∘g)(4)=35, confirming composition is not commutative.
Frequently Asked Questions
What is the difference between composition and multiplication of functions?
Multiplication of functions means (f⋅g)(x)=f(x)×g(x) — you evaluate both functions at x and multiply the outputs. Composition means (f∘g)(x)=f(g(x)) — you feed the output of g into f as its input. These are fundamentally different operations and almost always give different results.
Does the order of composition matter?
Yes. Composition is not commutative, meaning (f∘g)(x) is generally not equal to (g∘f)(x). In f∘g, you apply g first and then f. Reversing the order changes which function processes the input and which processes the intermediate result. Always pay close attention to which function is the outer function and which is the inner function.
How do you find the domain of a composition?
The domain of (f∘g)(x) consists of all x-values in the domain of g for which g(x) is also in the domain of f. First, x must be a valid input for g. Second, the output g(x) must be a valid input for f. You need to check both conditions.
Composition $(f \circ g)(x)$ vs. Multiplication $(f \cdot g)(x)$
Composition $(f \circ g)(x)$
Multiplication $(f \cdot g)(x)$
Definition
Output of g becomes input of f: f(g(x))
Multiply the two outputs: f(x)⋅g(x)
Notation
(f∘g)(x) with a small circle
(f⋅g)(x) or f(x)g(x)
Commutative?
No — order usually matters
Yes — multiplication is commutative
Example with f(x)=2x, g(x)=x+1
f(g(x))=2(x+1)=2x+2
f(x)⋅g(x)=2x(x+1)=2x2+2x
Why It Matters
Composition appears throughout algebra, precalculus, and calculus. The chain rule in calculus — one of the most important differentiation rules — is built entirely on recognizing a function as a composition. You also use composition to verify that two functions are inverses: if (f∘g)(x)=x and (g∘f)(x)=x, then f and g are inverse functions.
Common Mistakes
Mistake:Applying the functions in the wrong order. Students see (f∘g)(x) and apply f first because f appears first when reading left to right.
Correction:Remember that (f∘g)(x)=f(g(x)). The inner function g acts on x first, and then f acts on the result. Work from the inside out: start with g(x), then plug that into f.
Mistake:Confusing composition with multiplication. Students interpret f∘g as f(x)×g(x).
Correction:The circle symbol ∘ means composition, not multiplication. Composition feeds one function's output into the other; multiplication computes both outputs separately and multiplies them. These give different results.
Related Terms
Function — Composition combines two functions into one
Formula — Substitution of formulas performs composition