Menu

One Inside Another

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

A composition feeds one function's output into another function. g(f(x))g\left(f\left(x\right)\right) means: work out f(x), then use that result as the input of g. It reads "g of f of x", and books also write it as (g ∘ f)(x).

Take f(x)=x+4f\left(x\right) = x+4 and g(x)=3xg\left(x\right) = 3x, and work out g(f(2))g\left(f\left(2\right)\right). Inner first: f(2) is 6. Then g(6) is 18. Written out, f's rule turns the problem into g(2+4)g\left(2+4\right), then g's rule gives 3(2+4)3\left(2+4\right), and the arithmetic finishes it.

Why the inside first? g needs a number to work on, and that number is whatever f produces. Code runs the same way: in g(f(2)), the computer calls f before g has an argument.

challenge icon

Challenge

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

Try it yourself

g(f(1))g\left(f\left(1\right)\right)

Simplify

Givenf(x)=2x+1f\left(x\right) = 2x+1g(x)=x2g\left(x\right) = x^{2}

All lessons in Functions & Transformations