The Chain Rule

[b][size=150]Chain rule[/size][/b][br][br]There are several versions of chain rule that can help us computing the derivatives/partial derivatives of composition of functions that involve several variables.[br][br][br][u]Composition of a vector-valued function and a multivariable function[/u][br][br]Let [math]z=f(x,y)[/math] and [math]\vec{r}(t)=\langle x(t), y(t)\rangle[/math]. Then we consider their composition:[br][br][math]z(t)=f\circ \vec{r}(t)=f(x(t),y(t))[/math][br][br]Heuristically, we have[br][br][math]\Delta z \approx \frac{\partial z}{\partial x}\Delta x+\frac{\partial z}{\partial y}\Delta y[/math][br][math]\implies \frac{\Delta z}{\Delta t}\approx \frac{\partial z}{\partial x}\frac{\Delta x}{\Delta t}+\frac{\partial z}{\partial y}\frac{\Delta y}{\Delta t}[/math][br][br]As [math]\Delta t \to 0[/math], we have the following chain rule:[br][br][math]\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}[/math][br][br]([u]Note[/u]: After computing [math]\frac{\partial z}{\partial x}[/math] and [math]\frac{\partial z}{\partial y}[/math], you still need to substitute [math]x[/math] by [math]x(t)[/math] and [math]y[/math] by [math]y(t)[/math] in order to get the right hand side in terms of [math]t[/math] only.)[br][br][br]The three-variable version of the chain rule is similar. Let [math]w=g(x,y,z)[/math] and [math]\vec{s}(t)=\langle x(t),y(t),z(t)\rangle[/math]. Then we have[br][br][math]\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}[/math][br][br][br][u]Example[/u]: Let [math]z=f(x,y)=2x^2+4xy[/math] and [math]x(t)=t^2, \ y(t)=t^4[/math]. Find [math]\frac{dz}{dt}[/math].[br][br][u]Answer[/u]:[br][br]First of all, [math]\frac{dx}{dt}=2t[/math] and [math]\frac{dy}{dt}=4t^3[/math].[br][br]We also have [math]\frac{\partial z}{\partial x}=4x+4y[/math] and [math]\frac{\partial z}{\partial y}=4x[/math]. Then by chain rule, we have[br][br][math]\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}[/math][br][math]=(4x+4y)(2t)+(4x)(4t^3)=(4t^2+4t^4)(2t)+(4t^2)(4t^3)=8t^3+24t^5[/math][br][br]Alternatively, you can compute [math]\frac{dz}{dt}[/math] with using chain rule by first writing down [math]z(t)[/math] directly:[br][br][math]z(t)=f(x(t),y(t))=f(t^2,t^4)=2(t^2)^2+4(t^2)(t^4)=2t^4+4t^6[/math][br][br]Then we have [math]\frac{dz}{dt}=8t^3+24t^5[/math].[br][br]
[u]Exercise[/u]: Let [math]z=2\cos(x)\sin(xy)[/math] and [math]x=e^t, \ y=\ln t[/math]. Find [math]\frac{dz}{dt}[/math].[br]
The applet below visualizes the composition of [math]\vec{r}(t)=\langle x(t),y(t)\rangle[/math] and [math]f(x,y)[/math]. The point Q along the curve on the graph of [math]z=f(x,y)[/math] has coordinates [math](x(t),y(t),z(t))[/math]. And [math]\frac{dz}{dt}[/math] measures the rate of change of [math]z[/math] as the curve on the xy-plane, which is parametrized by [math]\vec{r}(t)[/math], is traversed.[br]
[u]Composition of functions of two variables[/u][br][br]Suppose [math]z=z(x,y)[/math] and [math]x=x(s,t), \ y=y(s,t)[/math]. Then we consider their composition:[br][br][math]z(s,t)=z(x(s,t),y(s,t))[/math][br][br]The following is the chain rule for [math]z(s,t)[/math]:[br][br][math]\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}[/math][br][br][math]\frac{\partial z}{\partial t}=\frac{\partial z}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial z}{\partial y}\frac{\partial y}{\partial t}[/math][br][br]The three-variable version of the above chain rule is similar. Let [math]w=w(x,y,z)[/math] and [math]x=x(s,t), \ y=y(s,t), \ z=z(s,t)[/math]. Then we have[br][br][math]\frac{\partial w}{\partial s}=\frac{\partial w}{\partial x}\frac{\partial x}{\partial s}+\frac{\partial w}{\partial y}\frac{\partial y}{\partial s}+\frac{\partial w}{\partial z}\frac{\partial z}{\partial s}[/math][br][br][math]\frac{\partial w}{\partial t}=\frac{\partial w}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial w}{\partial y}\frac{\partial y}{\partial t}+\frac{\partial w}{\partial z}\frac{\partial z}{\partial t}[/math][br][br][br][u]Example[/u]: Let [math]z(x,y)=e^{xy}[/math], [math]x(s,t)=2s+t[/math], and [math]y(s,t)=\frac st[/math]. Find [math]\frac{\partial z}{\partial s}[/math].[br][br][u]Answer[/u]:[br][br][math]\frac{\partial z}{\partial s}=ye^{xy}\cdot 2+xe^{xy}\cdot \frac 1t[/math][br][math]=\frac {2s}te^{(2s+t)\frac st}+(2s+t)e^{(2s+t)\frac st}\cdot \frac 1t=\frac 1t e^{(2s+t)\frac st}(4s+t)[/math][br][br][br][u]Example[/u]: Let [math]\phi[/math] be a constant. Suppose [math]w=x^2+y^2-z^2[/math] and [math]x=\rho\sin\phi\cos\theta, \ y=\rho\sin\phi\sin\theta, \ z=\rho\cos\phi[/math]. Find [math]\frac{\partial w}{\partial \rho}[/math] and [math]\frac{\partial w}{\partial \theta}[/math].[br][br][u]Answer[/u]:[br][br][math]\frac{\partial w}{\partial \rho}=2x\cdot \sin\phi\cos\theta+2y\cdot \sin\phi\sin\theta+(-2z)\cdot \cos\phi[/math][br][math]=2\rho\sin^2\phi\cos^2\theta+2\rho\sin^2\phi\sin^2\theta-2\rho\cos^2\phi[/math][br][math]=2\rho\sin^2\phi-2\rho\cos^2\phi=2\rho(\sin^2\phi-\cos^2\phi)[/math][br][br][math]\frac{\partial w}{\partial \theta}=2x(-\rho \sin\phi\sin\theta)+2y\cdot \rho\sin\phi\cos\theta+(-2z)\cdot 0[/math][br][math]=-2\rho^2\sin^2\phi\cos\theta\sin\theta+2\rho^2\sin^2\phi\cos\theta\sin\theta=0[/math][br][br][br]
[u]Exercise[/u]: Let [math]z=\sin(2x)\cos(3y)[/math] and [math]x=\frac{s+t}2, \ y=\frac{s-t}2[/math]. Find [math]\frac{\partial z}{\partial s}[/math] and [math]\frac{\partial z}{\partial t}[/math].[br]
[b][size=150]Implicit differentiation[/size][/b][br][br]We can use chain rule to derive the general formula for [math]\frac{dy}{dx}[/math] when [math]x[/math] and [math]y[/math] are related by the equation [math]F(x,y)=0[/math], where [math]F[/math] is a differentiable function of two variables. We let [math]x=t[/math] and [math]y=y(x)=y(t)[/math] i.e. [math]y[/math] is implicitly defined as a function of [math]x[/math]. Then we have[br][br][math]\frac{dF}{dt}=\frac{\partial F}{\partial x}\frac{dx}{dt}+\frac{\partial F}{\partial y}\frac{dy}{dt}=0[/math][br][br]Since [math]x=t[/math], [math]\frac{dx}{dt}=1[/math] and [math]\frac{dy}{dt}=\frac{dy}{dx}[/math]. Hence we have[br][br][math]\frac{\partial F}{\partial x}+\frac{\partial F}{\partial y}\frac{dy}{dx}=0[/math][br][math]\Rightarrow \ \frac{dy}{dx}=-\frac{\partial F}{\partial x} \bigg/ \frac{\partial F}{\partial y}=-\frac{F_x}{F_y}[/math][br][br][br][u]Example[/u]: Suppose [math]\sin xy+\pi y^2-x=0[/math]. Find [math]\frac{dy}{dx}[/math].[br][br][u]Answer[/u]:[br][br]Let [math]F(x,y)=\sin xy+\pi y^2-x[/math].[br][math]F_x=y\cos xy-1[/math] and [math]F_y=x\cos xy+2\pi y[/math].[br][br]By the above formula, we have [math]\frac{dy}{dx}=-\frac{y\cos xy-1}{x\cos xy+2\pi y}[/math].[br][br][br]
Close

Information: The Chain Rule