Composite Functions: How to Compose and Decompose Functions
Solver AI TeamPublished Updated 11 min read
Learn composite functions from scratch. Covers notation, evaluation, domain restrictions, decomposition into simpler pieces, and the connection to inverse functions.
Frequently asked questions
How do you find f(g(x)) when f(x) = x² and g(x) = x + 3?
Replace every x in f with the whole expression g(x). Since f(x) = x², f(g(x)) = (x + 3)² = x² + 6x + 9. Work from the inside out: evaluate g first, then plug that result into f.
Is f(g(x)) the same as g(f(x))?
Usually not. Composition is not commutative. With f(x) = x² and g(x) = x + 3, f(g(x)) = (x + 3)² but g(f(x)) = x² + 3. The order matters because the inner function acts first.
How do you find the domain of a composite function?
Start with the domain of the inner function g, then remove any x where g(x) is outside the domain of f. For f(g(x)), x must be allowed in g, and g(x) must be allowed in f. Check both conditions on the original expression, not only the simplified one.
What does the small circle in (f ∘ g)(x) mean?
The circle ∘ means composition. (f ∘ g)(x) is read as f of g of x and equals f(g(x)). It does not mean multiplication, so (f ∘ g)(x) is not the same as f(x) · g(x).
How do you decompose a function into two functions?
Look for an inside piece and an outside piece. For h(x) = √(2x + 1), let g(x) = 2x + 1 as the inner function and f(x) = √x as the outer function, so h(x) = f(g(x)). The inside is usually what sits in parentheses, under a root, or in an exponent.
A composite function is the result of applying one function to the output of another. If you have functions f and g, the composition (f ∘ g)(x) means "do g first, then apply f to the result."
Definition — Composition Operator
The notation (f ∘ g)(x) = f(g(x)) reads "f of g of x." The little circle (∘) is the composition operator. Note that composition is read right-to-left: f ∘ g means g happens first, then f.
Real-world analogy
Imagine making a sandwich. The function g might be "add cheese" and the function f might be "toast." Then f ∘ g means add cheese, then toast — a toasted cheese sandwich. The order matters: g ∘ f would mean toast first, then add cheese — totally different result.
Why composition matters
Composite functions appear constantly in math and the sciences. The chain rule in calculus exists specifically because we need to differentiate composite functions. Many real-world models — temperature as a function of altitude as a function of time, for example — are inherently compositions. Understanding the mechanics of composition is essential before you can master derivatives, integrals, or transformations.
How to Evaluate Composite Functions
Evaluating a composite function at a specific number is just substitution applied twice.
Apply the inner function first
Take your input and run it through the inner function.
Apply the outer function
Take that result and apply the outer function.
Example 1 — evaluating (f ∘ g)(4)
Given f(x) = x² + 1 and g(x) = 3x − 2, find (f ∘ g)(4).
Step 1 — apply g to 4: g(4) = 3(4) − 2 = 10.
Step 2 — apply f to 10: f(10) = 10² + 1 = 101.
Answer(f ∘ g)(4) = 101
Example 2 — reversing the order
Same functions, find (g ∘ f)(4).
Step 1 — apply f: f(4) = 16 + 1 = 17.
Step 2 — apply g: g(17) = 3(17) − 2 = 49.
Answer(g ∘ f)(4) = 49
The Key Insight
Notice the difference: (f ∘ g)(4) = 101 but (g ∘ f)(4) = 49. Composition is not commutative — order matters.
Example 3 — square roots
Given f(x) = √x and g(x) = x − 4, find (f ∘ g)(20).
Step 1: g(20) = 16.
Step 2: f(16) = 4.
Answer4
The procedure is mechanical — once you've done a few of these, they become second nature.
Finding the Composite Function as an Expression
Sometimes you need not just a value, but the full composed expressionf(g(x)). This requires substituting the entire function g(x) wherever x appears in f.
Example 1 — composing f(g(x))
Given f(x) = x² + 1 and g(x) = 3x − 2, find f(g(x)).
Substitute g(x) = 3x − 2 wherever x appears in f: f(g(x)) = (3x − 2)² + 1.
The two compositions 9x² − 12x + 5 and 3x² + 1 are different functions — confirming again that order matters.
Example 3 — square root composition
Given f(x) = √x and g(x) = x² + 4, find f(g(x)).
f(g(x)) = √(x² + 4).
Answer√(x² + 4)
Common Mistake
Notice we don't simplify further because √(x² + 4) ≠ x + 2 — this is a common error. The square root of a sum is not the sum of the square roots. Always be careful with operations like square roots, exponents, and trig functions when composing.
Domain of a Composite Function
The Rule — Domain of f ∘ g
The domain of f ∘ g is the set of all x values such that (1) x is in the domain of g, AND (2) g(x) is in the domain of f. Both conditions must be satisfied.
Common Mistake
Many students forget condition (2) and get the domain wrong.
Example — square root composition
Find the domain of (f ∘ g)(x) where f(x) = √x and g(x) = x − 4.
Step 1 — domain of g: all real numbers (no restrictions).
Step 2 — for f(g(x)) = √(x − 4) to be defined, we need x − 4 ≥ 0, so x ≥ 4.
Domain[4, ∞)
Example — reciprocal composition
Find the domain of (f ∘ g)(x) where f(x) = 1/x and g(x) = x² − 9.
Step 1 — domain of g: all real numbers.
Step 2 — f(g(x)) = 1/(x² − 9). We need x² − 9 ≠ 0, so x ≠ ±3.
Domainall reals except ±3
Example — nested radicals
Find the domain of (f ∘ g)(x) where f(x) = √x and g(x) = √(x − 1).
Step 1 — domain of g: x ≥ 1.
Step 2 — for f(g(x)) = √(√(x − 1)), we need √(x − 1) ≥ 0, which is automatic since square roots are non-negative.
Domain[1, ∞)
The discipline of checking both conditions prevents errors that are very common on exams.
Decomposing Functions
Sometimes you need to do the reverse: given a complex function h(x), find functions f and g so that h(x) = f(g(x)). This skill is essential for the chain rule in calculus and for simplifying expressions.
The Key Insight
The trick is to identify a natural "inside" and "outside" — the inner function is what's being computed first, the outer function is applied to that result.
Example 1 — power of a linear expression
Decompose h(x) = (3x + 5)⁴.
The inner function is g(x) = 3x + 5. The outer function is f(x) = x⁴.
Multiple decompositions are possible; pick the one that makes the most natural "layers." When you take calculus, this skill becomes critical for applying the chain rule efficiently.
Connection to Inverse Functions
Composition is the formal way to verify that two functions are inverses.
The Rule — Inverse via Composition
Recall that f⁻¹(x) is the inverse of f(x) if and only if both f(f⁻¹(x)) = x and f⁻¹(f(x)) = x. Both of these statements are about composition: composing a function with its inverse (in either order) returns the input unchanged. This means inverse functions "undo" each other.
Example — verifying inverses
Verify that f(x) = 2x + 3 and g(x) = (x − 3)/2 are inverses.
f(g(x)) = 2 · (x − 3)/2 + 3 = (x − 3) + 3 = x. ✓
g(f(x)) = (2x + 3 − 3)/2 = 2x/2 = x. ✓
ConclusionBoth compositions return x, so they are inverses
The Key Insight
The identity function I(x) = x acts like a "do nothing" composition: f ∘ I = I ∘ f = f for any function f. The inverse function is exactly what you compose with to get back to the identity. This perspective unifies a lot of seemingly separate algebra concepts.
The Takeaway
For practice with composition or inverse problems, scan them with Solver AI for step-by-step solutions and verification of every step.