What happens when the output of one function becomes the input of another? If a car travels at 60 mph and fuel efficiency drops with speed, how do you find fuel consumption as a function of time? You need to chain these relationships together—that's composition.
Composition is everywhere: temperature depends on altitude, altitude depends on location, so temperature depends on location. Understanding composition is essential because the chain rule—one of the most important differentiation techniques—is entirely about derivatives of composed functions.
The notation $(f \circ g)(x)$ means "apply $g$ first, then apply $f$ to the result." Think of it as a pipeline where data flows through $g$, then through $f$.
| Property | Value |
|---|---|
| Course | MATH 161 |
| Chapter | 1.3 |
| Difficulty | Intermediate |
| Time | ~20 minutes |
If $f$ and $g$ are functions, the composition of $f$ and $g$ is:
$$(f \circ g)(x) = f(g(x))$$
Read as: "$f$ composed with $g$" or "$f$ of $g$ of $x$"
The pipeline:
x → [ g ] → g(x) → [ f ] → f(g(x))
(inner) (outer)
$$f \circ g \neq g \circ f \text{ in general}$$
Example: Let $f(x) = x^2$ and $g(x) = x + 1$.
These are different functions! $(f \circ g)(2) = 9$ but $(g \circ f)(2) = 5$.
The domain of $f \circ g$ requires TWO conditions:
Formula: $$\text{dom}(f \circ g) = \{x \in \text{dom}(g) : g(x) \in \text{dom}(f)\}$$
Example: If $f(x) = \sqrt{x}$ and $g(x) = 1 - x^2$, find the domain of $f \circ g$.
Domain: $[-1, 1]$
Given a complicated function, identify the "inner" and "outer" parts:
| Composite | Outer $f$ | Inner $g$ |
|---|---|---|
| $\sqrt{x^2 + 1}$ | $\sqrt{u}$ | $x^2 + 1$ |
| $(3x - 5)^7$ | $u^7$ | $3x - 5$ |
| $\sin(x^2)$ | $\sin u$ | $x^2$ |
| $\sin^2 x$ | $u^2$ | $\sin x$ |
Strategy: Ask "What's the last operation performed?" That's the outer function.
COMPOSITION: (f ∘ g)(x) = f(g(x))
INPUT OUTPUT
│ │
▼ │
┌───┐ │
│ g │ ← INNER │
└─┬─┘ (applied first) │
│ │
▼ │
┌───┐ │
│ f │ ← OUTER │
└─┬─┘ (applied second)│
│ │
▼ │
RESULT ◄─────────────────┘
You can compose more than two functions:
$$(f \circ g \circ h)(x) = f(g(h(x)))$$
Apply from right to left: first $h$, then $g$, then $f$.
Example: If $h(x) = x + 1$, $g(x) = x^2$, $f(x) = 3x$, then: $$(f \circ g \circ h)(x) = 3(x+1)^2$$
Composition explains why horizontal transformations work "backwards":
$$y = f(x - 3) = (f \circ g)(x) \text{ where } g(x) = x - 3$$
To get $f(0)$, you need to input $x = 3$ into $g$. That's why "$-3$ inside" means "shift right."
If $f(x) = x^2$ and $g(x) = x + 3$, find $(f \circ g)(2)$.
Let $f(x) = \frac{1}{x}$ and $g(x) = x^2 - 4$. Find formulas for:
Let $f(x) = \sqrt{x}$ and $g(x) = 4 - x^2$. Find the domain of $(f \circ g)(x)$.
Express $H(x) = \sqrt[3]{\frac{x}{x+1}}$ as a composition $H = f \circ g$ where neither $f$ nor $g$ is the identity function.
Then find two different valid decompositions.
Let $f(x) = \frac{1}{1-x}$.
The Factory Pipeline: Think of composition as a factory with multiple stations. Raw material (input $x$) enters the first machine ($g$), which produces an intermediate product ($g(x)$). This intermediate product then enters the second machine ($f$), which produces the final output ($f(g(x))$).
The order matters: if you switch which machine comes first, you get a different product. And the pipeline only works if the intermediate product is compatible with the second machine (domain restrictions).
When you later learn the chain rule, you'll see it as calculating how fast the final product changes based on how fast each machine transforms its input.
Looking back:
Looking ahead:
| Previous | Up | Next |
|---|---|---|
| Function Arithmetic | Section 1.3 | The Tangent Line Problem |
Last updated: 2026-01-22