Chapter 4: Differentiation of Functions of Several Variables
4.5 The Chain Rule
Study guide for Calculus Volume 3 (Gilbert Strang, 2016 edition)
Independent study guide. Not affiliated with OpenStax or Rice University.
Big idea
The one-variable chain rule handled a single chain: $x$ moves, $u$ responds, $y$ responds to $u$, and the rates multiply. With several variables the picture branches. A quantity $z$ may depend on $x$ and $y$, and both of those may depend on a common variable $t$. Nudge $t$ and the effect reaches $z$ by two separate routes, one through $x$ and one through $y$. Rates still multiply along a route, and now the routes add.
That single sentence is the whole section. Multiply along a path, add over paths. Drawing the dependency as a tree, with $z$ at the root, its direct inputs on the next level and their inputs below, makes the bookkeeping mechanical: trace every path from the root down to the variable you are differentiating with respect to, multiply the derivatives you cross, and sum the results. The reason the routes add rather than compete is the linear approximation from the previous section: for small steps the changes contributed by $x$ and by $y$ simply add up, and the chain rule is that statement divided by the step in $t$.
The shapes worth having at your fingertips are two. One intermediate layer feeding a single parameter $t$ gives an ordinary derivative $dz/dt$, because once $t$ is the only free input, $z$ is a function of one variable. One intermediate layer feeding two parameters $u$ and $v$ gives partial derivatives $\partial z/\partial u$ and $\partial z/\partial v$, one tree traversal each. Everything else, including three intermediate variables or three layers, is the same idea with a bigger tree.
The payoff beyond composition is implicit differentiation. An equation such as $F(x,y) = 0$ defines $y$ as a function of $x$ without solving for it. Differentiating the equation with the chain rule and rearranging gives $dy/dx$ directly in terms of the partials of $F$, which replaces the term-by-term implicit differentiation you did in first-year calculus with a formula.
Decoder
If $z$ depends on the intermediate variables and each of those depends on the independent variables, then the rate of change of $z$ with respect to an independent variable is the sum, over all intermediate variables, of the rate of $z$ in that intermediate variable times the rate of that intermediate variable in the independent one.
The load-bearing word is “sum”. In one variable there was one path and so one product; here the paths are added because independent contributions to a small change combine additively. Miss a branch and your answer is simply incomplete, which is the most common error in the section and the reason the tree is worth drawing even when you think you can hold it in your head.
The second thing to watch is which letters are independent. In $\partial z/\partial u$ the variable $v$ is held fixed, and the intermediate variables $x$ and $y$ are not held fixed at all, since both move when $u$ moves. Writing $\partial z/\partial x$ on the left when you meant $\partial z/\partial u$ collapses the whole calculation.
Finally, notice that every factor must be evaluated at the matching point. In the one-parameter version, $\partial z/\partial x$ is a function of $x$ and $y$, and you substitute the formulas $x(t)$ and $y(t)$ into it before or after multiplying, but you do substitute. The derivative of the outer function is read at the value the inner functions produce, exactly as in one variable.
Definitions and results
One independent variable. If $z = f(x,y)$ is differentiable and $x = x(t)$, $y = y(t)$ are differentiable, then $z$ is a differentiable function of $t$ and
$$ \frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt} $$
The result is an ordinary derivative, so a straight $d$ appears on the left.
Two independent variables. If $z = f(x,y)$ with $x = x(u,v)$ and $y = y(u,v)$, then
$$ \frac{\partial z}{\partial u} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial u} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial u}, \qquad \frac{\partial z}{\partial v} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial v} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial v} $$
Each formula is one traversal of the same tree, ending at a different bottom variable.
More intermediate variables. With $w = f(x,y,z)$ and each of $x$, $y$, $z$ a function of $t$, the sum simply has three terms. The count of terms equals the count of intermediate variables, not the count of independent ones.
Tree diagram. Write the output at the top, draw an edge to each variable it directly depends on, and continue downward. Label each edge with the corresponding partial derivative. To differentiate with respect to a bottom variable, multiply the labels along each descending path to it and add the paths.
Implicit differentiation, one equation in two variables. If $F(x,y) = 0$ defines $y$ implicitly as a differentiable function of $x$, and $F_y \ne 0$, then
$$ \frac{dy}{dx} = -\frac{F_x}{F_y} $$
This comes from differentiating $F(x,y(x)) = 0$ with respect to $x$: the chain rule gives $F_x + F_y \, dy/dx = 0$.
Implicit differentiation, one equation in three variables. If $F(x,y,z) = 0$ defines $z$ implicitly as a function of $x$ and $y$, and $F_z \ne 0$, then
$$ \frac{\partial z}{\partial x} = -\frac{F_x}{F_z}, \qquad \frac{\partial z}{\partial y} = -\frac{F_y}{F_z} $$
Where the minus sign comes from. It is not a convention. Moving one term across the equal sign in $F_x + F_z\,\partial z/\partial x = 0$ produces it, and forgetting it flips every slope you compute.
Setting up $F$. To use these formulas on an equation like $x^3 + y^3 = 6xy$, first move everything to one side so the equation reads $F = 0$. Applying the formula to an unbalanced equation gives the wrong sign or the wrong partials.
Worked examples
One parameter, checked by substitution
Let $z = x^2 y$ with $x = 2t + 1$ and $y = t^3$. Find $dz/dt$ at $t = 1$.
The partials are $\partial z/\partial x = 2xy$ and $\partial z/\partial y = x^2$, and the parameter derivatives are $dx/dt = 2$ and $dy/dt = 3t^2$. The chain rule gives
$$ \frac{dz}{dt} = 2xy(2) + x^2(3t^2) = 4(2t+1)t^3 + 3t^2(2t+1)^2 $$
At $t = 1$, where $x = 3$ and $y = 1$, this is $4(3)(1) + 3(1)(9) = 12 + 27 = 39$.
Check by substituting first: $z = (2t+1)^2 t^3$, and the product rule gives $z' = 2(2t+1)(2)t^3 + (2t+1)^2(3t^2)$, which at $t = 1$ is $12 + 27 = 39$. Substitution is available here because the formulas are simple; the chain rule earns its keep when they are not, or when only the numerical values of the partials are known.
Two parameters through polar coordinates
Let $z = x^2 - y^2$ with $x = u\cos v$ and $y = u \sin v$. Find $\partial z/\partial u$ and $\partial z/\partial v$.
The partials of $z$ are $2x$ and $-2y$. The inner partials are $x_u = \cos v$, $x_v = -u\sin v$, $y_u = \sin v$, $y_v = u\cos v$. Assemble:
$$ \frac{\partial z}{\partial u} = 2x\cos v - 2y\sin v = 2u\cos^2 v - 2u \sin^2 v = 2u\cos 2v $$
$$ \frac{\partial z}{\partial v} = 2x(-u\sin v) - 2y(u\cos v) = -2u^2\cos v \sin v - 2u^2 \sin v\cos v = -2u^2\sin 2v $$
Check by substituting first: $z = u^2\cos^2 v - u^2\sin^2 v = u^2 \cos 2v$, so $\partial z/\partial u = 2u\cos 2v$ and $\partial z/\partial v = -2u^2 \sin 2v$. Both match, including the sign on the second, and the double-angle identities are what collapsed the intermediate expressions.
Implicit differentiation in two variables
The curve $x^3 + y^3 = 6xy$ passes through the point $(3,3)$, since $27 + 27 = 54$ and $6(9) = 54$. Find the slope of the curve there.
Write $F(x,y) = x^3 + y^3 - 6xy$, so the curve is $F = 0$. Then $F_x = 3x^2 - 6y$ and $F_y = 3y^2 - 6x$, and
$$ \frac{dy}{dx} = -\frac{3x^2 - 6y}{3y^2 - 6x} = \frac{2y - x^2}{y^2 - 2x} $$
At $(3,3)$ this is $(6 - 9)/(9 - 6) = -1$. The tangent line has slope $-1$, which matches the symmetry of the curve: swapping $x$ and $y$ leaves the equation unchanged, so the curve is symmetric across the line $y = x$. A tangent line at a point of that axis of symmetry is carried to itself by the reflection, so its slope can only be $1$ or $-1$, and the computation picks out $-1$.
A surface defined implicitly
The sphere $x^2 + y^2 + z^2 = 14$ contains the point $(1,2,3)$. Find $\partial z/\partial x$ and $\partial z/\partial y$ there.
Set $F = x^2 + y^2 + z^2 - 14$, so $F_x = 2x$, $F_y = 2y$ and $F_z = 2z$. Then
$$ \frac{\partial z}{\partial x} = -\frac{2x}{2z} = -\frac{x}{z}, \qquad \frac{\partial z}{\partial y} = -\frac{y}{z} $$
At $(1,2,3)$ these are $-1/3$ and $-2/3$.
Check by solving explicitly. Near this point $z = \sqrt{14 - x^2 - y^2}$, so
$$ \frac{\partial z}{\partial x} = \frac{-2x}{2\sqrt{14 - x^2 - y^2}} = -\frac{x}{z} $$
which is the same function. The implicit route avoided the square root and the sign question of which hemisphere you are on, and that advantage grows quickly with messier equations.
Practice
First the compositions. Identify the intermediate variables, draw the tree if the shape is not obvious, and assemble the products and sums.
Practice
Generated problems for this section, graded instantly.
Then the implicit versions. Move everything to one side to build $F$, compute its partials, and apply the formula with its minus sign.
Practice
Generated problems for this section, graded instantly.
Quiz
Five items on one-parameter and two-parameter chain rules, tree diagrams, and implicit differentiation in two and three variables.
Quiz
5 problems with a score at the end.