# Math Insight

### Applet: The chain rule as multiplying slopes

The chain rule for the derivative of the composition $h(x)=f(g(x))$ of two functions $f$ and $g$ can be thought of as the product of the tangent line slopes. The trick is to evaluate the slopes at the correct points of the functions $f$ and $g$. The correct points, illustrated by the green symbols on the function graphs, are those where the functions are evaluated to compute $f(g(x))$. To calculate the composition $h(x)$ at $x=x_0$ (red dots on $x$-axis of the both panels), one must first evaluate $g$ at $x=x_0$, as illustrated by the green diamond on the graph of $g$ (thick blue curve in the left panel). Next, one evaluates $f$ at $g(x_0)$. To graphically translate the value of $g(x_0)$ from the vertical axis to the horizontal axis, one shifts horizontally from the green diamond to the line $x=y$ (gray line), arriving at the point $(g(x_0),g(x_0))$. By moving vertically to the graph of $f$ (thin cyan curve), one obtains $f(g(x_0))$, which is the vertical coordinate of the green triangle. In the graph of the composition $h(x)=f(g(x))$ (green curve in right panel), calculating $h(x_0)$ simply corresponds to moving vertically from the red point representing $x_0$ to the green circle on the graph of $h$, yielding the vertical coordinate $h(x_0)$.

The slope of the tangent line at the green circle on the graph of $h$, is simply the product of the slope of $g$'s tangent line at the green diamond and the slope of $f$'s tangent line at the green triangle, just as in the case of linear functions. The slopes are shown near the green symbols, and the tangent lines are shown as thin lines of the same color as the function graphs. Therefore, the chain rule formula for the derivative of $h$ evaluated at $x=x_0$ is: $h'(x_0)=f'(g(x_0))g'(x_0)$.

You can change the functions and $x_0$ by entering expressions in the boxes; you can also change $x_0$ by dragging one of the red points on the $x$-axes. You can zoom in, zoom out, or pan the axes by clicking the corresponding buttons.

Applet file: chain_rule_multiply_slopes.ggb