Category: Functions Level: 201
f(g(1)): up to g, across to y = x, up to f
You can compose functions on a graph without any algebra. Go up to g, slide across to the line y = x to turn the output into an input, then go up to f.
Graph g(x) = x + 1 and f(x) = x². Add the helper line y = x. It turns any height into the same x.
g(x) = x + 1, f(x) = x2, y = x
Start at x = 1 and go up until you hit g. The height there is g(1) = 2.
g(1) = 2
The output 2 has to become the next input. Slide sideways to the line y = x, which puts you right above x = 2.
height 2 → x = 2
From (2, 2) go up to f. The height there is f(2) = 4, so f(g(1)) = 4. Three moves, no algebra.
f(g(1)) = f(2) = 4
Repeat for every x and you trace y = (x + 1)², the graph of f ∘ g. It passes through (1, 4), the point the three moves found.
(f ∘ g)(x) = (x + 1)2, (f ∘ g)(1) = 4
cd svg-generator python3 -m svgmath render function-composition-graph --out /tmp/function-composition-graph
Source: svgmath/diagrams/function_operations.py