Differentiation in several variables · Definition
Chain rule in several variables
Before you start you need to know
It lets you differentiate a function whose variables themselves depend on other variables, such as the temperature felt by an object moving across a hot plate.
Definition
The chain rule for \(z=f(x,y)\), with \(x=x(t)\) and \(y=y(t)\), gives the derivative of the composition as the sum of what each intermediate variable contributes: its partial of \(f\) times its own derivative.
With one variable, \((f\circ g)'=f'(g)\,g'\). With several, each intermediate variable is a path by which the parameter \(t\) reaches \(z\), and the contributions add up. A tree diagram helps: branches go from \(z\) to \(x\) and to \(y\), and from each one to \(t\); multiply the derivatives along each path and add the paths. With \(z=x^2y\), \(x=t\), \(y=t^2\) one gets \(2xy+x^2\cdot2t=4t^3\) after substituting, the same as differentiating \(z=t^4\).
If the intermediate variables depend on two parameters, \(x=x(s,t)\) and \(y=y(s,t)\), there are two formulas with partials: \(z_s=f_xx_s+f_yy_s\) and \(z_t=f_xx_t+f_yy_t\). In general there is one term per intermediate variable, and the formula holds for any number of variables.
In vector form, if \(\mathbf{r}(t)=\langle x(t),y(t)\rangle\), then \(\frac{d}{dt}f(\mathbf{r}(t))=\nabla f\cdot\mathbf{r}'(t)\). This is why the directional derivative uses the dot product with the gradient, and why, if \(f\) is constant along the curve, \(\nabla f\perp\mathbf{r}'\). The same idea gives implicit differentiation: from \(F(x,y)=0\) with \(y=y(x)\) we get \(\frac{dy}{dx}=-\frac{F_x}{F_y}\) if \(F_y\ne0\).
Typical errors are dropping a term, using \(y_t\) where \(y_s\) belongs, or evaluating the partials of \(f\) at the wrong point: \(f_x\) and \(f_y\) are evaluated at \((x(t),y(t))\). The rule requires \(f\) to be differentiable; the mere existence of the partials is not enough.
Think about it
A plate has temperature \(T(x,y)\) with \(T_x=2\), \(T_y=-1\) at the point where an ant is moving with velocity \(\langle3,2\rangle\). At what rate does the temperature it feels change?
\(\frac{dT}{dt}=T_xx'+T_yy'=2\cdot3+(-1)\cdot2=4\): the temperature rises by \(4\) units per unit of time.
Exercises 10
- Let \(z=x^2y\) with \(x=t\), \(y=t^2\). Compute \(\dfrac{dz}{dt}\) at \(t=1\).
- Let \(z=xy\) with \(x=\cos t\), \(y=\sin t\). Compute \(\dfrac{dz}{dt}\) at \(t=0\).
- Let \(z=e^{x+2y}\) with \(x=t^2\), \(y=t\). Compute \(\dfrac{dz}{dt}\) at \(t=0\).
- Let \(z=x^2+y^2\) with \(x=2t\), \(y=t+1\). Compute \(\dfrac{dz}{dt}\) at \(t=1\).
- Let \(z=\ln(x^2+y^2)\) with \(x=t\), \(y=2t\). Compute \(\dfrac{dz}{dt}\) at \(t=1\).
- Let \(z=x^2+xy\) with \(x=s+t\), \(y=st\). Compute \(\dfrac{\partial z}{\partial s}\) at \((s,t)=(1,2)\).
- With \(z=x^2+xy\), \(x=s+t\), \(y=st\), compute \(\dfrac{\partial z}{\partial t}\) at \((s,t)=(1,2)\).
- If \(w=f(x,y)\) with \(x=x(s,t)\), \(y=y(s,t)\), what is \(\dfrac{\partial w}{\partial s}\)?
- Let \(z=f(x,y)\) with \(f_x(1,1)=2\), \(f_y(1,1)=3\), \(x=t^2\), \(y=t^3\). Compute \(\dfrac{dz}{dt}\) at \(t=1\).
- On the curve \(f(x,y)=x^2+y^2=4\) we have \(y=y(x)\). Using the chain rule on \(0=\dfrac{d}{dx}f(x,y(x))\), find \(\dfrac{dy}{dx}\) at \((\sqrt2,\sqrt2)\).
References
- James Stewart, Daniel K. Clegg, Saleem Watson, Calculus: Early Transcendentals, 9th edition, Cengage, 2021. §14.5
- Joel Hass, Christopher Heil, Przemyslaw Bogacki, Maurice D. Weir, George B. Thomas Jr., Thomas' Calculus, 15th edition, Pearson, 2023. §14.4
- Jerrold E. Marsden, Anthony Tromba, Vector Calculus, 6th edition, W. H. Freeman, 2012. §2.5