Calculus 3Partial Derivatives

The Chain Rule for Several Variables

Add up the effects through every path of dependence.

Not started Jump to practice

Suppose the temperature at a point is $T(x, y)$ and you walk along a path $x(t)$, $y(t)$. How fast does the temperature you feel change? It changes because $x$ changes and because $y$ changes, and both effects add. This is the partial derivative version of the one-variable chain rule.

Key idea

If $z = f(x, y)$ with $x = x(t)$ and $y = y(t)$: $$\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}.$$ If $x$ and $y$ depend on $s$ and $t$, then $\frac{\partial z}{\partial s} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial s}$. In general: multiply along each path of a tree diagram and add over all paths.

Why it works

By the linear approximation, a small change gives $\Delta z \approx f_x\,\Delta x + f_y\,\Delta y$. Divide by $\Delta t$: $$\frac{\Delta z}{\Delta t} \approx f_x\frac{\Delta x}{\Delta t} + f_y\frac{\Delta y}{\Delta t}.$$ As $\Delta t \to 0$ the approximation becomes exact and each quotient becomes a derivative. Each term is one route by which $t$ influences $z$.

A tree diagram keeps track of the routes. Put $z$ at the top, the intermediate variables in the middle, and the independent variables at the bottom. Label each branch with its derivative. For $\frac{\partial z}{\partial s}$, follow every path from $z$ down to $s$, multiply the labels along it, and add.zxystst∂z/∂x∂z/∂y∂x/∂s∂x/∂t∂y/∂s∂y/∂t

Worked examples

Worked example: Along a path

Let $z = x^2y$ with $x = \cos t$, $y = \sin t$. Find $\frac{dz}{dt}$, and its value at $t = 0$.
  1. $\frac{\partial z}{\partial x} = 2xy$, $\frac{\partial z}{\partial y} = x^2$, $\frac{dx}{dt} = -\sin t$, $\frac{dy}{dt} = \cos t$.
  2. $$\frac{dz}{dt} = 2xy(-\sin t) + x^2\cos t = -2\cos t\sin^2 t + \cos^3 t.$$
  3. At $t = 0$: ${}0 + 1 = 1$. Check: $z(t) = \cos^2 t\sin t$, whose derivative at ${}0$ is also ${}1$.

Answer: $\frac{dz}{dt} = \cos^3 t - 2\cos t\sin^2 t$; it equals ${}1$ at $t = 0$

Worked example: Two independent variables

Let $z = x^2 + xy$ with $x = s + t$ and $y = st$. Find $\frac{\partial z}{\partial s}$ at $(s, t) = (1, 2)$.
  1. Paths to $s$: $z \to x \to s$ and $z \to y \to s$.
  2. $\frac{\partial z}{\partial x} = 2x + y$, $\frac{\partial x}{\partial s} = 1$, $\frac{\partial z}{\partial y} = x$, $\frac{\partial y}{\partial s} = t$.
  3. At $(1, 2)$: $x = 3$, $y = 2$, so $\frac{\partial z}{\partial s} = (6 + 2)(1) + 3(2) = 14$.

Answer: ${}14$

Worked example: Three intermediate variables

If $w = f(x, y, z)$ and $x$, $y$, $z$ are functions of $t$, write $\frac{dw}{dt}$.
  1. Three routes lead from $w$ to $t$, one through each intermediate variable.
  2. $\frac{dw}{dt} = \frac{\partial w}{\partial x}\frac{dx}{dt} + \frac{\partial w}{\partial y}\frac{dy}{dt} + \frac{\partial w}{\partial z}\frac{dz}{dt}$, which is $\nabla w \cdot \mathbf{r}'(t)$.

Answer: three terms, one per path

Common mistake

Leaving out a path. If $y$ also depends on $t$ but you write only $\frac{\partial z}{\partial x}\frac{dx}{dt}$, you have counted the change through $x$ and ignored the change through $y$. Draw the tree and count the paths from the top variable to the bottom one: that is the number of terms. Check with a direct substitution when the functions are simple.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax Calculus Volume 3, 4.5 The Chain Rule
@teddyrookbook GitHub