Menu

Order Matters

Part of the Functions & Transformations section of Coddy's Algebra 2 journey. Lesson 19 of 55.

Swap the order of a composition and you usually get a different answer. Take f(x)=x+2f\left(x\right) = x+2 and g(x)=x2g\left(x\right) = {x}^{2}, with the input 3. g(f(3))g\left(f\left(3\right)\right) adds first: f(3) is 5, then g(5) is 25. f(g(3))f\left(g\left(3\right)\right) squares first: g(3) is 9, then f(9) is 11.

Adding then squaring is not squaring then adding, so the results differ. As rules, g(f(x))=(x+2)2g\left(f\left(x\right)\right) = {\left(x+2\right)}^{2} while f(g(x))=x2+2f\left(g\left(x\right)\right) = {x}^{2}+2.

So read a composition from the inside out every time. The innermost call is the one you work out first, whatever its letter, and the letter written first is the one that acts last.

challenge icon

Challenge

For f(x)=3x+1f\left(x\right) = 3x+1 and g(x)=x2−1g\left(x\right) = {x}^{2}-1, work out f(g(2))f\left(g\left(2\right)\right). Use the inner rule first, then type the arithmetic line by line.

Try it yourself

f(g(2))f\left(g\left(2\right)\right)

Simplify

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

All lessons in Functions & Transformations