Read this lesson as text
Computing f(g(x))
Pre-Calculus · Axiom Academy
Working a function composition step by step — and seeing why order matters. Given the functions f(x) = x^2 and g(x) = x + 1 , find the composition , evaluate it at x = 2 , and compare it with g(f(x)) . For f(g(x)), the input x goes through g first, then its output is fed into f. Nice work — you composed two functions and saw exactly how the order changes the result. What f(g(x)) means: apply g first, then feed its output into f . The substitution move: replace every x in f with the entire expression g(x) , giving f(g(x)) = (x+1)^2 . Evaluating: f(g(2)) = (2+1)^2 = 3^2 = 9 . Order matters: g(f(x)) = x^2 + 1 , which is not the same as (x+1)^2 — in general . Composition is just "machines in a row." Reading the order correctly is most of the battle.
This is the written version of the interactive lesson above. See the full Pre-Calculus course.