1.2.14 · D5Calculus & Optimization Basics
Question bank — Chain rule for multivariate functions (backprop foundation)
Before we start, one shared vocabulary reminder so nothing below uses an unexplained symbol:
Keep this little map in your mind's eye as you work — most items are really asking "which arrows exist, and do I add or multiply along them?"

True or false — justify
If depends on only through a single intermediate , the multivariate chain rule reduces to a plain product .
True — with only one path, the "sum over paths" has a single term, so the sum collapses to that one product. The multivariate rule always contains the single-variable rule as a special case.
The chain rule requires the to be independent of each other.
False — the can freely depend on the same inputs; that's exactly why we sum. Independence is never assumed. What matters is that each is a direct function argument of .
If for one intermediate, that whole path contributes nothing to .
True — a zero factor kills the product for that path (multiply-along-the-path), so it drops out of the sum. The other paths can still carry gradient. This is exactly how a saturated neuron blocks one route but not necessarily all.
Two different paths can cancel, giving even though genuinely changes along each individual path.
True — path contributions are signed and add; a and a sum to zero. So a zero gradient does not mean is irrelevant everywhere, only that its net first-order effect cancels at that point.
The total differential is exact, not an approximation.
True as a differential relationship (it's the exact linear part). The approximation only appears once you replace differentials with finite nudges ; the error there is higher-order small.
In for with and , we hold constant.
False — this is the classic trap. We hold the other independent input constant, but itself changes because depends on . Freezing would delete a real path and give the wrong answer.
For , the correct derivative is , since the chain rule handles the term.
False — this misses the direct dependence. There are two arrows into : one straight from (contributing ) and one through (contributing ), so . Whenever a variable reaches the output both directly and via an intermediate, both paths are summed.
Backpropagation and the multivariate chain rule are two different algorithms.
False — backprop is the chain rule, organised so each shared sub-result is computed once and reused. It's an efficient bookkeeping of the same sum-over-paths.
For , the derivative even though was itself produced by earlier weights.
True — a partial derivative treats the local relationship only. How was made is irrelevant to ; that history gets handled by the next factor down the chain.
Spot the error
" affects through and through , so ."
The paths should be added, not multiplied. You multiply along one path and sum across different paths, so the correct expression is .
"For I differentiate the chain part and write ."
The direct term was dropped. Both the direct arrow and the arrow through count, giving . Missing the direct dependence is the single most common slip in mixed direct-plus-indirect expressions.
"The sigmoid derivative is , so I plug in directly."
Wrong — . Forgetting the factor overstates the gradient massively when is near 1 and is a common cause of "why won't my by-hand gradient match the framework."
"To get I only need and ; the middle links cancel."
Nothing cancels. The full chain is — every middle link must be multiplied in, or you silently delete the layers between loss and weight.
"Since collects the coefficient, the terms are errors I should ignore."
The terms aren't errors — they are , a legitimate separate answer. You're computing one partial at a time; the coefficient is simply another result, not garbage.
"Multiplying Jacobians is different from the scalar chain rule, so my scalar intuition doesn't transfer."
The Jacobian product is the sum-over-paths written compactly: entry is . Matrix multiplication automatically performs the sum-over-intermediates. See Jacobian and Hessian Matrices.
"Order doesn't matter, so I can multiply the Jacobians in either order when composing layers."
Matrix multiplication is not commutative, and dimensions won't even line up in the wrong order. The output-layer Jacobian must sit on the outside; the composition order mirrors the forward flow reversed.
Why questions
Why do we sum over paths instead of taking, say, the largest path?
Because a small nudge in physically pushes through every route simultaneously, and those simultaneous pushes add up to the total change. Linear approximation of independent contributions is additive.
Why does backprop reuse intermediate gradients instead of recomputing each path from scratch?
Many paths share a common prefix (e.g. the same ). Computing shared factors once and propagating them backward turns exponential path enumeration into linear work — the core efficiency behind Automatic Differentiation.
Why does a saturated sigmoid ( or ) stall learning?
Its local factor , so every gradient flowing through that node is scaled down toward zero, starving upstream weights. Multiply many such small factors across depth and you get vanishing gradients.
Why can't we compute without first doing a forward pass?
The gradient factors like and depend on the actual values of the intermediates and output. Those values only exist after running the network forward on the input.
Why does the parent note's factory-line metaphor demand backward tracing rather than forward?
We want to know how each early station affected the final defect, so we start at the output error and carry blame upstream. Forward would tell us outputs from inputs; backward tells us sensitivities of the loss to each parameter — exactly what Gradient Descent needs.
Why does the choice of activation function change the chain-rule factors even when the network structure is identical?
Each activation contributes its own factor. Swap sigmoid for ReLU and that factor changes from to a -or- gate, reshaping which paths carry gradient.
Edge cases
If an input does not appear in any path to , what is ?
Exactly — there are no path terms to sum, so the empty sum is zero. The variable is genuinely irrelevant to the output at first order.
What happens to the chain rule when an intermediate is used by the output twice (fan-out to two later nodes)?
You get two paths sharing the same early segment; their contributions add. In graph terms, a fan-out node's incoming gradient is the sum of gradients from all its consumers.
At a ReLU kink (), is the chain rule factor well-defined?
Strictly the derivative doesn't exist at exactly (left slope , right slope ). Frameworks pick a subgradient convention (usually ), which works because you almost never land exactly on the kink and the loss is still minimised in practice.
If the loss is flat around the current prediction (), what does every upstream gradient become?
All zero, since is a common leading factor multiplied into every path back to the weights. No error signal means no update — the network sits still even if weights are "wrong" in a deeper sense.
What is when depends on but does not actually depend on (dead intermediate)?
Zero through that route: kills the product. If is 's only route to , the whole partial is zero even though visibly moves with .
For a single input feeding a very deep chain of near-saturated nodes, why does the gradient scale roughly like a product of small numbers?
Because the chain rule multiplies one local factor per layer along the single path; factors each below shrink geometrically. This exponential decay is precisely the vanishing gradient phenomenon.
Recall Quick self-test before you leave
Sum or product across different paths? ::: Sum across paths, product along each path. In with , do we hold fixed? ::: No — we hold the other independent input fixed; still varies through its own dependence on . For , what is ? ::: — the direct arrow plus the arrow through . Is backprop a different algorithm from the chain rule? ::: No — it is the chain rule with shared factors computed once and reused.