Chain Rule for Several Variables: Explained with Examples
In the real world, quantities rarely depend on just one thing. The altitude of a hiker depends on latitude and longitude, but both of those change as time passes. If you want the rate at which altitude changes with time, a single-variable chain rule applied once is not enough — you need a rule that collects every path through which time can influence the result.
The chain rule for several variables does exactly that. If z = f(x, y) and x and y are themselves functions of t, then dz/dt = fx · dx/dt + fy · dy/dt. Each term follows one “path” from t to z: the rate at which z responds to x multiplied by the rate at which x moves with t, plus the same for y. Add the paths up and you get the total rate of change.
Key Concepts
- Path dependence: z depends on t only through the intermediate variables x(t) and y(t); the formula sums one product term per intermediate variable.
- Tree diagram: draw t at the bottom, x and y above it, z at the top — every path from t to z contributes one product of derivatives.
- Two-parameter version: if z = f(x, y) with x = g(s, t), y = h(s, t), then ∂z/∂s = fx xs + fy ys and ∂z/∂t = fx xt + fy yt.
- Implicit differentiation is a special case of this rule, applied to equations like F(x, y) = 0.
Formulas
- dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)
- For w = f(x, y, z) with x, y, z functions of t: dw/dt = fx x′ + fy y′ + fz z′
- Partial version: ∂z/∂s = zx xs + zy ys
- Implicit: if F(x, y) = 0 defines y as a function of x, then dy/dx = −Fx/Fy.
Worked Example
Find dz/dt for z = x² + y², where x = sin t and y = cos t.
- Partial derivatives of z. zx = 2x, zy = 2y.
- Derivatives of the inner functions. dx/dt = cos t, dy/dt = −sin t.
- Assemble the chain rule. dz/dt = 2x · cos t + 2y · (−sin t) = 2 sin t cos t − 2 cos t sin t = 0.
- Verify directly. Substituting gives z = sin²t + cos²t = 1, a constant, so dz/dt = 0 — it matches.
- Numeric check at t = π/6. x = 0.5, y ≈ 0.8660. Then dz/dt = 2(0.5)(0.8660) − 2(0.8660)(0.5) = 0.8660 − 0.8660 = 0. Confirmed.
Common Misconceptions
- “The chain rule only applies to compositions like f(g(x)).” The multivariable version handles nested dependence through several intermediate variables at once.
- “dz/dt is just zx times x′(t).” Forgetting the y-path misses half the change — every intermediate variable contributes its own term.
- “You can take ∂z/∂t directly from z = x² + y².” No — z is not written as a function of t, so the total derivative dz/dt must be assembled from the parts.
Real-World Applications
- Physics: the total time derivative of energy, position, or temperature when the coordinates themselves move.
- Machine learning: backpropagation is the chain rule applied layer by layer through a neural network.
- Economics: how a final price responds to an input cost that affects several production stages at once.
- Implicit differentiation: finding dy/dx from equations like x² + y² = 25 without solving for y.
The multivariable chain rule is bookkeeping for dependence: list every intermediate variable, multiply “how z responds to it” by “how it responds to t”, and add. Draw the tree diagram whenever a problem has more than two layers — it turns a confusing nest of functions into a simple sum of paths.
Related blogs
- Functions of Several Variables: Explained with Examples
- Partial Derivatives: Rules and Examples Fully Explained
- Higher-Order Partial Derivatives Explained Simply
- Total Differential: Definition, Approximation, Chain Rule
- Jacobians in Calculus: Definition, Formula and Examples
- Maxima and Minima of Two Variables: A Complete Guide