## Section7.4The Chain Rule

Consider the surface $z=x^2y+xy^2\text{,}$ and suppose that $x=2+t^4$ and $y=1-t^3\text{.}$ We can think of the latter two equations as describing how $x$ and $y$ change relative to, say, time. Then

\begin{equation*} z=x^2y+xy^2=(2+t^4)^2(1-t^3)+(2+t^4)(1-t^3)^2 \end{equation*}

tells us explicitly how the $z$ coordinate of the corresponding point on the surface depends on $t\text{.}$ If we want to know $dz/dt$ we can compute it more or less directly, but it's actually a bit simpler to use Product and Chain Rules:

\begin{align*} {dz\over dt}\amp =x^2y'+2xx'y+x2yy'+x'y^2\\ \amp =(2xy+y^2)x'+(x^2+2xy)y'\\ \amp =(2(2+t^4)(1-t^3)+(1-t^3)^2)(4t^3)+((2+t^4)^2+2(2+t^4)(1-t^3))(-3t^2) \end{align*}

If we look carefully at the middle step, $dz/dt=(2xy+y^2)x'+(x^2+2xy)y'\text{,}$ we notice that $2xy+y^2$ is $\partial z/\partial x\text{,}$ and $x^2+2xy$ is $\partial z/\partial y\text{.}$ This turns out to be true in general, and gives us a new Chain Rule:

If $f$ is differentiable, then

\begin{equation*} \Delta z=f_x(x_0,y_0)\Delta x+f_y(x_0,y_0)\Delta y+\epsilon_1\Delta x + \epsilon_2\Delta y\text{,} \end{equation*}

where $\epsilon_1$ and $\epsilon_2$ approach 0 as $(x,y)$ approaches $(x_0,y_0)\text{.}$ Then

$${\Delta z\over\Delta t}= f_x{\Delta x\over\Delta t}+f_y{\Delta y\over\Delta t}+\epsilon_1{\Delta x\over\Delta t} + \epsilon_2{\Delta y\over\Delta t}\text{.}\label{eq_dz_over_dt}\tag{7.4.1}$$

As $\Delta t$ approaches 0, $(x,y)$ approaches $(x_0,y_0)$ and so

\begin{align*} \lim_{\Delta t\to0}{\Delta z\over\Delta t} \amp = {dz\over dt}\\ \lim_{\Delta t\to0}\epsilon_1{\Delta x\over\Delta t} \amp = 0\cdot{dx\over dt}\\ \lim_{\Delta t\to0}\epsilon_2{\Delta y\over\Delta t} \amp = 0\cdot{dy\over dt} \end{align*}

and so taking the limit of (7.4.1) as $\Delta t$ goes to 0 gives

\begin{equation*} {dz\over dt}= f_x{dx\over dt}+f_y{dy\over dt}\text{,} \end{equation*}

as desired.

We can write the Chain Rule in a way that is somewhat closer to the single variable Chain Rule:

\begin{equation*} {df\over dt}=\langle f_x,f_y\rangle\cdot\langle x',y'\rangle\text{,} \end{equation*}

or (roughly) the derivatives of the outside function “times” the derivatives of the inside functions. Not surprisingly, essentially the same Chain Rule works for functions of more than two variables, for example, given a function of three variables $f(x,y,z)\text{,}$ where each of $x\text{,}$ $y$ and $z$ is a function of $t\text{,}$

\begin{equation*} {df\over dt}=\langle f_x,f_y,f_z\rangle\cdot\langle x',y',z'\rangle\text{.} \end{equation*}

We can even extend the idea further. Suppose that $f(x,y)$ is a function and $x=g(s,t)$ and $y=h(s,t)$ are functions of two variables $s$ and $t\text{.}$ Then $f$ is “really” a function of $s$ and $t$ as well, and

\begin{equation*} {\partial f\over\partial s}=f_xg_s+f_yh_s\qquad {\partial f\over\partial t}=f_xg_t+f_yh_t\text{.} \end{equation*}

The natural extension of this to $f(x,y,z)$ works as well.

Recall that we used the ordinary Chain Rule to do implicit differentiation. We can do the same with the new Chain Rule.

###### Example7.36. Equation of a Sphere.

Find the partial derivative of $x^2+y^2+z^2 = 4\text{.}$

Solution

The equation $x^2+y^2+z^2 = 4$ defines a sphere, which is not a function of $x$ and $y\text{,}$ though it can be thought of as two functions, the top and bottom hemispheres. We can think of $z$ as one of these two functions, so really $z=z(x,y)\text{,}$ and we can think of $x$ and $y$ as particularly simple functions of $x$ and $y\text{,}$ and let $f(x,y,z)=x^2+y^2+z^2\text{.}$ Since $f(x,y,z)=4\text{,}$ $\partial f/\partial x=0\text{,}$ but using the Chain Rule:

\begin{align*} 0={\partial f\over\partial x}\amp =f_x{\partial x\over\partial x}+ f_y{\partial y\over\partial x}+f_z{\partial z\over \partial x}\\ \amp =(2x)(1)+(2y)(0)+(2z){\partial z\over\partial x}\text{,} \end{align*}

noting that since $y$ is temporarily held constant its derivative ${\partial y/\partial x}=0\text{.}$ Now we can solve for $\partial z/\partial x\text{:}$

\begin{equation*} {\partial z\over \partial x}=-{2x\over 2z}=-{x\over z}\text{.} \end{equation*}

In a similar manner we can compute $\partial z/\partial y\text{.}$

##### Exercises for Section 7.4.

Use the Chain Rule to compute the following.

1. $dz/dt$ for $z=\sin(x^2+y^2)\text{,}$ $x=t^2+3\text{,}$ $y=t^3$

$4xt\cos(x^2+y^2)+6yt^2\cos(x^2+y^2)$
2. $dz/dt$ for $z=x^2y\text{,}$ $x=\sin(t)\text{,}$ $y=t^2+1$

$2xy\cos t+2x^2t$
3. $\partial z/\partial s$ and $\partial z/\partial t$ for $z=x^2y\text{,}$ $x=\sin(st)\text{,}$ $y=t^2+s^2$

$2xyt\cos(st)+2x^2s\text{,}$ $2xys\cos(st)+2x^2t$
4. $\partial z/\partial s$ and $\partial z/\partial t$ for $z=x^2y^2\text{,}$ $x=st\text{,}$ $y=t^2-s^2$

$2xy^2t-4yx^2s\text{,}$ $2xy^2s+4yx^2t$
5. $\partial z/\partial x$ and $\partial z/\partial y$ for $2x^2+3y^2-2z^2=9$

$x/z\text{,}$ $3y/(2z)$
6. $\partial z/\partial x$ and $\partial z/\partial y$ for $2x^2+y^2+z^2=9$

$-2x/z\text{,}$ $-y/z$

Chemistry students will recognize the ideal gas law, given by $PV=nRT$ which relates the Pressure, Volume, and Temperature of $n$ moles of gas. (R is the ideal gas constant). Thus, we can view pressure, volume, and temperature as variables, each one dependent on the other two.

1. If pressure of a gas is increasing at a rate of $0.2 Pa/\hbox{min}$ and temperature is increasing at a rate of $1 K/\hbox{min}\text{,}$ how fast is the volume changing?

$\ds V'=(nR-0.2V)/P$
2. If the volume of a gas is decreasing at a rate of $0.3 L/\hbox{min}$ and temperature is increasing at a rate of $.5 K/\hbox{min}\text{,}$ how fast is the pressure changing?

$\ds P'=(nR+0.6P)/2V$
3. If the pressure of a gas is decreasing at a rate of $0.4 Pa/\hbox{min}$ and the volume is increasing at a rate of $3 L/\hbox{min}\text{,}$ how fast is the temperature changing?
$\ds T' = (3P-0.4V)/(nR)$
The previous exercise was a special case of the following fact, which you are to verify here: If $F(x,y,z)$ is a function of 3 variables, and the relation $F(x,y,z)=0$ defines each of the variables in terms of the other two, namely $x=f(y,z)\text{,}$ $y=g(x,z)$ and $z=h(x,y)\text{,}$ then