Composition of Functions
Introduced| English | Meaning |
|---|---|
| composition/ˌkɒmpəˈzɪʃn/ | Combining functions by applying one function to the output of another. |
| composite function/ˈkɒmpəzɪt ˈfʌŋkʃn/ | A function formed by applying one function to the output of another. |
| domain/dəˈmeɪn/ | The set of input values for which a function is defined. |
| identity function/aɪˈdentɪti ˈfʌŋkʃn/ | The function f(x) = x, mapping every input to itself. |
| decompose/ˌdiːkəmˈpəʊz/ | decompose |
Halve first, or add first?
- Start with 10. Halving and then adding 4 gives 9; adding 4 and then halving gives 7. The same two operations can give different results in a different order.
- Composition 复合 connects the output of one function to the input of another. Label the inner and outer functions before calculating.
Read the inner function first
- The composite function 复合函数 $(f\circ g)(x)=f(g(x))$ applies $g$ first and $f$ second. The notation is read from the inside out, rather than left to right.
- Keep the intermediate value: $x\longrightarrow g(x)\longrightarrow f(g(x))$. It shows exactly what input the outer function receives.

In the composition $(f \circ g)(x) = f(g(x))$, which function acts first?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Work inside-out: $g$ acts on $x$ first, then $f$ acts on the result $g(x)$.
Evaluate both orders
- With $g(x)=x+1$ and $f(x)=x^2$, input 2 goes through $g$ to 3 and then through $f$ to 9. Thus $f(g(2))=9$.
- Reversing the order squares 2 to get 4 and then adds 1, giving $g(f(2))=5$. The formulas are $f(g(x))=(x+1)^2$ and $g(f(x))=x^2+1$.
Compare both function orders
Follow input 2 through g(x)=x+1 and f(x)=x², then compare root and reciprocal domain restrictions.
If $g(x) = x + 1$ and $f(x) = x^2$, what is $f(g(2))$?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Inner first: $g(2) = 3$. Then outer: $f(3) = 3^2 = 9$.
For $f(x)=x^2$ and $g(x)=x+1$, find $g(f(2))$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
f(2)=4, then g(4)=5. The other order gives 9.
Substitute into every input position
- If $f(u)=u^2-u$ and $g(x)=x+1$, substitute the whole expression $x+1$ wherever the input appears in $f$. Keep parentheses around it.
- This gives $f(g(x))=(x+1)^2-(x+1)=x^2+x$. Replacing only the squared input would give the wrong expression. Also distinguish composition from multiplication: for $f(x)=x^2$, $g(x)=x+1$, the product at 2 is 12, while the composition is 9.
$f(g(x))$ feeds one output into the next function. It is not $f(x)g(x)$. Identify the operation and the order before simplifying.
For $f(u)=u^2+u$ and $g(x)=2x$, find $f(g(1))$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
g(1)=2. Substitute into both input positions: f(2)=2²+2=6.
Check both stages of the domain
- The domain 定义域 of $f\circ g$ contains inputs for which both checks pass: $x$ is in the domain of $g$, and $g(x)$ is in the domain of $f$.
- For $g(x)=x-1$ and $f(u)=\sqrt u$, the inner function accepts every real input, but its output must be nonnegative. Therefore $f(g(x))=\sqrt{x-1}$ needs $x\ge1$. In the reverse order, $g(f(x))=\sqrt x-1$ needs $x\ge0$.
At input 0, $g(0)=-1$ exists but $f(-1)$ is not real. The forward composition is undefined. In reverse, $f(0)=0$ and $g(0)=-1$, so the reverse composition is defined and equals $-1$.
For $g(x)$ to be usable inside $f$, the value $g(x)$ must lie in the ____ of $f$.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Both checks are needed: x must be in the domain of g, and g(x) must be in the domain of f.
For $f(u)=\sqrt u$ and $g(x)=x-1$, what is the real domain of $f\circ g$?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
The inner function is defined for every real x, but its output x−1 must be nonnegative.
Retain restrictions after simplifying
- In a root-first example, $g(x)=\sqrt x$ and $f(u)=u+3$ give $f(g(x))=\sqrt x+3$, with $x\ge0$. The inner function supplies the restriction even though the outer one accepts all real inputs.
- If $f(u)=1/u$ and $g(x)=1/x$, the composite simplifies to $x$, but only for $x\ne0$. At zero the inner function is undefined, so cancellation does not make that input valid.
If $f(u)=1/u$ and $g(x)=1/x$, where is $f(g(x))=x$ valid?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
The original inner function cannot accept zero. Simplifying does not restore that input.
Use numerical and graphical information
- If a table or graph gives $g(2)=3$ and $f(3)=9$, then $(f\circ g)(2)=9$. On graphs, first read the output of $g$ at input 2, then use that output as the input to $f$; the corresponding composite point is $(2,9)$.
- If a third function has $h(9)=5$, then $(h\circ f\circ g)(2)=5$. Keep each intermediate output. Information about $f(3)$ does not supply $f(2)$, so reversing the chain may require values that were not given.
Given $g(2)=3$, $f(3)=9$ and $h(9)=5$, find $(h\circ f\circ g)(2)$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
The chain is 2 → 3 → 9 → 5.
Identity and occasional agreement
- The identity function 恒等函数 $I(x)=x$ leaves an input unchanged. Thus $I(g(x))=g(I(x))=g(x)$ on the domain of $g$; it acts as a neutral operation in composition.
- Composition is generally not commutative, but some functions do commute. Even two different composites may agree at one input: $(x+1)^2$ and $x^2+1$ both give 1 at zero. That single match does not make them the same function.
Composition is commutative: $f(g(x))$ always equals $g(f(x))$.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
For f(x)=x² and g(x)=x+1, the composites (x+1)² and x²+1 differ in general, although both give 1 at x=0. Some pairs do commute.
For $I(x)=x$ and $g(x)=2x+1$, find $I(g(3))$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
g(3)=7, and the identity function leaves 7 unchanged.
Decompose a function into simpler parts
- To decompose 分解 $H(x)=\sqrt{3x-2}$, choose inner $g(x)=3x-2$ and outer $f(u)=\sqrt u$. Substituting back gives $H=f\circ g$, with domain $x\ge2/3$.
- Decomposition need not be unique. For $H(x)=(2x+1)^3$, one choice is inner $2x+1$ and outer $u^3$. Another is inner $x+0.5$ and outer $8u^3$. Check the complete formula after substitution, rather than matching one sample value.
Select all true statements about composition.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Order usually does matter — composition is not commutative. The other three are correct.
Which inner and outer functions give $H(x)=\sqrt{3x-2}$ as $f(g(x))$?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Substitution gives √(3x−2), whose domain is x≥2/3. The other choices put operations in a different order.
Interpret transformations as compositions
- With $f(x)=x^2$ and $s(x)=x+3$, $f(s(x))=(x+3)^2$ is a horizontal shift left by 3; $s(f(x))=x^2+3$ is a vertical shift up by 3. An addition inside the input differs from one outside the output.
- With $d(x)=2x$, $f(d(x))=4x^2$ compresses the graph horizontally by factor $1/2$, while $d(f(x))=2x^2$ stretches it vertically by factor 2. The order determines which quantity is changed.
Evaluate inside-out, substitute into every input position and check both stages of the domain. A simplified expression must retain original restrictions. Identity functions and special pairs can commute, but swapping arbitrary functions usually changes the rule or its domain.
For $f(x)=x^2$ and $s(x)=x+3$, which pair is correct?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Adding inside shifts the graph left by 3; adding outside shifts it up by 3.
Explain a complete chain
- Let $g(x)=2x$ and $f(x)=x^2$. Find $f(g(3))$, showing the intermediate output, then find $g(f(3))$.
- Explain why the two results differ and why neither calculation is the product $f(3)g(3)$.
Let $g(x)=2x$ and $f(x)=x^2$. Find $f(g(3))$ and $g(f(3))$, showing each intermediate output. How do these differ from $f(3)g(3)$?
2 times 3 is 6, and 6 squared is 36.
With $g(x)=2x$ and $f(x)=x^2$, what is $f(g(3))$?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
g(3)=6, then f(6)=36. The value 9 is f(3); 18 is g(f(3)).