Composition Expansion: Evaluate a Composed Function in Two Steps
Composition Expansion lets you replace with — evaluating the inner function first and feeding its output into the outer function. The move is legal only when is in the domain of and the output is in the domain of . Checking this two-part domain chain before expanding is the core fluency skill built by the Unisium Study System.

On this page: The Principle | Conditions | Failure Modes | EE Questions | Retrieval Practice | Practice Ground | Solve a Problem | Related Principles | FAQ | How This Fits
The Principle
The move: At a specific input , replace the composed-function notation with the nested evaluation .
The invariant: At any input where the domain chain holds, this gives the same defined value as the composition.
Pattern:
With (domain ) and :
| Legal ✓ | Illegal ✗ |
|---|---|
| ✓; | ✗; — move invalid because |
Conditions of Applicability
Condition: ;
Before applying, check: Does land in ? Does the inner output land in ?
If the condition is violated: Expanding applies to a value outside its domain — the expression is undefined, but the notation gives no warning.
- The domain chain has two links: first, must be a valid input for ; second, must be a valid input for .
- When is defined everywhere (e.g., on ), only the second link requires explicit checking.
- When both and are defined everywhere (e.g., polynomials), both links hold trivially and the expansion is always valid.
Want the complete framework behind this guide? Read Masterful Learning.
Common Failure Modes
Failure mode: expand without checking whether → is applied to a value outside its domain, producing an undefined or meaningless result with no visible error signal.
Debug: After computing , ask: “Is this output a valid input for ?” If not, the composition is undefined at — stop before evaluating .
Failure mode: reverse the order and write instead of → a completely different function value is computed; the error is silent because neither function complains about the wrong ordering.
Debug: Read right-to-left: is applied first, then . The rightmost function always acts first.
Elaborative Encoding
Use these questions to build deep understanding. (See Elaborative Encoding for the full method.)
Within the Principle
- What does the notation mean, and why does evaluating first (rather than first) produce the correct result?
- Why does the domain chain require two separate checks rather than one? What would it mean for only the first link to hold and the second to fail?
For the Principle
- How do you decide, before computing anything, whether composition expansion is valid at a given input?
- What would change if ‘s domain were all real numbers — would any part of the condition check become unnecessary?
Between Principles
- How does composition expansion relate to the input-recovery form of inverse cancellation () in terms of domain chain structure? What condition must hold for that form, and how does it compare?
Generate an Example
- Describe a composition where is defined at but falls outside , making the expansion invalid. Choose specific functions and a specific input value to make the failure concrete.
Retrieval Practice
Answer from memory, then click to reveal and check. (See Retrieval Practice for the full method.)
State the composition expansion move in one sentence: _____Replace (f ∘ g)(a) with f(g(a)): evaluate the inner function g at a, then evaluate the outer function f at that result.
Write the canonical expansion pattern: _____
State the canonical condition: _____
Practice Ground
Use these exercises to build move-selection fluency. (See Self-Explanation for how to use worked examples effectively.)
Procedure Walkthrough
Starting from with (domain ) and (domain ), evaluate the composition.
| Step | Expression | Operation |
|---|---|---|
| 0 | — | |
| 1 | Inner output: | |
| 2 | First link: ✓ (automatic); second link: ✓ | |
| 3 | Domain chain satisfied — apply composition expansion | |
| 4 | Evaluate outer: |
Drills
Forward step — verify the domain chain, then evaluate
Drill 1. Let and (both defined everywhere). Evaluate .
Reveal
✓; ✓.
Drill 2. Let (domain ) and (domain ). Verify the domain chain, then evaluate .
Reveal
✓; ✓.
Drill 3 (eligibility — which inputs are valid?). Let (domain ) and . Which inputs from allow composition expansion?
Reveal
Check , i.e., :
- : — not eligible (chain fails at link 2).
- : ✓ — eligible.
- : ✓ — eligible.
- : ✓ — eligible.
Drill 4 (negative — applicability contrast). Let (domain ) and . Can composition expansion be applied at ?
Reveal
, so .
The domain chain fails at the second link. is undefined — the expansion move is invalid because the condition is not satisfied.
Drill 5. Let (domain ) and (domain ). Verify the domain chain, then evaluate .
Reveal
✓; , so ✓.
Drill 6 (near-miss — negative). Let (domain ) and . Attempt to evaluate . Does the domain chain hold?
Reveal
.
Since is undefined, .
The chain fails — the expansion move is invalid. This is a near-miss: looks like a clean input for , but maps it exactly to , the one value excluded from .
Drill 7. Let (domain ) and (domain ). Verify the domain chain, then evaluate .
Reveal
, so ✓.
Action label — identify the operation
Drill 8. What was done between these two steps? (Use .)
Reveal
Evaluated the inner function: .
(This is not the composition expansion step — that happened when was written as . This step computes the numerical value of .)
Drill 9. In the chain below, identify which step is the composition expansion step. (Use , .)
Reveal
Step 1: is the composition expansion.
Domain check: , and , so ✓. The expansion is valid.
Drill 10. What was done between these two steps, and what condition makes it valid?
Reveal
Applied composition expansion: rewrote as .
This is valid when and — both links of the domain chain must hold.
Solve a Problem
Apply what you’ve learned with Problem Solving.
Problem: Let (domain ) and (domain ). Evaluate .
Full solution
| Step | Expression | Move |
|---|---|---|
| 0 | — | |
| 1 | Inner output: | |
| 2 | First link: ✓ (automatic); second link: ✓ | |
| 3 | Domain chain satisfied — apply composition expansion | |
| 4 | Evaluate outer: |
Related Principles
| Principle | Key | Relationship |
|---|---|---|
| Composition Definition | functionComposition | Representational backbone — defines what means; composition expansion is the move that applies this definition at a specific input |
| Piecewise Branch Selection | piecewiseBranchSelection | Same domain-gate pattern: before evaluating, you must verify which branch (or domain link) the input satisfies |
| Inverse Cancellation | inverseCancel | Closest sibling — its input-recovery form also requires a domain-side check () and produces a clean numeric result |
FAQ
What is composition expansion?
Composition expansion is the move that rewrites as : evaluate the inner function at input , then feed that output into the outer function . It is valid only when the domain chain condition holds — and .
When is composition expansion valid?
At input : when is in the domain of , and the output is in the domain of . If either condition fails, the composed function is not defined at and the expansion cannot be applied.
What goes wrong if I skip the domain check?
You may apply to a value outside its domain — for example, computing or . The result is undefined. The expansion notation itself gives no warning, making the mistake easy to overlook in a longer chain.
How is composition expansion different from the composition definition?
The definition states the general rule as a symbolic identity. Composition expansion is the move applied at a specific numeric input — it is the act of substituting and checking the domain chain, not just restating the definition.
Does the order of and matter?
Yes — order matters critically. expands to : is applied first. expands to : is applied first. These produce different values in general, and reversing the order is the most common error with no built-in signal.
How This Fits in Unisium
In Unisium, composition expansion is one of a family of function moves — alongside inverse cancellation and piecewise branch selection — all gated on an applicability condition that must be verified before the move is valid. Repeated drill practice in the Unisium Study System trains the “condition-first, then expand” reflex: you learn to check whether lands in the domain of as automatically as you check whether a radical has a non-negative radicand. That reflex is what separates fluent function work from error-prone pattern-matching.
Explore further:
- Functions Subdomain Map — Return to the functions hub to see how composition work feeds inverse moves and later calculus prerequisites
- Derivative Chain Rule — This calculus successor reuses the same inner/outer structure, but differentiates it instead of evaluating it
- Principle Structures — See where composition expansion sits in the functions principle hierarchy
- Elaborative Encoding — Build deep understanding of why the domain chain has two links
- Retrieval Practice — Make the condition and pattern instantly accessible
Ready to master composition expansion? Start practicing with Unisium or explore the full learning framework in Masterful Learning.
Masterful Learning
The study system for physics, math, & programming that works: retrieval, connection, explanation, problem solving, and more.
Ready to apply this strategy?
Join Unisium and start implementing these evidence-based learning techniques.
Start Learning with Unisium Read More GuidesWant the complete framework? This guide is from Masterful Learning.
Learn about the book →