Calculus – Functions of several variables – The chain rule
Recall the chain rule for a function of a single variable:
Theorem: If \(y=f(x)\) and \(x=g(t)\), where \(f\) and \(g\) are differentiable functions, then
\[\frac{dx}{dt}=\frac{dy}{dx}\cdot\frac{dx}{dt}.\]For functions of more than one variable, the chain rule appears in different versions depending on the number of variables.
The chain rule (case 1)
Theorem: If \(z=f(x,y)\) is a differentiable function of \(x\) and \(y\), where \(x=g(t)\) and \(y=h(t)\) are differentiable functions of \(t\), then
\[\frac{dz}{dt}=\frac{\partial z}{\partial x}\cdot\frac{dx}{dt}+\frac{\partial z}{\partial y}\cdot\frac{dy}{dt}.\]Note: compare with the (total) differential \(dz=\displaystyle\frac{\partial z}{\partial x}\,dx+\frac{\partial z}{\partial y}\,dy\).
Stewart §14.5, Example 1
If \(z=x^2y+3xy^4\), where \(x=\sin(2t)\) and \(y=\cos(t)\), find \(\displaystyle\frac{dz}{dt}\) when \(t=0\).
Solution: Note that \(\displaystyle\frac{\partial z}{\partial x}=2xy+3y^4\) and \(\displaystyle\frac{\partial z}{\partial y}=x^2+12xy^3\), so we have:
\[\frac{dz}{dt}=\frac{\partial z}{\partial x}\cdot\frac{dx}{dt}+\frac{\partial z}{\partial y}\cdot\frac{dy}{dt} =(2xy+3y^4)\cdot2\cos(2t)+(x^2+12xy^3)\cdot(-\sin(t)).\]For \(t=0\) we obtain: \(x=\sin(0)=0\) and \(y=\cos(0)=1\). Hence:
\[\frac{dz}{dt}\bigg|_{t=0}=(0+3)\cdot(2\cos(0))+(0+0)\cdot(-\sin(0))=6.\]The chain rule (case 2)
Theorem: If \(z=f(x,y)\) is a differentiable function of \(x\) and \(y\), where \(x=g(s,t)\) and \(y=h(s,t)\) are differentiable functions of \(s\) and \(t\), then
\[\frac{\partial z}{\partial s}=\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial s}+\frac{\partial z}{\partial y}\cdot\frac{\partial y}{\partial s} \quad\text{and}\quad \frac{\partial z}{\partial t}=\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial t}+\frac{\partial z}{\partial y}\cdot\frac{\partial y}{\partial t}.\]Stewart §14.5, Example 3
If \(z=e^x\sin(y)\), where \(x=st^2\) and \(y=s^2t\), find \(\displaystyle\frac{\partial z}{\partial s}\) and
\(\displaystyle\frac{\partial z}{\partial t}\).
Solution:
\[\frac{\partial z}{\partial s}=\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial s}+\frac{\partial z}{\partial y}\cdot\frac{\partial y}{\partial s} =e^x\sin(y)\cdot t^2+e^x\cos(y)\cdot2st=t^2e^{st^2}\sin(s^2t)+2ste^{st^2}\cos(s^2t)\]and
\[\frac{\partial z}{\partial t}=\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial t}+\frac{\partial z}{\partial y}\cdot\frac{\partial y}{\partial t} =e^x\sin(y)\cdot 2st+e^x\cos(y)\cdot s^2=2ste^{st^2}\sin(s^2t)+s^2e^{st^2}\cos(s^2t)\]The chain rule (the general version)
Theorem: If \(z=f(x_1,x_2,\ldots,x_n)\) is a differentiable function of \(x_1,x_2,\ldots,x_n\), where each \(x_i\) is a differentiable function of \(t_1,t_2,\ldots,t_m\), then
\[\frac{\partial z}{\partial t_i}=\frac{\partial z}{\partial x_1}\cdot\frac{\partial x_1}{\partial t_i} +\frac{\partial z}{\partial x_2}\cdot\frac{\partial x_2}{\partial t_i}+\cdots+\frac{\partial z}{\partial x_n}\cdot\frac{\partial x_n}{\partial t_i}\]for each \(i=1,2,\ldots,m\).
Stewart §14.5, Example 5
If \(u=x^4y+y^2z^3\), where \(x=rse^t\), \(y=rs^2e^{-t}\) and \(z=r^2s\sin(t)\), find the value of \(\displaystyle\frac{\partial u}{\partial s}\)
when \(r=2\), \(s=1\) and \(t=0\).
Solution: Note that
\[\frac{\partial u}{\partial s}=\frac{\partial u}{\partial x}\cdot\frac{\partial x}{\partial s}+\frac{\partial u}{\partial y}\cdot\frac{\partial y}{\partial s} +\frac{\partial u}{\partial z}\cdot\frac{\partial z}{\partial s}=4x^3y\cdot re^t+(x^4+2yz^3)\cdot2rse^{-t}+3y^2z^2\cdot r^2\sin(t).\]When \(r=2\), \(s=1\) and \(t=0\) we have \(x=2\), \(y=2\) and \(z=0\), so
\[\frac{\partial u}{\partial s}=64\cdot2+16\cdot4+0\cdot0=192.\]Implicit differentiation
If \(F(x,y)=0\) with \(y=f(x)\), then the chain rule implies that
\[\frac{\partial F}{\partial x}\cdot\frac{dx}{dx}+\frac{\partial F}{\partial y}\cdot\frac{dy}{dx}=0.\]Since \(\displaystyle\frac{dx}{dx}=1\), we obtain
\[\frac{dy}{dx}=-\frac{\displaystyle\frac{\partial F}{\partial x}}{\displaystyle\frac{\partial F}{\partial y}}=-\frac{F_x}{F_y},\]provided that \(F_y=\displaystyle\frac{\partial F}{\partial y}\neq0\).
Stewart §14.5, Example 8
Find \(y'=\displaystyle\frac{dy}{dx}\) if \(x^3+y^3=6xy\).
Solution: Note that the given equation can be written as
\[F(x,y)=x^3+y^3-6xy=0.\]Then we have:
\[y'=\frac{dy}{dx}=-\frac{F_x}{F_y}=-\frac{3x^2-6y}{3y^2-6x}=-\frac{x^2-y}{y^2-x}.\]If \(F(x,y,z)=0\) with \(z=f(x,y)\), then
\[\frac{\partial F}{\partial x}+\frac{\partial F}{\partial z}\cdot\frac{\partial z}{\partial x}=0\quad\text{and}\quad \frac{\partial F}{\partial y}+\frac{\partial F}{\partial z}\cdot\frac{\partial z}{\partial y}=0.\]Hence
\[\frac{\partial z}{\partial x}=-\frac{\displaystyle\frac{\partial F}{\partial x}}{\displaystyle\frac{\partial F}{\partial z}}=-\frac{F_x}{F_z} \quad\text{and}\quad \frac{\partial z}{\partial y}=-\frac{\displaystyle\frac{\partial F}{\partial y}}{\displaystyle\frac{\partial F}{\partial z}}=-\frac{F_y}{F_z},\]provided that \(F_z=\displaystyle\frac{\partial F}{\partial z}\neq0\).
Stewart §14.5, Example 9
Find \(\displaystyle\frac{\partial z}{\partial x}\) and \(\displaystyle\frac{\partial z}{\partial y}\) if \(x^3+y^3+z^3+6xyz=1\).
Solution: Let \(F(x,y,z)=x^3+y^3+z^3+6xyz-1\), then we have
\[\frac{\partial z}{\partial x}=-\frac{F_x}{F_z}=-\frac{3x^2+6yz}{3z^2+6xy}=-\frac{x^2+2yz}{z^2+2xy}\]and
\[\frac{\partial z}{\partial y}=-\frac{F_y}{F_z}=-\frac{3y^2+6xz}{3z^2+6xy}=-\frac{y^2+2xz}{z^2+2xy}.\]Last modified on September 17, 2021