Composition of Functions
AP Precalculus · Exponential Functions and Sequences
Output of one, input of the other
The composition $(f\circ g)(x)=f(g(x))$ feeds the output of $g$ into $f$. Order matters: $f\circ g$ and $g\circ f$ are usually different functions, and the AP exam tests this with tables, graphs, and formulas alike.
Reading a table: to find $f(g(2))$, first look up $g(2)$, then use that value as the input row for $f$. Two lookups, strictly inside-out.
Decomposition reverses the process: given $h(x)=(2x-5)^3+4(2x-5)$, spot the repeated block $2x-5$, call it $g(x)$, and what remains is $f(x)=x^3+4x$. Decomposition is a modeling skill: it isolates the "inner process" (unit conversion, elapsed time) from the "outer process" (cost, area).
In context, a composition only makes sense when units match at the joint: the output units of the inner function must be the input units of the outer one. That single sentence is worth a point on free-response interpretation questions.
Worked example: both orders of composition and the domain
Let $f(x)=x^2+1$ and $g(x)=\sqrt{x-3}$. Find $(f\circ g)(x)$ and $(g\circ f)(x)$ together with the domain of each function.
Solution
$(f\circ g)(x)=f\left(\sqrt{x-3}\right)=\left(\sqrt{x-3}\right)^2+1=x-2$. But the domain is not all of $\mathbb{R}$: the input must get through $g$ first, so we need $x\ge3$. Result: $x-2$ on $[3,\infty)$. The formula gets simpler, but the domain does not expand.
$(g\circ f)(x)=\sqrt{x^2+1-3}=\sqrt{x^2-2}$, which needs $x^2\ge2$, that is, $x\le-\sqrt2$ or $x\ge\sqrt2$.
The two orders give two completely different functions, in both formula and domain. The domain of $f\circ g$ is always: those $x$ in the domain of $g$ for which $g(x)$ falls in the domain of $f$; examining the domain only after simplifying the formula is too late.