Scalar chain rule
The derivative of a composition is the outer derivative evaluated at the inner output, times the inner derivative.
On this page 9 sections
01Follow the values before the derivatives#
Suppose a computation first forms , then squares it to get . To find how changes with , we must account for both operations.
Call the inner function and the outer function . Their composition is . The inner function acts first, even though it is written inside the outer one.
At , the intermediate value is and the output is . These are the forward values. Keep them available: the derivative of the square depends on which value we are squaring.
The diagram follows this calculation and records the local rate of each operation.
02Multiply the two local rates#
The first operation has rate . A small input change therefore changes by .
The square has rate . At the intermediate value , that rate is . It turns the small change into an output change of about .
The overall rate is , obtained by multiplying the inner rate by the outer rate. The numbers and are rates; the forward values and are different quantities.
The derivative notation helps track what changes with respect to what. The rule is a statement about differentiable functions, not ordinary cancellation of independent numbers.
For a numerical check, increase from to . Then and .
Our derivative predicted an output change of , giving . The extra is the quadratic term. Multiplying derivatives captures the first-order effect.
03Evaluate the outer derivative at the inner value#
For differentiable functions and , the scalar chain rule is
A prime means derivative. The expression means evaluate the derivative of at the value . The outer function receives that intermediate value, so its derivative must be evaluated there too.
In our example, , so . Using would evaluate the outer rate at an input it never received.
This distinction becomes more consequential in long computations: each operation's derivative belongs at its own forward input.
. At , and . Also, and . Find at this input.
Show answer and explanation
Use the outer rate at , then multiply: .
04Work through a nonlinear inner function#
Consider . Identify the inner expression and the outer cube .
The inner derivative is . The outer derivative is . Substitute the inner expression into the outer derivative, then multiply:
Differentiating only the outer cube would leave out the factor . That would treat a change in as if it produced an equal change in , which is generally false.
At , the inner value is , the outer rate is , and the inner rate is . The combined rate is .
. Find .
Show answer and explanation
Outer rate: . Inner rate: . Multiply them.
05Track signs and dependency paths#
For , the inner derivative is , giving
At , the derivative is . Increasing slightly reduces the inner value from , which reduces its square. Losing the negative inner rate would predict the wrong direction.
An inner derivative of zero also matters: the first-order effect through that path is zero at that point. It does not necessarily mean the entire composition is constant.
For example, the derivative of vanishes at , even though changes away from zero. Derivatives describe local first-order behavior.
. At , and . Also, and . Claim: use . Repair .
Show answer and explanation
Use : .
In a chain of several scalar operations, multiply the local rates along the dependency path. If an input affects the output through several paths, each path contributes.
The multivariable chain rule adds those path contributions. Jacobian multiplication is the matrix form of this same operation: multiply along a path, then sum over intermediate coordinates.
Evaluate the outer rate at the inner output, then multiply by the inner rate.
- Differentiate a composition of two scalar functions.
Sources & further reading
- [1]OpenStax Calculus Volume 1, 3.6: The chain rule ↗OpenStax Calculus Volume 1 · Book