Builds new functions from old ones. Covers the pointwise arithmetic of sum, difference, product and quotient briefly, then spends the lesson on composition: evaluating it, why it is not commutative, decomposing a complicated rule into inner and outer parts, and the domain question — where the inner function's restriction survives even after the algebra hides it.
Subject: Precalculus · 65 slides · symbolic lesson
Open the interactive version of this deck
Title
Precalculus · Chapter 1 — Functions
§1.4 Composition of Functions, pp. 84-100
Objectives
Five things, each one you can check yourself on paper.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 84-100 — the pages these objectives are drawn from
Warm-up
You have composed operations since primary school without calling it that.
Discussion prompt
Take the number 5. Double it and then add 3. Now start again: add 3 and then double. Do you get the same answer, and what does that tell you?
Hint: Compute both, then say which operation the second one applied to a bigger number.
Answer:
Doubling first gives 10, then 13. Adding first gives 8, then 16. They differ, and by quite a lot.
The reason is that in the second order, the doubling acts on the 3 as well, so the 3 gets doubled too. Which operation happens first decides what the second one is acting on.
That is composition, and the fact that the two orders disagree is the central fact of this lesson. Almost every mistake in the section is an order-of-operations mistake wearing new notation.
Concept
The composition of f with g sends an input first through g and then through f. The output of the inner function becomes the input of the outer one.
composite function — The function that applies g and then f, written f composed with g, or f of g of x. Its value at x is obtained by evaluating g at x first and then evaluating f at that result.
\[ (f \circ g)(x) = f\bigl(g(x)\bigr) \]
Read the notation inside out. The function written closest to the x acts first, even though it is written second in the circle notation and appears on the right. Getting comfortable with that inversion is most of the skill here.
Figure (svg): Two function machines wired in series: an input x enters the first machine labelled g, its output g of x travels along a wire into the second machine labelled f, and the final output f of g of x leaves on the right
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 84-86
Section
Section 1
Concept
Two functions can be combined by doing arithmetic on their outputs at each input. The result is a new function, defined wherever both originals are.
\[ (f+g)(x) = f(x)+g(x), \qquad \Bigl(\tfrac{f}{g}\Bigr)(x) = \frac{f(x)}{g(x)} \]
It is worth being explicit that this section is the easy one. Sums and products of functions inherit their behaviour from ordinary arithmetic, and the only new thing is the domain intersection. Composition, which starts in the next section, does not work like this at all.
Figure (svg): Two function machines wired in series: an input x enters the first machine labelled g, its output g of x travels along a wire into the second machine labelled f, and the final output f of g of x leaves on the right
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 84-87
Picture it
Adding two functions puts them side by side. Composing them puts them in series, and that is a different picture.
Figure (svg): Two function machines wired in series: an input x enters the first machine labelled g, its output g of x travels along a wire into the second machine labelled f, and the final output f of g of x leaves on the right
In the wiring diagram nothing is added anywhere. The whole content is that one machine's output becomes the other's input, which is why the order matters here and not in a sum.
Worked example
The domain needs both originals and one extra condition.
\[ \text{With } f(x)=x^2-1 \text{ and } g(x)=x-1, \text{ find } \tfrac{f}{g} \text{ and its domain.} \]
Write the quotient
Why: One rule over the other.
\[ \frac{x ^{2} - 1}{x - 1} \]
Find where the bottom vanishes
Why: This input must be removed.
\[ x = 1 \]
State the domain before simplifying
Why: Both originals accept every real, so only 1 is lost.
\[ \text{all reals except } 1 \]
Now simplify if useful
Why: The numerator factors and one factor cancels.
\[ = x + 1,\text{ for } x \ne 1 \]
Figure (svg): The solution to Worked example a quotient of functions shown as a ladder of expressions, one row per legal move
\[ \Bigl(\tfrac{f}{g}\Bigr)(x) = x+1, \qquad x \ne 1 \]
Verify: check the simplification did not enlarge the domain
Why: The simplified rule x plus 1 is defined at 1, but the quotient was not, so 1 stays excluded. This is exactly the trap from §1.2, and it reappears here because a quotient of functions is where it most often arises. The graph is the line with a hole punched at the point where x is 1.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 86-87
Sorting
Each question is about the domain of a combination.
Sort into buckets
Sort each by which set operation applies.
Worked example
When both functions restrict, the domains intersect.
\[ \text{With } f(x)=\sqrt{x} \text{ and } g(x)=\sqrt{4-x}, \text{ find the domain of } f+g. \]
Find the first domain
Why: The radicand must be nonnegative.
\[ x \ge 0 \]
Find the second
Why: Four minus x must be nonnegative.
\[ x \le 4 \]
Intersect them
Why: An input must be legal for both.
\[ 0 \le x \le 4 \]
Write it as an interval
Why: Both endpoints are allowed.
\[ [0, 4] \]
Figure (svg): The solution to Worked example a sum with restricted domains shown as a ladder of expressions, one row per legal move
\[ \text{domain}(f+g) = [0,4] \]
Verify: test an input outside the intersection
Why: The input 5 is fine for the first rule but makes the second radicand negative, so the sum is undefined there — one failure is enough. Intersecting rather than unioning is the point: a sum needs both pieces to exist, so the domains must both hold at once.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 87-88
Trap
\[ \text{domain}(f+g) = [0,\infty) \cup (-\infty,4] = (-\infty,\infty) \]
Combine the two domains with a union
Why: Both functions contribute a domain, so all of it is collected together.
The conclusion is that the sum is defined for every real number.
A sum needs both pieces to exist at the same input, so the domains intersect rather than unite. The answer is the interval from 0 to 4.
Test it: at the input 5, the first square root is fine but the second asks for the root of negative 1, and the sum of a number and something undefined is undefined.
Intersect for every arithmetic combination. A union would be right if you were asking where at least one of them is defined, which is not a question that arises.
Prediction
Both f and g have every real number as their domain, and g has three zeros.
Predict first
What is the domain of f divided by g?
Correct: All reals except the three zeros of g.
Why: The intersection of the two domains is everything, so the only restriction comes from the quotient itself: the bottom function may not be zero. The zeros of f are irrelevant to the domain — they make the quotient equal to zero, which is a perfectly good output.
Faded example
The domain of the quotient of the square root of x by the quantity x minus 9.
Fill in the blanks
x \ge 0 \;\text9\; x \ne ___ \;\Longrightarrow\; [0,9) \cup (9,\infty)
Why: The square root needs a nonnegative input, giving x at or above 0, and the denominator forbids 9. Combining gives the ray from 0 with the single point 9 punched out, which splits it into two intervals. Note that 9 is inside the ray, so it genuinely has to be removed; had the forbidden input been negative it would already have been excluded.
Socratic
Sums and products of functions take a page; composition takes the rest of the lesson.
Discussion prompt
Explain what makes composition harder than pointwise arithmetic.
Hint: In which one does the output of a rule become the input of another?
Answer:
In a sum, the two functions never interact. Each is evaluated at the same input independently and the results are added, so all the properties of addition carry straight over — including commutativity.
In a composition, one function's output becomes the other's input. That creates a dependency: the outer function sees only what the inner one produced, and it may not accept all of it.
Two consequences follow immediately, and they are the rest of the lesson. The order matters, because swapping changes which rule sees the raw input. And the domain is a two-stage question, because an input must survive the inner rule and its output must then be acceptable to the outer one.
Section
Section 2
Concept
To evaluate a composition at a number, evaluate the inner function first and feed its output into the outer one. Never substitute into both at once.
The table and graph versions are worth practising specifically, because they force the two-stage process into the open. With formulas it is possible to substitute mechanically and get the right answer without ever thinking about which function acted first.
Figure (svg): Two function machines wired in series: an input x enters the first machine labelled g, its output g of x travels along a wire into the second machine labelled f, and the final output f of g of x leaves on the right
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 88-92
Picture it
The picture makes the order unambiguous in a way the notation does not.
Figure (svg): Two function machines wired in series: an input x enters the first machine labelled g, its output g of x travels along a wire into the second machine labelled f, and the final output f of g of x leaves on the right
If you are ever unsure which function acts first, draw the two boxes. The one the input arrow reaches first is the inner one.
Worked example
Two evaluations, in the right order.
\[ \text{With } f(x)=x^2+1 \text{ and } g(x)=2x-3, \text{ find } (f \circ g)(4). \]
Identify the inner function
Why: It is g, written closest to the 4.
Evaluate it
Why: Twice four minus three.
\[ g(4) = 5 \]
Feed that output into the outer function
Why: The input to f is 5, not 4.
\[ f(5) \]
Evaluate
Why: Twenty five plus one.
\[ = 26 \]
Figure (svg): The solution to Worked example evaluate at a number shown as a ladder of expressions, one row per legal move
\[ (f \circ g)(4) = f(5) = 26 \]
Verify: check the other order to see the difference
Why: Going the other way, f at 4 is 17 and then g at 17 is 31. So the two orders give 26 and 31 — different, as expected. Doing this comparison once per problem is a cheap way to confirm you composed in the direction that was asked for.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 89-90
Prediction
Consider the expression giving g of h of x.
Predict first
Which function acts on the raw input x?
Correct: h, because it is written closest to x.
Why: Nested notation is evaluated from the innermost parentheses outward, exactly as in arithmetic. The function adjacent to the input acts on it, and its output is then handed outward. This is a fact about notation and never depends on what the rules happen to be.
Worked example
Substitute the whole inner rule into the outer rule's input slot.
\[ \text{With the same } f \text{ and } g, \text{ find } (f \circ g)(x). \]
Write the outer rule with a hole
Why: Every x in f becomes the slot.
\[ f() = () ^{2} + 1 \]
Drop the entire inner rule into the slot
Why: In brackets, as always.
\[ (2 x - 3) ^{2} + 1 \]
Expand the square
Why: The square of a binomial keeps its middle term.
\[ 4 x ^{2} - 12 x + 9 + 1 \]
Collect
Why: Combine the constants.
\[ 4 x ^{2} - 12 x + 10 \]
Figure (svg): The solution to Worked example find the formula shown as a ladder of expressions, one row per legal move
\[ (f \circ g)(x) = 4x^2-12x+10 \]
Verify: test against the numerical answer
Why: Putting x equal to 4 gives 64 minus 48 plus 10, which is 26 — matching the previous example exactly. Checking a formula against a number you have already computed catches expansion errors immediately, and costs one substitution.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 90-91
Error analysis
A student is asked for f of g of 4 and computes as follows.
Annotate
On: \( f(4)=17, \;\text{ then }\; g(17)=31 \;\Longrightarrow\; (f \circ g)(4)=31 \)
Read composition notation inside out. The function written leftmost acts last, which is the opposite of how the expression is read aloud, and it is why this error is so easy to make.
Matching
Four expressions built from the same two functions.
Match the pairs
Why: The first two are the two compositions and are generally different functions. The third is a product, where neither function ever sees the other's output. The fourth composes a function with itself, which is perfectly legal and is how iteration works — the same idea behind compound interest in Chapter 4.
Faded example
Using a table where g at 2 is 7, and f at 7 is 1, and f at 2 is 5.
Fill in the blanks
(f \circ g)(2) = f(g(2)) = f(7) = 1
Why: The inner lookup gives 7, and that 7 becomes the input for the second lookup, giving 1. The value 5 in the table is f at 2, which is a distractor: it is what you would use if f acted first. Table problems make the two-stage lookup unavoidable, which is why they are worth practising.
Step zero
You are given two graphs and asked for the value of one composed with the other at a particular input.
Discussion prompt
Describe the first two things you do, in order, and which graph each one uses.
Hint: Which graph does the raw input go to?
Answer:
First, go to the inner function's graph — the one written closest to the input — and read the height above that input. That height is the inner output.
Second, take that height and use it as an input on the outer function's graph. Read the height above it. That is the answer.
The step people skip is the handover: the number read off the first graph is a height, and it has to be carried to the second graph's horizontal axis. Moving a number from one axis to the other is the whole difficulty, and drawing the two arrows makes it hard to get wrong.
Section
Section 3
Concept
For most pairs of functions, composing in the two orders gives two different functions. Equality of the two orders is a special property, not the norm.
It is worth stating what the exceptions are, because a student who only ever sees the inequality can be surprised later. Composing a function with its inverse returns the input unchanged in both orders, and that is precisely why inverses are worth defining.
Figure (svg): The same two rules composed in both orders, producing two different results, shown as two parallel chains of boxes with the inputs and outputs written at each stage
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 92-94
Picture it
One input, two orders, two answers.
Figure (svg): The same two rules composed in both orders, producing two different results, shown as two parallel chains of boxes with the inputs and outputs written at each stage
The gap between 25 and 7 is not a rounding difference or an edge case. These are two different functions that happen to be built from the same two parts.
Worked example
One well-chosen input settles it.
\[ \text{Show that } f \circ g \ne g \circ f \text{ for } f(x)=x^2, \; g(x)=x+3. \]
Pick a convenient input
Why: Any input where the two disagree will do.
\[ \text{take } x = 2 \]
Compose one way
Why: Add first, then square.
\[ f(g(2)) = f(5) = 25 \]
Compose the other way
Why: Square first, then add.
\[ g(f(2)) = g(4) = 7 \]
Compare
Why: The two results differ at this input.
\[ 25 \ne 7 \]
Figure (svg): The solution to Worked example show two orders differ shown as a ladder of expressions, one row per legal move
\[ (f \circ g)(2)=25 \ne 7=(g \circ f)(2) \]
Verify: confirm with the formulas
Why: One order gives x plus 3, all squared, which expands to x squared plus 6x plus 9. The other gives x squared plus 3. They differ by 6x plus 6, which is zero only at x equal to negative 1 — so the two functions agree at exactly one input and differ everywhere else. One input was enough, but the formulas show how thoroughly they differ.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 92-93
Counterexample
A classmate claims that composing the squaring rule with any linear rule commutes.
Discussion prompt
Find a linear rule for which it fails, and then one for which it works.
Hint: Try one that shifts, and then one that only scales.
Answer:
It fails for adding 3, as this section showed: the two orders give x squared plus 6x plus 9 and x squared plus 3.
It works for multiplying by 1, trivially, and it very nearly works for multiplying by any constant: doubling then squaring gives four x squared, while squaring then doubling gives two x squared. Those differ too — so in fact only the identity works among scalings.
The lesson is that the claim is essentially always false, and the few exceptions are exceptions for a reason rather than by accident. Composing a function with its own inverse, or with the identity, are the cases that genuinely commute.
Worked example
The exception, and the reason it is an exception.
\[ \text{Show that } f(x)=2x \text{ and } g(x)=\tfrac{x}{2} \text{ commute.} \]
Compose one way
Why: Halve, then double.
\[ f(g(x)) = 2(\frac{x}{2}) = x \]
Compose the other way
Why: Double, then halve.
\[ g(f(x)) = \frac{2 x}{2} = x \]
Compare the two results
Why: Both are the identity rule.
Say why
Why: Each rule undoes the other.
Figure (svg): The solution to Worked example a pair that does commute shown as a ladder of expressions, one row per legal move
\[ (f\circ g)(x)=x=(g\circ f)(x) \]
Verify: check this is not the general situation
Why: Doubling and adding 3 do not commute, as the previous example showed, and they are built from equally simple operations. What is special here is not simplicity but that each rule undoes the other exactly. Section 1.7 turns this observation into the definition of an inverse function, and the two-sided condition seen here is exactly what that definition requires.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 94-94
Trap
\[ (f \circ g)(x) \overset{?}{=} (g \circ f)(x) \quad \text{'because order does not matter'} \]
Reason by analogy with multiplication
Why: Multiplying two numbers gives the same answer either way, so composing two functions should too.
The two orders are treated as interchangeable and whichever is easier to compute is used.
The analogy fails. Multiplication combines two numbers symmetrically; composition feeds one rule's output into the other, which is an inherently ordered thing to do.
Squaring then adding 3 gives x squared plus 3. Adding 3 then squaring gives x squared plus 6x plus 9. These differ by 6x plus 6, which is far from nothing.
Treat the order as part of the problem statement, not a detail. When a question asks for one composition, computing the other is not a near miss — it is a different function.
Sorting
Compose each pair both ways and compare.
Sort into buckets
Sort each pair.
Prediction
Two functions compose to give the identity rule in both orders.
Predict first
What is the relationship between them?
Correct: Each is the inverse of the other.
Why: Composing to the identity in both orders is exactly the definition of inverse functions, which Section 1.7 states formally. Being the same function would not do it — squaring composed with squaring gives the fourth power, not the identity — and the pair need not be linear, as cubing and the cube root show.
Explain it to yourself
Addition of functions commutes and composition does not.
Discussion prompt
Explain what structural difference between the two operations accounts for this.
Hint: In which one does either function ever see the other's output?
Answer:
In a sum, both functions receive the same raw input and neither is affected by the other. Swapping them swaps two numbers that are then added, and addition of numbers commutes, so the result is unchanged.
In a composition, one function receives the raw input and the other receives only what the first produced. Swapping changes what each function is looking at, so there is no reason at all for the results to match.
Put another way: a sum treats the two functions symmetrically and a composition does not. The asymmetry is built into the operation, which is why commutativity is the surprising case rather than the expected one.
Section
Section 4
Concept
An input belongs to the domain of a composition when the inner function accepts it and the inner function's output is then acceptable to the outer function. Both conditions must hold.
This is the hardest idea in Chapter 1, and it is worth saying plainly why. Algebra is normally trusted to preserve meaning, and here it does not preserve the domain. The simplified expression is a different function from the composition, agreeing with it only where the composition is defined.
Figure (svg): A diagram showing the two conditions an input must satisfy to be in the domain of a composition: it must be legal for the inner function, and the inner function's output must be legal for the outer one
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 94-98
Picture it
The composition of the squaring rule with the square root simplifies to x, and yet it is not the line.
Figure (svg): A graph showing the composition of the squaring rule with the square root, whose simplified formula is x but whose graph exists only for nonnegative inputs, drawn as a ray starting at the origin rather than a full line
The dashed line on the left is what the algebra suggests. The solid ray on the right is the actual composition, which cannot accept a negative input because the square root inside would never have run.
Worked example
The formula simplifies away the square root; the domain does not forget it.
\[ \text{Find the domain of } (f \circ g)(x) \text{ with } f(x)=x^2 \text{ and } g(x)=\sqrt{x}. \]
Apply condition one
Why: The inner function is the square root.
\[ x \ge 0 \]
Apply condition two
Why: The outer rule squares, and accepts every real.
Combine
Why: Only the first condition bites.
\[ x \ge 0 \]
Note what the formula would have said
Why: The composition simplifies to x, whose domain is everything.
Figure (svg): A graph showing the composition of the squaring rule with the square root, whose simplified formula is x but whose graph exists only for nonnegative inputs, drawn as a ray starting at the origin rather than a full line
\[ \text{domain}(f \circ g) = [0,\infty) \]
Verify: test a negative input
Why: Try negative 4. The inner rule asks for the square root of negative 4, which is not real, so the chain stops before the squaring ever happens. The simplified formula would happily return negative 4, which is precisely why it is a different function.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 95-96
Discrimination
Every restriction on a composition comes from one of the two conditions.
Sort into buckets
Sort each restriction by which condition produced it.
Worked example
Here the outer function contributes a restriction as well.
\[ \text{Find the domain of } f(g(x)) \text{ with } f(x)=\tfrac{1}{x-2} \text{ and } g(x)=\sqrt{x}. \]
Condition one, from the inner rule
Why: The square root needs a nonnegative input.
\[ x \ge 0 \]
Condition two, from the outer rule
Why: Its denominator forbids an input of 2.
\[ g(x) \ne 2 \]
Translate condition two back into x
Why: The square root equals 2 when x is 4.
\[ x \ne 4 \]
Combine both
Why: Nonnegative, with 4 removed.
\[ [0, 4] U(4, \infty) \]
Figure (svg): The solution to Worked example both conditions bite shown as a ladder of expressions, one row per legal move
\[ [0,4) \cup (4,\infty) \]
Verify: check the excluded input directly
Why: At x equal to 4 the inner rule gives 2, and the outer rule then asks for one over zero. So 4 genuinely breaks the chain even though it is a perfectly legal input for the inner function on its own. Condition two is a statement about the inner function's OUTPUT, and translating it back into a statement about x is the step most often skipped.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 97-98
Error analysis
A student composes and then simplifies before finding the domain.
Annotate
On: \( f(x)=x^2, \; g(x)=\sqrt{x} \;\Longrightarrow\; (f\circ g)(x)=x \;\Longrightarrow\; \text{domain} = (-\infty,\infty) \)
This is the §1.2 cancellation trap in its most disguised form. Find the domain from the composition as built, and simplify afterwards if it helps.
Prediction
The inner function is a polynomial and the outer function is a square root.
Predict first
Where does the restriction come from?
Correct: From condition two only, since the polynomial accepts everything.
Why: A polynomial has every real number in its domain, so condition one imposes nothing. Condition two requires the polynomial's output to be nonnegative, which is an inequality in x and generally restricts the domain considerably. This is the mirror image of the worked example, where the restriction came entirely from the inner rule.
Faded example
Find the domain of the square root of the quantity x squared minus 9.
Fill in the blanks
x^2 - 9 \ge 0 \;\Longrightarrow\; x \le -3 \;\text3\; x \ge ___
Why: The inner polynomial accepts everything, so only condition two matters: its output must be nonnegative. A quadratic is at or above zero outside its roots, giving two rays rather than an interval. Solving this by taking a square root of both sides and writing x at or above 3 alone loses the entire left-hand ray, which is the standard error here.
Missing information
You are told that the composition of f with g simplifies to the rule that returns x.
Discussion prompt
Can you conclude that the domain of the composition is every real number? What else would you need to know?
Hint: Which of the two functions might have refused an input before the simplification happened?
Answer:
No. The simplified formula tells you what the composition computes where it is defined, and says nothing at all about where that is.
You would need the domain of the inner function, and the domain of the outer function to check the second condition. Only with those can the composition's domain be assembled.
The concrete case in this lesson makes the point: squaring the square root simplifies to x, and yet its domain is only the nonnegative reals. The simplified formula was never the whole story, and this is the one place in the chapter where trusting the algebra gives the wrong answer.
Section
Section 5
Concept
Given a complicated rule, find simpler rules whose composition it is. There is more than one right answer, and the useful ones split the work at a natural seam.
Decomposition looks like a puzzle exercise and is in fact the single most useful skill in this lesson, because the chain rule in calculus is entirely an instruction about how to differentiate a composition. Recognising a function as a composition is the prerequisite for that.
Figure (svg): A single complicated expression broken into an inner and an outer part, shown by drawing a box around the inner expression and naming what remains as the outer rule
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 98-100
Picture it
The dashed box marks what happens first, and everything outside it is what happens next.
Figure (svg): A single complicated expression broken into an inner and an outer part, shown by drawing a box around the inner expression and naming what remains as the outer rule
Drawing the box is a reliable method. Whatever sits inside a radical, inside a bracket being raised to a power, or in a denominator, is almost always the inner function.
Worked example
The radical sign marks the seam.
\[ \text{Write } h(x)=\sqrt{3x-5} \text{ as a composition.} \]
Ask what you would compute first
Why: With a calculator you would work out three x minus five.
\[ \text{compute } 3 x - 5 \]
Name that the inner function
Why: It becomes g.
\[ g(x) = 3 x - 5 \]
Ask what happens to that result
Why: You take its square root.
Name that the outer function
Why: It becomes f.
\[ f(u) = \sqrt{u} \]
Figure (svg): A single complicated expression broken into an inner and an outer part, shown by drawing a box around the inner expression and naming what remains as the outer rule
\[ g(x)=3x-5, \quad f(u)=\sqrt{u}, \quad h = f \circ g \]
Verify: compose them back
Why: Feeding g into f gives the square root of the quantity 3x minus 5, which is the original rule exactly. Always run this check: it takes one line and catches a decomposition assembled in the wrong order, which is the usual failure.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 99-99
Matching
Ask what you would compute first in each case.
Match the pairs
Why: Three of the four share an inner function and differ only in what is done afterwards. The third is the odd one out: there the root acts on the bare x, so it goes first and the linear work happens outside. Reading which operation the x is inside is the whole technique.
Worked example
Several answers are correct, and one is more useful than the others.
\[ \text{Decompose } h(x)=\frac{1}{(x+2)^3}. \]
Find the innermost computation
Why: You would add 2 to x first.
\[ g(x) = x + 2 \]
Describe everything that follows
Why: Cube it, then take the reciprocal.
\[ f(u) = 1 / u ^{3} \]
Note an alternative split
Why: You could instead cube inside and take the reciprocal outside.
\[ g = (x + 2) ^{3}, f = \frac{1}{u} \]
Choose the one that helps
Why: Both are correct; the first isolates the simplest inner rule.
Figure (svg): The solution to Worked example a decomposition with a choice shown as a ladder of expressions, one row per legal move
\[ g(x)=x+2, \quad f(u)=\frac{1}{u^3} \]
Verify: confirm both splits compose correctly
Why: The first gives one over the quantity x plus 2, all cubed. The second cubes x plus 2 and then takes the reciprocal, which is the same thing. Both are right, and a question asking to decompose will normally accept any correct answer unless it specifies the form of one of the pieces.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 100-100
Trap
\[ h(x)=\sqrt{3x-5} \;\Longrightarrow\; f(x)=3x-5, \; g(u)=\sqrt{u}, \; h = f \circ g \]
Identify the two pieces correctly
Why: The linear rule and the square root are both present and both correctly written.
They are then labelled so that the linear rule is the outer function and the root is the inner one.
The pieces are right and the labels are swapped. As written, f composed with g would take the square root first and then multiply by 3 and subtract 5, giving three root x minus five — a different function.
The inner function is the one that acts first, which here is the linear rule. So the linear rule should be called g and the root f.
Always compose your answer back together and compare. It costs one line and catches this immediately, which matters because the two pieces look correct in isolation and nothing else flags the error.
Prediction
You are asked to decompose a rule into an inner and an outer function.
Predict first
How many correct decompositions are there, in general?
Correct: Many, including a trivial one using the identity.
Why: Any rule can be decomposed trivially by taking the inner function to be the identity and the outer to be the whole rule, which is correct and useless. Between that and the natural split there are usually several genuine alternatives, as the reciprocal-of-a-cube example showed. Questions therefore ask for a decomposition, not the decomposition.
Reverse engineer
A composition gives the rule that squares the quantity x minus 4 and then adds 7.
Fill in the blanks
g(x) = x - 4, \qquad f(u) = u^2 + 7
Why: Subtracting 4 happens first, so it is the inner rule. Squaring and adding 7 both happen to that result, so together they form the outer rule. Composing back gives the square of the quantity x minus 4, plus 7, which matches. Note that the adding of 7 could not be part of the inner rule, since it happens after the squaring.
Real world
This skill looks like a puzzle and is in fact the entry requirement for the chain rule.
Discussion prompt
Why would a calculus student need to see a complicated function as a composition before differentiating it?
Hint: Is there a rule for differentiating a square root of something complicated directly?
Answer:
The derivative rules are stated for simple functions — powers, roots, sines. There is a rule for the square root of x, but none for the square root of an arbitrary expression.
The chain rule bridges the gap: it differentiates a composition by differentiating the outer function, evaluating it at the inner one, and multiplying by the inner function's derivative. But it can only be applied once the function has been recognised as a composition.
So decomposition is the step before the calculus, and a student who cannot spot the seam cannot start. That is why this section is worth more attention than its length suggests — the payoff is two chapters away but it is substantial.
Comparison
Fill the blanks from memory. Only the last row behaves differently from ordinary arithmetic.
Comparison matrix
| how it combines | domain | commutative | |
|---|---|---|---|
| sum f + g | add the outputs | intersection of the domains | yes |
| product f times g | multiply the outputs | intersection of the domains | yes |
| quotient f over g | divide the outputs | intersection, minus the zeros of g | no |
| composition f after g | feed g's output into f | two conditions, one of them hidden | no |
The first two rows inherit everything from arithmetic. The last row is the one that needs a whole lesson, because nothing about it is inherited.
Pattern
Five steps, and the last one is the one that is skipped.
Step 5's warning is worth more than the other four steps combined. The simplified formula is a different function, and its domain is usually larger.
OpenStax Algebra and Trigonometry 2e, §3.4 Composition of Functions §3.4
Check
Inside out.
Check your understanding
With f(x) = 3x and g(x) = x + 4, what is f of g of 2?
Answer: A
Why: The inner function g acts first, giving 2 plus 4, which is 6. Then f triples it, giving 18. Writing the two steps separately is what keeps the order straight.
Check
The formula is not the domain.
Check your understanding
With f(x) = x squared and g(x) = the square root of x, what is the domain of f composed with g?
Answer: A
Why: The inner square root refuses negative inputs, so the domain is the nonnegative reals, and the input 0 is allowed because the square root of 0 is 0. The composition simplifies to x, but that formula is a different function with a larger domain.
Check
Find the seam.
Check your understanding
Which decomposition of the rule giving one over the quantity x plus 5 is correct?
Answer: A
Why: Evaluating by hand you would add 5 first and then take the reciprocal, so the addition is the inner rule. Composing back gives one over the quantity x plus 5, matching the original.
Real world
Any process made of stages is a composition, and the domain question is a real engineering concern.
Discussion prompt
A shop applies a 20 percent discount and then adds 8 percent sales tax. Would the customer pay the same if the tax were applied first? Explain in the language of this lesson.
Hint: Are the two operations scalings, and do scalings commute?
Answer:
The customer pays the same either way, and this is one of the genuine exceptions. Both operations are multiplications — by 0.8 and by 1.08 — and multiplication of numbers is commutative, so the order does not matter.
The moment either stage stops being a pure multiplication, that changes. A flat five-pound discount followed by tax is not the same as tax followed by the flat discount, because the discount is now an addition and additions and multiplications do not commute.
This is exactly the warm-up. Doubling and adding 3 disagree for the same reason a percentage discount and a flat discount behave differently, and it is why the order of operations in pricing rules is specified in contracts rather than left to intuition.
Commit first
State your confidence along with your answer.
Predict first
The composition of f with g simplifies to the formula x. What is the domain of the composition?
Correct: It cannot be determined from this alone.
Why: The simplified formula says nothing about the domain. You would need the domain of the inner function and the domain of the outer one to assemble it. The squaring-of-a-square-root example simplifies to x with domain only the nonnegative reals, and doubling composed with halving simplifies to x with domain everything — two compositions with the same simplified formula and different domains.
Explain it
The test of understanding is being able to say why, not just what.
Discussion prompt
Explain to a classmate why the composition of the squaring rule with the square root is not the same function as the rule that returns x, even though the algebra says they are equal.
Hint: Ask what each one does with the input negative 4.
Answer:
At the input negative 4, the rule that returns x gives negative 4. The composition cannot even start: the square root of negative 4 is not a real number, so nothing is handed to the squaring rule.
Two functions are the same only when they have the same domain and agree on it. These agree wherever both are defined, but one is defined on more inputs than the other, so they are different functions.
A good explanation names what the algebra actually established: the two rules agree on the composition's domain. That is a true and useful statement, and it is weaker than saying they are equal — the gap between those two claims is the whole point of the section.
Exit ticket
One honest answer, so the next lesson can start in the right place.
Predict first
Which idea from this lesson would you most want to see again?
Correct: Any of these is a legitimate answer; the useful one is the honest one.
Why: There is no correct choice here. The third is the hardest idea in the chapter and the one most likely to need a second pass. The fourth is the one whose payoff is furthest away, in the chain rule, and is worth practising even when it feels like a puzzle rather than a technique.
Connect it up
One page, drawn from memory, is worth more than rereading the section.
Draw it
Draw the two-machine wiring diagram for a composition, labelling which machine runs first. Beside it, write the two conditions an input must satisfy to be in the domain, and mark which of the two survives simplification invisibly. Then pick any function with a square root in it, decompose it, and compose your pieces back together to check.
If your diagram makes clear that the machine written second in the notation runs first, you have the fact that prevents most of the errors in this section.
Recap
Five things, and the last one is what the chain rule will require of you.
| if you remember one thing | it should be this |
|---|---|
| about the notation | read it inside out: the rule nearest the x acts first |
| about the order | the two orders are two different functions |
| about the domain | the inner function's restriction survives simplification |
| about decomposing | whatever you would compute first is the inner function |
Section 1.5 takes the toolkit functions and moves, stretches and flips them — and its central rule, that changes inside affect the input and changes outside affect the output, is composition seen from another angle.
OpenStax, Precalculus, §1.4 Composition of Functions §1.4, pp. 84-100 — everything on these slides traces back here
Want this taught 1-on-1? Alexander tutors Precalculus — $55/session, free consultation.