๐Ÿ  Home โ€บ ๐Ÿ“ˆ Linear Functions โ€บ Lesson 2

๐Ÿงฉ Chained Machines โ€” Composition of Functions

๐Ÿ“– Lesson 2 of 10

๐Ÿ“Œ Key idea of this section

f(g(x)) means: run g FIRST, then feed its output into f.
Read it inside-out. When linear machines chain, their slopes MULTIPLY.

What happens if you connect two machines in a row โ€” the chute of g pouring into the hopper of f? That chained machine is called the composition of f and g, written f(g(x)) or (f โˆ˜ g)(x). The one rule you must remember: the inside machine runs first.

Let's set up two machines and watch closely:

f(x) = 2x + 1        (double, add 1)
g(x) = 3x โˆ’ 2        (triple, subtract 2)

Worked example 1 โ€” a number through the chain. Find f(g(2)):

Step 1: g(2) = 3 ร— 2 โˆ’ 2        (inside machine g runs first)
Step 2: g(2) = 6 โˆ’ 2 = 4        (multiply, then subtract)
Step 3: f(g(2)) = f(4)          (feed g's output into f)
Step 4: f(4) = 2 ร— 4 + 1 = 9    (run f's recipe on 4)

So f(g(2)) = 9. The number 2 went into g, came out as 4, went into f, came out as 9.

Worked example 2 โ€” the chain's own formula. What recipe does the chained machine f(g(x)) follow?

Step 1: f(g(x)) = 2 ร— g(x) + 1      (f doubles ITS input, whatever it is)
Step 2: f(g(x)) = 2(3x โˆ’ 2) + 1     (g(x) IS 3x โˆ’ 2 โ€” substitute it in)
Step 3: f(g(x)) = 6x โˆ’ 4 + 1        (distribute: 2ร—3x = 6x, 2ร—(โˆ’2) = โˆ’4)
Step 4: f(g(x)) = 6x โˆ’ 3            (combine: โˆ’4 + 1 = โˆ’3)

Test drive with x = 2: 6 ร— 2 โˆ’ 3 = 12 โˆ’ 3 = 9 โœ… โ€” matches example 1, as it must.

Worked example 3 โ€” the OTHER order. Find g(f(x)):

Step 1: g(f(x)) = 3 ร— f(x) โˆ’ 2      (g triples ITS input, then takes 2)
Step 2: g(f(x)) = 3(2x + 1) โˆ’ 2     (substitute f(x) = 2x + 1)
Step 3: g(f(x)) = 6x + 3 โˆ’ 2        (distribute: 3ร—2x = 6x, 3ร—1 = 3)
Step 4: g(f(x)) = 6x + 1            (combine: 3 โˆ’ 2 = 1)

Look carefully: f(g(x)) = 6x โˆ’ 3 but g(f(x)) = 6x + 1. Different recipes! Composition order matters. But notice something beautiful: both chains have slope 6, and 6 = 2 ร— 3 โ€” the two slopes multiplied. That always happens:

Chain slope = (slope of f) ร— (slope of g)

Why? If g multiplies every step by 3 and then f multiplies every result by 2, one step of x grows the final output by 3 ร— 2 = 6. (We'll meet it again in the challenge problems โ€” problem 78 turns this into a detective puzzle.)

โœ๏ธ Your Turn!

With f(x) = 4x โˆ’ 3 and g(x) = x + 5, find f(g(2)). Then find the formula for f(g(x)) and check your number with it.

๐Ÿ‘€ Show the answers

Answer: g(2) = 2 + 5 = 7; f(7) = 4 ร— 7 โˆ’ 3 = 28 โˆ’ 3 = 25. Formula: f(g(x)) = 4(x + 5) โˆ’ 3 = 4x + 20 โˆ’ 3 = 4x + 17. Check: 4 ร— 2 + 17 = 25 โœ…. Note the chain slope is 4 ร— 1 = 4 โ€” g's slope is the hidden 1 in front of x.

V.3.1