Lesson 1.6 · Unit 1 · F-BF.1c
Feeding one function's output into another
Composition applies one function to the result of another. It is the operation that makes inverse functions definable in the next lesson, and it is the reason the order of transformations in lesson 1.3 mattered.
- \( (f \circ g)(x) \) means \( f(g(x)) \): apply \( g \) first, then \( f \).
- The inner function is written closest to \( x \), which is the reliable way to remember the order.
- To evaluate at a number, work inside out: compute \( g \) of the number, then apply \( f \) to that.
- To form the rule, substitute the whole of \( g(x) \) into every \( x \) of \( f \).
- Composition is not commutative: \( f \circ g \) and \( g \circ f \) are usually different functions.
- The domain of \( f \circ g \) is the inputs that \( g \) accepts and whose outputs \( f \) then accepts.
- Check the inner restriction first, then check what the composed rule itself demands.
- A restriction can survive even when the simplified rule hides it, which is why the domain is found from the composition, not from the final formula.
Where students lose marks: computing \( g(f(x)) \) when the question asked for \( f(g(x)) \). The circle notation is read right to left, which is the opposite of how English reads, and it is worth writing out \( f(g(x)) \) explicitly before doing any algebra.
The problem. Let \( f(x) = x^2 + 1 \) and \( g(x) = 2x - 3 \). (a) Find \( (f \circ g)(x) \). (b) Find \( (g \circ f)(x) \) and compare. (c) Evaluate both at \( x = 2 \) two ways. (d) Find the domain of \( (p \circ q)(x) \) where \( p(x) = \sqrt{x} \) and \( q(x) = x - 5 \).
Step one: set up (a). \( (f \circ g)(x) = f(g(x)) = f(2x - 3) \). The inner function \( g \) goes first, and its whole output \( 2x - 3 \) becomes the input to \( f \).
Step two: substitute and expand (a). \( f(2x - 3) = (2x - 3)^2 + 1 \). \( (2x - 3)^2 = 4x^2 - 12x + 9 \). So \( (f \circ g)(x) = 4x^2 - 12x + 10 \).
Step three: set up and compute (b). \( (g \circ f)(x) = g(f(x)) = g(x^2 + 1) = 2(x^2 + 1) - 3 = 2x^2 + 2 - 3 = 2x^2 - 1 \).
Step four: compare. \( 4x^2 - 12x + 10 \) against \( 2x^2 - 1 \). Different degrees of coefficient, different graphs, different functions entirely. Composition is not commutative, and this pair is a clean demonstration. Only in special cases, such as when the two functions are inverses, does the order not matter.
Step five: evaluate (c) inside out. \( (f \circ g)(2) \): first \( g(2) = 4 - 3 = 1 \), then \( f(1) = 1 + 1 = 2 \). \( (g \circ f)(2) \): first \( f(2) = 4 + 1 = 5 \), then \( g(5) = 10 - 3 = 7 \).
Step six: evaluate (c) from the formulas and confirm. \( 4(4) - 12(2) + 10 = 16 - 24 + 10 = 2 \). Matches. \( 2(4) - 1 = 7 \). Matches. Both routes agree, which checks the algebra in steps two and three at the same time. Doing the evaluation both ways is the cheapest available verification of a composed rule.
Step seven: set up (d). \( (p \circ q)(x) = p(q(x)) = p(x - 5) = \sqrt{x - 5} \).
Step eight: find the domain of (d) properly. Two conditions, in order. First, \( x \) must be acceptable to \( q \). Since \( q(x) = x - 5 \) is defined for every real number, this imposes nothing. Second, the output of \( q \) must be acceptable to \( p \). Since \( p \) is a square root, it needs a nonnegative input: \( x - 5 \ge 0 \), so \( x \ge 5 \). Domain: \( [5, \infty) \). Check: at \( x = 9 \), \( \sqrt{4} = 2 \). Defined. At \( x = 1 \), \( \sqrt{-4} \) is not real. Correctly excluded. The order of the two checks matters in general. Had \( q \) been \( \dfrac{1}{x} \), the value \( x = 0 \) would be excluded by the inner function even if the final simplified formula showed no trace of it, which is the situation item 8 of the method warns about.
Problems 1 to 5 are routine. Problems 6 to 10 are multi-step or ask for reasoning. Use \( f(x) = 3x + 1 \) and \( g(x) = x^2 \) unless told otherwise.
- Find \( f(g(2)) \).
Show the full solution
\( g(2) = 4 \), then \( f(4) = 13 \). 13
- Find \( g(f(2)) \).
Show the full solution
\( f(2) = 7 \), then \( g(7) = 49 \). 49
- Find \( (f \circ g)(x) \).
Show the full solution
\( f(x^2) = 3x^2 + 1 \). \( 3x^2 + 1 \)
- Find \( (g \circ f)(x) \).
Show the full solution
\( g(3x + 1) = (3x + 1)^2 \). \( (3x+1)^2 = 9x^2 + 6x + 1 \)
- Which function is applied first in \( (f \circ g)(x) \)?
Show the full solution
\( g \)
- With \( f(x) = \dfrac{1}{x} \) and \( g(x) = x + 4 \), find \( (f \circ g)(x) \) and its
domain.
Show the full solution
\( f(g(x)) = f(x + 4) = \dfrac{1}{x + 4} \). Domain: \( g \) accepts everything, and \( f \) rejects an input of zero, so \( x + 4 \ne 0 \) and \( x \ne -4 \). Domain: all reals except \( -4 \). Check: at \( x = -4 \) the expression is \( \dfrac{1}{0} \), undefined. Correctly excluded. \( \frac{1}{x+4} \), all reals except \( -4 \)
- With \( f(x) = \sqrt{x} \) and \( g(x) = x^2 \), find \( (f \circ g)(x) \) and simplify
carefully.
Show the full solution
\( f(g(x)) = \sqrt{x^2} \). The simplification is not \( x \). The radical denotes the principal root, which is never negative, so \( \sqrt{x^2} = \left| x \right| \). Check with a negative input: at \( x = -3 \), \( \sqrt{9} = 3 \), not \( -3 \). So the answer must be \( \left| x \right| \). Domain: \( g \) accepts every real, and its output \( x^2 \) is never negative, so \( f \) accepts it. Domain: all reals. This is the even-root absolute value that appears throughout unit 5. \( \left| x \right| \), domain all reals
- With \( f(x) = 2x - 6 \) and \( g(x) = \dfrac{x + 6}{2} \), find both compositions and
say what you notice.
Show the full solution
\( (f \circ g)(x) = f\left( \dfrac{x+6}{2} \right) = 2 \cdot \dfrac{x+6}{2} - 6 = (x + 6) - 6 = x \). \( (g \circ f)(x) = g(2x - 6) = \dfrac{(2x - 6) + 6}{2} = \dfrac{2x}{2} = x \). Both compositions give \( x \), the identity function. What that means. Each function exactly undoes the other, so they are inverses. That is the definition lesson 1.7 uses, and it is the one case where the order of composition genuinely does not matter. Check numerically: \( f(5) = 4 \) and \( g(4) = 5 \). Round trip confirmed. Both equal \( x \); the functions are inverses
- Explain why the domain of a composition must be found before simplifying.
Show the full solution
Simplification can cancel the very expression that caused a restriction, leaving a formula that looks unrestricted while the function still is. A concrete case. Let \( f(x) = x^2 \) and \( g(x) = \dfrac{1}{x} \). Then \( (f \circ g)(x) = \left( \dfrac{1}{x} \right)^2 = \dfrac{1}{x^2} \), which still shows the restriction. But take \( f(x) = \dfrac{1}{x} \) and \( g(x) = \dfrac{1}{x} \): the composition simplifies to \( x \), and the final formula shows no restriction at all. Yet \( x = 0 \) is not in the domain, because the inner function cannot accept it. The composition is the identity on every input except zero, where it is undefined. Why this is not a technicality. Two functions are equal only when they have the same domain and the same rule. The composition above and the identity function \( y = x \) are different functions, and a graph of the composition has a hole at the origin. The reliable procedure. First require that \( x \) is in the domain of the inner function. Then require that the inner output is in the domain of the outer function. Only then simplify, and never let the simplified form revise the domain. Canceling can hide a restriction that the inner function still imposes, so the domain is read from the composition rather than from the simplified formula
- A store applies a 20 percent discount and then adds 8 percent sales tax. Write both
operations as functions, compose them in both orders, and say whether the order matters.
Show the full solution
Write the functions. Let \( x \) be the marked price in dollars. Discount: paying 80 percent of the price, so \( d(x) = 0.80x \). Tax: adding 8 percent, so \( t(x) = 1.08x \). Discount first, then tax. \( (t \circ d)(x) = t(0.80x) = 1.08(0.80x) = 0.864x \). Tax first, then discount. \( (d \circ t)(x) = d(1.08x) = 0.80(1.08x) = 0.864x \). The order does not matter here. Both give \( 0.864x \), that is 86.4 percent of the marked price. Check with a number. Take \( x = 100 \). Discount first: \( 100 \to 80 \to 86.40 \). Tax first: \( 100 \to 108 \to 86.40 \). Identical. Confirmed. Why the order does not matter in this case. Both operations are multiplications by a constant, and multiplication is commutative: \( 1.08 \times 0.80 = 0.80 \times 1.08 \). Composition of two such functions is just multiplication of their factors. When the order would matter. Change the discount to a flat $20 off, so \( d(x) = x - 20 \). Then \( (t \circ d)(100) = t(80) = 86.40 \), while \( (d \circ t)(100) = d(108) = 88 \). Now the order costs the customer $1.60, because one operation is multiplicative and the other additive, and those do not commute. The general lesson. Composition commutes only in special circumstances, and "both operations scale by a constant" is one of the few. Whenever a problem mixes a percentage with a flat amount, the order has to be stated, which is why real tax law specifies it explicitly. Both orders give \( 0.864x \); the order does not matter because both are scalings, but it would if either were a flat amount