Precalculus-I · Unit 4 · Video 2 · Interactive Practice

Composite Functions: Inside Out, and Why Order Matters

IKey Formulas

FormulaMeaning
(f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x))gg acts first (inner), ff acts on g(x)g(x) (outer)
(fg)(x)=f(x) g(x)(fg)(x) = f(x)\,g(x)a product: both act on xx; not a composition
f(g(x))≠g(f(x))f(g(x)) \neq g(f(x)) in generalcomposition is not commutative

Key Insight: in f∘gf \circ g the function written second acts first. With f(x)=x2f(x) = x^2 and g(x)=x+2g(x) = x + 2, f(g(x))=x2+4x+4f(g(x)) = x^2 + 4x + 4 but g(f(x))=x2+2g(f(x)) = x^2 + 2; they agree only at x=−12x = -\tfrac{1}{2}.

IISame Two Rules, Two Orders

"Add 2, then square" and "square, then add 2" are different functions that meet at a single input.

IIIWhich Discount Comes First?

A 20% discount D(p)=0.8pD(p) = 0.8p and a $10 coupon C(p)=p−10C(p) = p - 10 both take a price and give a price, so either order makes sense.

C(D(p))=0.8p−10C(D(p)) = 0.8p - 10 and D(C(p))=0.8p−8D(C(p)) = 0.8p - 8: at every price the coupon-first order costs $2 more, because the 20% discount then also shrinks the coupon.

IVQuiz Questions

Problem 1 · Inside First

Given: f(x)=x2+1f(x) = x^2 + 1 and g(x)=3xg(x) = 3x. Find f(g(2))f(g(2)).

✅ Correct! g(2)=6g(2) = 6 first, then f(6)=36+1=37f(6) = 36 + 1 = 37.
❌ That is the other order. 15=g(f(2))=g(5)15 = g(f(2)) = g(5); in f(g(2))f(g(2)) the inner function gg acts first.
❌ That is the product. f(2) g(2)=5⋅6=30f(2)\,g(2) = 5 \cdot 6 = 30; composition feeds g(2)g(2) into ff instead.
❌ Not quite. Evaluate the innermost part, g(2)g(2), then put that number into ff.
Show solution
g(2)=3(2)=6,f(g(2))=f(6)=62+1=37g(2) = 3(2) = 6, \qquad f(g(2)) = f(6) = 6^2 + 1 = 37

Problem 2 · Substitute the Whole Expression

Given: f(x)=x−5f(x) = x - 5 and g(x)=4−2xg(x) = 4 - 2x. Find and simplify g(f(x))g(f(x)).

✅ Correct! g(x−5)=4−2(x−5)=4−2x+10=−2x+14g(x - 5) = 4 - 2(x - 5) = 4 - 2x + 10 = -2x + 14.
❌ That is f(g(x))f(g(x)). (4−2x)−5=−2x−1(4 - 2x) - 5 = -2x - 1 puts gg inside ff; here f(x)f(x) goes inside gg.
❌ The 22 was not distributed. −2(x−5)-2(x - 5) is −2x+10-2x + 10, not −2x+5-2x + 5.
❌ That is the product. (x−5)(4−2x)(x - 5)(4 - 2x) multiplies the outputs; composition substitutes f(x)f(x) for xx in gg.
❌ Not quite. Replace xx in gg by the whole expression x−5x - 5, keeping the parentheses.
Show solution
g(f(x))=g(x−5)=4−2(x−5)=4−2x+10=−2x+14g(f(x)) = g(x - 5) = 4 - 2(x - 5) = 4 - 2x + 10 = -2x + 14

Check at x=5x = 5: f(5)=0f(5) = 0 and g(0)=4g(0) = 4; also −2(5)+14=4-2(5) + 14 = 4.

Problem 3 · Composition or Product?

Given: f(x)=x2f(x) = x^2 and g(x)=x−3g(x) = x - 3. Which expression equals x2−6x+9x^2 - 6x + 9?

✅ Correct! f(g(x))=(x−3)2=x2−6x+9f(g(x)) = (x - 3)^2 = x^2 - 6x + 9.
❌ The product has a cubic term. x2(x−3)=x3−3x2x^2(x - 3) = x^3 - 3x^2.
❌ Not quite. g(f(x))=x2−3g(f(x)) = x^2 - 3 and (f+g)(x)=x2+x−3(f + g)(x) = x^2 + x - 3. Which order squares the quantity x−3x - 3?
Show solution

f(g(x))=f(x−3)=(x−3)2=x2−6x+9f(g(x)) = f(x - 3) = (x - 3)^2 = x^2 - 6x + 9.

For comparison: g(f(x))=x2−3g(f(x)) = x^2 - 3, f(x) g(x)=x3−3x2f(x)\,g(x) = x^3 - 3x^2, (f+g)(x)=x2+x−3(f + g)(x) = x^2 + x - 3.

Problem 4 · Follow the Units

Given: P(t)P(t) is a town's population (people) in year tt, and W(n)W(n) is the weekly water use (liters) of a town of nn people. Which composition makes sense, and what does it give?

✅ Correct! Years go into PP, people come out and go into WW, and liters come out.
❌ The units do not fit. In P(W(n))P(W(n)) the liters from WW would be handed to PP, which takes a year.
❌ Right order, wrong output. The outer function WW gives liters, so W(P(t))W(P(t)) is an amount of water, not a number of people.
❌ Not quite. Check that each inner output is the kind of quantity the outer function takes.
Show solution

W(P(t))W(P(t)): year →\to people →\to liters. The inner output (people) is what WW takes, so it is the weekly water use of the town in year tt.

P(W(n))P(W(n)): people →\to liters →\to ? The function PP needs a year, not liters, so this order is meaningless.

Solved: 0 / 4