Educerie

Educerie · AP · Precalculus

AP Precalculus 2.7

Composition of Functions

How do you apply one function after another, evaluate the result from a table, a graph or a formula, and take a composite apart?

What you will learn

  • Understand the composite as g first, then f, with a domain limited by g's outputs
  • Know that composition is not commutative and the identity leaves a function unchanged
  • Know how to build, decompose and read composites in every representation

You must be able to

  1. Evaluate f(g(a)) from tables, graphs or formulas
  2. Build f(g(x)) and g(f(x)) and show they differ
  3. State the domain of a composite
  4. Decompose a formula into an inside and an outside function
  5. Use composition to link two quantities in a context
  6. Describe a transformation as a composition

In the exam. Section I multiple choice, Part A (no calculator) and Part B: evaluate f(g(a))f(g(a)) from tables or graphs, find the composite from two formulas, find its domain, or decompose a formula. Free-response 1 (calculator, no context) typically opens with a composition value read from a table or graph, and the next part reuses it to find an input for a given output. Marks are lost on reading the wrong function first.

1Evaluating a composite from tables and graphs

Work from the inside out. Evaluate gg first, then use that output as the input to ff.

Worked example 1. Two invented tables.

xx1234
g(x)g(x)3142
xx1234
f(x)f(x)57911
  • f(g(2))f(g(2)): g(2)=1g(2) = 1, then f(1)=5f(1) = 5. So f(g(2))=5f(g(2)) = 5.
  • f(g(3))f(g(3)): g(3)=4g(3) = 4, then f(4)=11f(4) = 11.
  • g(f(2))g(f(2)): f(2)=7f(2) = 7, but 77 is not an input of gg in the table. This composite is undefined from the table.

The last item shows the domain rule. f(g(2))f(g(2)) and g(f(2))g(f(2)) are different, and one of them does not exist here.

On a graph, find xx on the horizontal axis, read the height of gg, then use that value as a horizontal position on the graph of ff and read its height.

2The domain of a composite

The composite f∘gf\circ g is defined for the inputs of gg whose outputs lie in the domain of ff. Two things must hold: xx is in the domain of gg, and g(x)g(x) is in the domain of ff.

Worked example 2. Let f(x)=x2−3f(x) = x^2 - 3 and g(x)=x+1g(x) = \sqrt{x+1}.

f(g(x))=(x+1)2−3=(x+1)−3=x−2f(g(x)) = \left(\sqrt{x+1}\right)^{2} - 3 = (x+1) - 3 = x - 2

The formula x−2x - 2 is defined for every real xx. But gg needs x+1≥0x + 1 \ge 0. So the composite has the domain x≥−1x \ge -1, even though the simplified formula looks unrestricted.

Now the other order:

g(f(x))=(x2−3)+1=x2−2g(f(x)) = \sqrt{(x^{2}-3) + 1} = \sqrt{x^{2} - 2}

This needs x2−2≥0x^2 - 2 \ge 0, so x≤−2x \le -\sqrt2 or x≥2x \ge \sqrt2. The two composites are different functions with different domains.

3Building the composite

To find f(g(x))f(g(x)), replace every xx in the formula of ff with the whole expression g(x)g(x). Use brackets.

Worked example 3. Let f(x)=2x+1f(x) = 2x + 1 and g(x)=x2−4g(x) = x^2 - 4.

f(g(x))=2(x2−4)+1=2x2−7f(g(x)) = 2(x^{2}-4) + 1 = 2x^{2} - 7g(f(x))=(2x+1)2−4=4x2+4x−3g(f(x)) = (2x+1)^{2} - 4 = 4x^{2} + 4x - 3

The results differ, so composition is not commutative.

Identity. If I(x)=xI(x) = x, then f(I(x))=f(x)f(I(x)) = f(x) and I(f(x))=f(x)I(f(x)) = f(x). So f∘I=I∘f=ff\circ I = I\circ f = f.

4A table or graph of a composite

A table of f∘gf\circ g lists xx, the output of gg, then the output of ff. Each row gives a point (x, f(g(x)))(x,\ f(g(x))) on the graph of the composite. In Worked example 1 the row for x=2x = 2 is (2, 5)(2,\ 5), and the row for x=3x = 3 is (3, 11)(3,\ 11).

5Composition in context

Composition links two quantities when no direct formula is given.

Worked example 4. A taxi's fare in dollars after mm miles is C(m)=0.5m+20C(m) = 0.5m + 20, and the taxi travels at 6060 miles per hour, so after tt hours it has gone m(t)=60tm(t) = 60t miles.

C(m(t))=0.5(60t)+20=30t+20C(m(t)) = 0.5(60t) + 20 = 30t + 20

The composite gives the fare after tt hours. The context restricts the input: t≥0t \ge 0.

6Decomposing a function

To rewrite h(x)h(x) as f(g(x))f(g(x)), find an "inside" part and an "outside" part. The inside is what you compute first. Replace each occurrence of the inside by a new variable.

  • h(x)=(3x−2)4h(x) = (3x-2)^4: inside g(x)=3x−2g(x) = 3x - 2, outside f(u)=u4f(u) = u^4.
  • h(x)=2x2+1h(x) = 2^{x^2+1}: inside g(x)=x2+1g(x) = x^2 + 1, outside f(u)=2uf(u) = 2^u.
  • h(x)=1x−4+7h(x) = \dfrac{1}{x-4} + 7: inside g(x)=x−4g(x) = x - 4, outside f(u)=1u+7f(u) = \dfrac1u + 7.

Check by substituting: f(g(x))f(g(x)) must give h(x)h(x). A decomposition is not unique, but each one must give back hh.

7Transformations are compositions

  • A horizontal or vertical translation is a composition with x+kx + k. The function f(x+k)f(x + k) is ff composed with g(x)=x+kg(x) = x + k.
  • A dilation is a composition with KxKx. The function f(Kx)f(Kx) is ff composed with g(x)=Kxg(x) = Kx.

When the change is made to the input before ff acts, the effect on the graph is horizontal (and opposite to what the sign suggests for a translation). When it is made after, it is vertical. For example, f(x)+3f(x) + 3 is g(f(x))g(f(x)) with g(x)=x+3g(x) = x + 3, a vertical shift up.

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.