Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.What you feel while walking
The air is warmer to the north and cooler to the east. You go for a walk. How fast does the temperature you feel change? It depends on two things: how the temperature changes from place to place, and how fast you’re moving in each direction. Multiply “degrees per km northward” by “km per hour northward”, do the same eastward, and add.
That recipe is the multivariable chain rule.
A robot arm’s hand position depends on its joint angles, and the angles change over time. How fast the hand moves comes from the chain rule. Training a neural network uses the same rule, run backwards through millions of connections: that’s backpropagation.
- 1. It warms 2 °C per km going north. You walk north at 3 km/h. You feel it warm at…
- 2. If you stand still in a field that doesn't change, the temperature you feel changes at…
- 3. Walking along a contour line (equal temperature), you feel…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.One parameter, two variables
If with and :
Example. along the circle , :
At , , so .
Check by direct substitution. For , , , we get and . The chain rule gives . ✓
- 1. f = xy with x = t, y = t². dz/dt at t = 1?
- 2. f = x² + y² along the unit circle: dz/dt = ?
- 3. f = 3x + 4y, x = cos t, y = sin t, at t = 0?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.The general rule
If depends on , and each depends on :
In words: multiply along each path, add over paths. Draw a tree diagram, with at the top, the below it, and the at the bottom. In matrix form, the Jacobians multiply (A3.2-5):
Implicit differentiation
If defines , the chain rule on gives , so
For the circle at : . You never need to solve for .
Changing coordinates
In polar coordinates , : . For , this gives and , as expected.
- 1. Implicit dy/dx for x² + y² = 25 at (3, 4)?
- 2. J_{f∘g} = ?
- 3. ∂f/∂r for f = x² + y² at r = 3?
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Proof via linear approximations
If is differentiable at and is differentiable at :
Substitute . Since , the error stays , so . ∎ Linear approximations compose by matrix multiplication.
Partial vs total derivatives
With and , the partial derivative holds fixed. The total derivative follows as it changes. At , they are 4 and 12. Confusing the two is a classic bug in physics derivations and in hand-written gradients.
The implicit function theorem
If at a point and , then near that point is a differentiable function of , with . The vector version needs the Jacobian to be invertible. This underlies constrained mechanics, robot loop-closure constraints, and implicit layers in deep learning.
Exercise 3.1: Differentiate f(x, y) = x²y with x = s + t, y = st, with respect to s
. At : , , so the result is .
- 1. f = xy, y = x². df/dx at x = 2?
- 2. The implicit function theorem needs…
- 3. Linear approximations compose by…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Backpropagation = the chain rule, done backwards
A network is a composition . The chain rule gives . Starting from the scalar loss and moving backwards, each layer turns an incoming gradient into gradients for its parameters and its input. One backward pass costs about the same as a forward pass, and gives every derivative (Linnainmaa, 1970; Werbos, 1974; Rumelhart, Hinton and Williams, 1986). A3.3 builds this systematically.
The chain rule in robotics and estimation
- Differential kinematics. For hand position , the hand velocity is (Practice Code 5). Inverting this relation gives resolved-rate control (Whitney, 1969).
- Extended Kalman filter. A measurement of a moving state changes at , with . Linearizing dynamics and measurements is the chain rule applied over and over.
- Implicit layers and differentiable optimization. If a layer’s output solves (a fixed point, an optimization or an equilibrium), the implicit function theorem gives without unrolling the solver. Examples are OptNet (Amos and Kolter, 2017), deep equilibrium models (Bai, Kolter and Koltun, 2019), and differentiable MPC for robot control (Amos et al., 2018).
References
- S. Linnainmaa (1970). MSc thesis, University of Helsinki. (Reverse-mode automatic differentiation.)
- P. Werbos (1974). Beyond Regression: New Tools for Prediction and Analysis in the Behavioral Sciences. PhD thesis, Harvard.
- D. Whitney (1969). “Resolved motion rate control of manipulators and human prostheses.” IEEE Transactions on Man-Machine Systems, 10(2).
- D. Rumelhart, G. Hinton, R. Williams (1986). “Learning representations by back-propagating errors.” Nature, 323.
- B. Amos, J. Z. Kolter (2017). “OptNet: Differentiable optimization as a layer in neural networks.” ICML.
- B. Amos, I. Jimenez, J. Sacks, B. Boots, J. Z. Kolter (2018). “Differentiable MPC for end-to-end planning and control.” NeurIPS.
- S. Bai, J. Z. Kolter, V. Koltun (2019). “Deep equilibrium models.” NeurIPS.
- J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Appendix A.