Multivariable Differential Calculus

multivariable chain rule

Suppose a quantity depends on several variables, and those variables in turn depend on something else — temperature depends on position, but you move along a path so position depends on time. How fast does temperature change as you walk? The multivariable chain rule answers exactly this: it propagates a change through a chain of dependencies, adding up every route by which the change can travel.

If f depends on x and y, and both x and y depend on a single parameter t, then df/dt = (partial f / partial x)(dx/dt) + (partial f / partial y)(dy/dt). Read it as: the change in f arrives through x and through y, so add the two pathways, each being a partial derivative times the inner rate. If instead x and y depend on two parameters s and t, you get one such sum for partial f / partial s and another for partial f / partial t. In the cleanest formulation this is simply matrix multiplication of total derivatives: the Jacobian of the composition equals the product of the Jacobians, J(f composed with g) = J(f) times J(g).

This rule is the workhorse behind huge swaths of applied mathematics. It converts a PDE between coordinate systems (rewriting the Laplacian in polar or spherical coordinates), it powers backpropagation in neural networks (gradients flowing backward through layers are nested chain rules), and it underlies every change of variables in thermodynamics and mechanics. The one discipline it demands is bookkeeping: with several intermediate and several final variables it is easy to drop a term, which is why the tree diagram exists.

Let f = x^2 + y^2 with x = cos(t), y = sin(t). Then df/dt = (2x)(-sin t) + (2y)(cos t) = 2 cos t (-sin t) + 2 sin t (cos t) = 0 — correctly capturing that f = 1 is constant on the unit circle.

Sum over every path from output to parameter; here the two pathways cancel because f is constant on the circle.

The commonest error is to forget a pathway: with f(x, y) and both x, y depending on t you need BOTH terms. The number of terms equals the number of distinct routes from the final variable back to the one you differentiate against.

Also called
chain rule for several variables多元复合求导多元複合求導