Composition of Functions
| English | Chinese | Pinyin |
|---|---|---|
| composition | 复合 | fù hé |
| composite function | 复合函数 | fù hé hán shù |
| domain | 定义域 | dìng yì yù |
Functions in a chain
- Feed a number into one function, then feed its answer into a second function.
- The two machines work in a row: output of the first becomes input of the second.
- This chaining is called composition, and it builds complex functions from simple ones.
- It is how a "convert then round" or "discount then tax" calculation really works.
The composite function
- The composite function 复合函数 is written $(f \circ g)(x) = f(g(x))$.
- Read it inside-out: apply $g$ first, then apply $f$ to the result.
- The composition 复合 hands the output of $g$ straight to $f$ as its input.
- So $g$ is the inner function and $f$ is the outer one.

Send an input through two functions in a row
Step through the pipeline — the output of g is handed straight to f.
In the composition $(f \circ g)(x) = f(g(x))$, which function acts first?
Work inside-out: $g$ acts on $x$ first, then $f$ acts on the result $g(x)$.
Evaluating a composition
- Always work from the inside out.
- To find $f(g(2))$, first compute $g(2)$, then feed that number into $f$.
- With $g(x)=x+1$ and $f(x)=x^2$: $g(2)=3$, then $f(3)=9$.
- You can also compose the formulas to get one rule for the whole chain.
If $g(x) = x + 1$ and $f(x) = x^2$, what is $f(g(2))$?
Inner first: $g(2) = 3$. Then outer: $f(3) = 3^2 = 9$.
The domain of a composition
- The composite is only defined where the chain actually works.
- The value $g(x)$ must be a legal input for $f$ — it must lie in $f$'s domain 定义域.
- If $g$ produces a number $f$ cannot accept, that $x$ is excluded.
- So the composite's domain can be smaller than $g$'s alone.
For $g(x)$ to be usable inside $f$, the value $g(x)$ must lie in the ____ of $f$.
The composite is defined only where $g(x)$ is a legal input to $f$ — inside $f$'s domain.
Select all true statements about composition.
Order usually does matter — composition is not commutative. The other three are correct.
Order matters
- Composition is generally not commutative: $f(g(x)) \neq g(f(x))$.
- "Put on socks, then shoes" is not the same as "shoes, then socks".
- With $f(x)=x^2$, $g(x)=x+1$: $f(g(x))=(x+1)^2$ but $g(f(x))=x^2+1$.
- Always respect which function is inner and which is outer.
Composition is commutative: $f(g(x))$ always equals $g(f(x))$.
Order matters. With $f(x)=x^2$ and $g(x)=x+1$: $f(g(x))=(x+1)^2$ but $g(f(x))=x^2+1$ — different.
Do not confuse $f(g(x))$ with $f(x)\cdot g(x)$. Composition feeds one function into another; it is not multiplication. And it rarely commutes, so swapping the order usually changes the answer.
Let $g(x) = \sqrt{x}$ and $f(x) = x + 3$. Find $(f \circ g)(x)$ and its domain.
- Inner first: $g(x) = \sqrt{x}$, then outer: $f(\sqrt{x}) = \sqrt{x} + 3$.
- The square root needs $x \ge 0$, so the domain is $x \ge 0$.
- Even though $f$ alone accepts all reals, the inner $g$ restricts the composite.
A composite function $(f \circ g)(x) = f(g(x))$ chains two functions: the inner $g$ acts first, then $f$. Evaluate inside-out, and remember its domain needs $g(x)$ to be a legal input for $f$. Composition is generally not commutative — order matters.