Mistake Master
Student view — seeing the site as a student does
Mistake Master · AP Precalculus · Unit 2 · Step-Through Animation

Composition of Functions

The Machine That Feeds a Machine

You'll learnto run a composition in the right order, and to spot the input the second machine refuses.

Composition chains two functions so that the output of one becomes the input of the other, and nearly every point this topic costs comes from a single confusion: reading the notation left to right and running the outer machine first. Watch one value travel the chain the right way, watch the wrong order land somewhere else entirely, and watch an input get stopped cold at the second machine’s door. Twelve short steps; press Next for each one.

12 STEPS · 6 QUICK CHECKS · f(g(x)) — INSIDE ACTS FIRST · v4

the output of one machine is the input of the next
Before you start
What you're looking at
Two machines joined by a rail, with a single value traveling through them and its running total written underneath.
The question
Which machine runs first, and will the second one accept what the first hands it?
Step 1 / 12

Read all 12 steps as text
Step 1

Two machines, one journey

Two machines sit on one rail: the first adds 3, the second squares whatever it is given, and a single value is about to travel through both of them.

Step 2

Read it from the inside out

The notation nests rather than reads left to right: whatever sits closest to the x is what happens first, and its answer is what the outer name is then applied to.

\(f(g(x)) \quad\text{means: } g \text{ first, then } f\)
Step 3

Look up the inner value first

The same rule holds when the functions arrive as tables instead of formulas: find the inner function’s row before you go anywhere near the outer one.

Step 4

One output becomes the next input

The number the first table produced is carried across and looked up as an input in the second, which is the whole of what composition does.

Step 5

Same input, opposite orders

Run the same starting value through both machines twice over, once in each order, and watch what the middle value does before either chain finishes.

Step 6

The order changes the answer

The two chains finish in different places, so composition is not the sort of operation you can reorder — these two agree only where \((x+3)^2 = x^2+3\), which is the single point \(x = -1\).

Step 7

Substitute the whole expression

To compose the formulas rather than the numbers, take the inner rule entire — brackets and all — and drop it into the slot where the outer rule keeps its x.

Step 8

Both roads reach the same number

The composed formula is the chain written down, so evaluating it has to agree with walking a value through the two machines by hand.

Step 9

The inner output has to be legal

Change the machines to a subtraction feeding a square root and a second requirement appears: whatever the first machine hands over has to be something the second one can actually accept.

Step 10

Refused at the second machine

Send in a smaller starting value and the first machine works perfectly well, but what it produces is something the second machine has no answer for — so that input is simply not in the composition’s domain.

Step 11

Reading it left to right

Here is the mistake itself, drawn as a detour: the outer name is read first because it is written first, the value goes through the machines in the wrong order, and it comes out somewhere else entirely.

Step 12

Inside out, every time

Work outward from whatever is closest to the x, carry each answer forward as the next input, and check that the handoff is something the next machine can take.