Calculus › Section N · Functions of several variables › Topic N.5
The chain rule for several variables
When a quantity depends on variables that themselves depend on something else, every chain of influence contributes a rate. The multivariable chain rule multiplies along each chain and adds the results.
Dependencies that branch
The one-variable chain rule says rates multiply along a chain: if \(y\) depends on \(u\) and \(u\) depends on \(x\), then \(\frac{dy}{dx} = \frac{dy}{du}\frac{du}{dx}\). In several variables the chain branches. A hiker's altitude depends on her position \((x, y)\), and both coordinates depend on time; the temperature in a moving car depends on place and time, and the place depends on time. When one input change reaches the output through several routes, each route contributes its own product of rates, and the contributions add. A tree diagram captures the bookkeeping: draw \(w\) above its inputs, the inputs above \(t\), and read off one product per path.
One independent variable
Suppose \(w = f(x, y)\), where \(x = g(t)\) and \(y = h(t)\) are differentiable and \(f\) is differentiable. Then \(w\) is a differentiable function of \(t\), and
Two paths lead from \(t\) to \(w\), one through \(x\) and one through \(y\): multiply the rates along each path, then add. The fastest way to see why: the total differential says \(dw = w_x\,dx + w_y\,dy\), and dividing every term by \(dt\) turns the differential statement into exactly this chain rule.
Worked example: a chain with two links
Let \(w = x^2y\), where \(x = \cos t\) and \(y = e^t\). Find \(\frac{dw}{dt}\) at \(t = 0\). The partials are \(w_x = 2xy\) and \(w_y = x^2\), and the link rates are \(\frac{dx}{dt} = -\sin t\) and \(\frac{dy}{dt} = e^t\). So
At \(t = 0\), \(x = 1\) and \(y = 1\), giving \(0 + 1 = 1\). Check by substitution: \(w = \cos^2 t \cdot e^t\), whose one-variable derivative is \(-2\sin t\cos t\, e^t + \cos^2 t\, e^t\), which is also \(1\) at \(t = 0\). Two methods, one answer.
Worked example: a drone over terrain
A drone flies over hilly ground whose height is \(z = 100 - x^2 - 2y^2\) metres, moving so that \(x'(t) = 1\) and \(y'(t) = 2\) metres per second. How fast is it descending at the point above \((1, 1)\)? The partials are \(z_x = -2x\) and \(z_y = -4y\), so
At \((1, 1)\): \(-2 - 8 = -10\), so the terrain under the drone drops 10 metres per second. Each direction of motion contributes its own slope-times-speed, which is exactly what a related-rates problem becomes when the geometry has several moving parts.
Two independent variables
Now let the inner functions themselves have two inputs: \(w = f(x, y)\), where \(x = g(s, t)\) and \(y = h(s, t)\). Then \(w\) is a function of \(s\) and \(t\), and each partial follows the same one-path-per-input pattern:
The first formula holds \(t\) fixed and the second holds \(s\) fixed, which is why these are partial derivatives, written with \(\partial\), not ordinary ones. The grid extends to any number of layers and branches: for each desired derivative, trace the paths to that independent variable and add one product per path.
Worked example: two methods must agree
Find \(\frac{\partial w}{\partial s}\) for \(w = xy^2\), where \(x = s + 2t\) and \(y = s - t\). Chain rule: \(w_x = y^2\), \(w_y = 2xy\), \(x_s = 1\), \(y_s = 1\), so \(\frac{\partial w}{\partial s} = y^2 + 2xy\). Substituting back, that is \((s - t)^2 + 2(s + 2t)(s - t) = 3s^2 - 3t^2\). Direct substitution first gives \(w = (s + 2t)(s - t)^2 = s^3 - 3st^2 + 2t^3\), whose \(s\)-partial is \(3s^2 - 3t^2\). The two methods agree, as they must. A quick spot check at \((s, t) = (2, 1)\): the chain form gives \(y^2 + 2xy = 1 + 8 = 9\), and \(3(4) - 3(1) = 9\). Substitution is a genuine check, not just a second opinion.
Implicit differentiation returns
The chain rule also streamlines the implicit differentiation you learned for one variable. Suppose \(F(x, y) = 0\) defines \(y\) as a differentiable function of \(x\). Regard \(F(x, y)\) as \(w = F(x, y)\) with \(y = y(x)\), and differentiate \(w\) with respect to \(x\): since \(w\) is constantly 0,
Solving, \(\frac{dy}{dx} = -\frac{F_x}{F_y}\) wherever \(F_y \ne 0\). With three variables, if \(F(x, y, z) = 0\) defines \(z\) as a function of \(x\) and \(y\), the same argument applied to each variable gives \(z_x = -\frac{F_x}{F_z}\) and \(z_y = -\frac{F_y}{F_z}\), wherever \(F_z \ne 0\). The minus sign is built into the algebra, not memorised separately.
Worked example: derivatives from an implicit curve and a sphere
First, find \(\frac{dy}{dx}\) when \(y^3 + xy - 2x^3 = 0\). Take \(F(x, y) = y^3 + xy - 2x^3\): \(F_x = y - 6x^2\) and \(F_y = 3y^2 + x\), so
At the point \((1, 1)\), which satisfies the equation, the slope is \(\frac{6 - 1}{3 + 1} = \frac{5}{4}\). Second, for the sphere \(x^2 + y^2 + z^2 = 25\), take \(F = x^2 + y^2 + z^2 - 25\): \(z_x = -\frac{2x}{2z} = -\frac{x}{z}\). At \((3, 0, 4)\) on the sphere, \(z_x = -\frac{3}{4}\): raising \(x\) by a small amount lowers \(z\), as the shape of a sphere demands.
Common mistakes to avoid
The most common slip is misreading the tree: \(\frac{\partial w}{\partial s}\) collects only the paths that end at \(s\), so check that every term contains a derivative with respect to \(s\). The second is using \(d\) where \(\partial\) belongs: with two independent variables, other inputs are being held fixed, and the round symbol records that. The third is mixing up which variable is frozen in each partial — write \(x_s\), \(y_s\) and so on before multiplying anything. The fourth is dropping the minus sign in \(-\frac{F_x}{F_y}\); if you remember that it comes from solving \(F_x + F_y y' = 0\), it cannot escape. Finally, \(y_s\) of \(s - t\) is \(+1\): freezing \(t\) does not negate anything.
Key takeaways
With one independent variable, \(\frac{dw}{dt} = w_x\frac{dx}{dt} + w_y\frac{dy}{dt}\): one product per path, then add — the total differential divided by \(dt\). With two independent variables, each partial \(\frac{\partial w}{\partial s} = w_x x_s + w_y y_s\) works the same way, holding the other independent variable fixed. Tree diagrams track the bookkeeping for any number of layers. Implicit differentiation becomes a formula: \(\frac{dy}{dx} = -\frac{F_x}{F_y}\) from \(F(x, y) = 0\), and \(z_x = -\frac{F_x}{F_z}\), \(z_y = -\frac{F_y}{F_z}\) from \(F(x, y, z) = 0\), valid where the denominator partial is nonzero. Substituting back into \(s\) and \(t\) provides a built-in check.
Flashcards
Flashcard
dw/dt = w_x · dx/dt + w_y · dy/dt
Test your understanding
Question 1 of 5
For w = x²y with x = cos t and y = e^t, what is dw/dt at t = 0?
Question 2 of 5
A drone flies over terrain z = 100 − x² − 2y² with x′(t) = 1 and y′(t) = 2 m/s. How fast is the height below it changing above the point (1, 1)?
Question 3 of 5
If w = xy² with x = s + 2t and y = s − t, what is ∂w/∂s?
Question 4 of 5
For the curve y³ + xy − 2x³ = 0, what is dy/dx?
Question 5 of 5
On the sphere x² + y² + z² = 25, viewed with z as a function of x and y, what is z_x?
Standards: Beyond AP
