The layer diagram from the previous chapter showed a chain of dependencies: an input x enters the inner function g and produces an intermediate value u = g(x), which then enters the outer function f and produces y = f(u).
Each arrow in that diagram is a rate of change:
- \(\dfrac{du}{dx}\) is how fast the intermediate value changes as x changes.
- \(\dfrac{dy}{du}\) is how fast the output changes as the intermediate value changes.
The chain rule says these rates multiply:
\[\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}\]
In function notation, with \(y=f(g(x))\), the same statement is
\[\frac{d}{dx}\big[f(g(x))\big]=f'(g(x))\cdot g'(x)\]
Why the factor count equals the layer count. Every arrow in the dependency diagram contributes exactly one rate, and every layer of the composite is exactly one arrow. So a two-layer composite produces a two-factor product, and a three-layer composite produces three factors:
\[\frac{d}{dx}\big[f(g(h(x)))\big]=f'\big(g(h(x))\big)\cdot g'\big(h(x)\big)\cdot h'(x)\]
This is the bookkeeping rule that makes the setup reliable: count the layers first, then expect that many factors. If the written product has fewer factors than the layer count, a layer was skipped.