What Is a Composite Function?
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."
(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.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.
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.
(f ∘ g)(4) = 101Same functions, find (g ∘ f)(4).
Step 1 — apply f: f(4) = 16 + 1 = 17.
Step 2 — apply g: g(17) = 3(17) − 2 = 49.
(g ∘ f)(4) = 49Notice the difference: (f ∘ g)(4) = 101 but (g ∘ f)(4) = 49. Composition is not commutative — order matters.
Given f(x) = √x and g(x) = x − 4, find (f ∘ g)(20).
Step 1: g(20) = 16.
Step 2: f(16) = 4.
4The 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 expression f(g(x)). This requires substituting the entire function g(x) wherever x appears in f.
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.
Expand: = 9x² − 12x + 4 + 1 = 9x² − 12x + 5.
f(g(x)) = 9x² − 12x + 5Same functions, find g(f(x)).
Substitute f(x) = x² + 1 wherever x appears in g: g(f(x)) = 3(x² + 1) − 2 = 3x² + 3 − 2 = 3x² + 1.
g(f(x)) = 3x² + 1The two compositions 9x² − 12x + 5 and 3x² + 1 are different functions — confirming again that order matters.
Given f(x) = √x and g(x) = x² + 4, find f(g(x)).
f(g(x)) = √(x² + 4).
√(x² + 4)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
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.Many students forget condition (2) and get the domain wrong.
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.
[4, ∞)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.
all reals except ±3Find 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.
[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 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.
Decompose h(x) = (3x + 5)⁴.
The inner function is g(x) = 3x + 5. The outer function is f(x) = x⁴.
Check: f(g(x)) = (3x + 5)⁴. ✓
g(x) = 3x + 5, f(x) = x⁴Decompose h(x) = √(x² + 1).
Inner: g(x) = x² + 1. Outer: f(x) = √x.
Check: f(g(x)) = √(x² + 1). ✓
g(x) = x² + 1, f(x) = √xDecompose h(x) = sin(2x + 1).
Inner: g(x) = 2x + 1. Outer: f(x) = sin(x).
Check: f(g(x)) = sin(2x + 1). ✓
g(x) = 2x + 1, f(x) = sin(x)Decompose h(x) = e^(√(x² + 1)).
Innermost: g(x) = x² + 1. Middle: m(x) = √x. Outer: f(x) = eˣ.
h(x) = f(m(g(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.
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.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. ✓
Both compositions return x, so they are inversesThe 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.
For practice with composition or inverse problems, scan them with Solver AI for step-by-step solutions and verification of every step.