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.

x g g(x) f f(g(x)) output of g… …must match the input units of f Reading order of f(g(x)): from the INSIDE out — g runs first, f runs second.
A composite function is a two-machine assembly line. The input $x$ goes into machine $g$ first; only the product $g(x)$ is passed to machine $f$. The notation $f(g(x))$ is read from the inside out, the reverse of the written order, and that is the source of every mix-up between $f\circ g$ and $g\circ f$. The junction between the two machines is where free-response questions place interpretation prompts: the output units of $g$ must be exactly the input units of $f$, and if they do not match, the composition is meaningless.

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.

Common mistake

Simplifying $\left(\sqrt{x-3}\right)^2$ to $x-3$ and then declaring the domain to be $\mathbb{R}$, forgetting that the simplification is valid only where the root exists. A second trap of the same family: reading $f(g(2))$ from a table in outside-in order, that is, looking up $f(2)$ first; the result coincides with a distractor planted in advance.

Key takeaway

Composition = inside first, outside second; changing the order changes the function. Examine the domain of $f\circ g$ before simplifying. In context: the output units of the inner function must match the input units of the outer function.

← Exponential Manipulation and Models in Context · All AP Precalculus lessons · Practice AP Precalculus questions (free, instant scoring) · Inverse Functions →