\section{The Chain Rule}
\begin{enumerate}[1.]
\item {\it 
Let $z=f(x,y)$, where $f(x,y)$ is $C^1$ for all $x,y$.
Suppose that $f_x(\sqrt{3},1)=3$ and $f_y(\sqrt{3},1)=5$. If we switch to
polar coordinates $r,\theta$ so that $x=r\cos\theta$, $y=r\sin\theta$, what is 
$\displaystyle \frac{\partial z}{\partial \theta }$ at $(r,\theta)=(2,\pi/6)$? 
(Hint: $\sin(\pi/6)=1/2$, $\cos(\pi/6)=\sqrt{3}/2$.)}


\bigskip

At  $(r,\theta)=(2,\pi/6)$, we have $x=2\cos(\pi/6)=\sqrt{3}$, $y=2\sin(\pi/6)=1$.
Also, at the same point,
$$
\frac{\partial x}{\partial \theta} = -r\sin\theta = -1,
\ \ 
\frac{\partial y}{\partial \theta} = r\cos\theta = \sqrt{3}.
$$
Therefore 
$$
\frac{\partial z}{\partial \theta} = \frac{\partial z}{\partial x} \frac{\partial x}{\partial \theta} 
+ \frac{\partial z}{\partial y} \frac{\partial y}{\partial \theta} 
= 3(-1) + 5 (\sqrt{3}) = 5\sqrt{3} -3.
$$

\bigskip


\item 
{\it Suppose that the temperature at a point with coordinates $(x,y,z)$ and at time $t$
is given by $T(x,y,z,t)= 20+ 3x - 2y + 4 z^2 + xye^{0.03t}$. At time $t=3$, a drone is at the point
$(5,2,1)$ and flies along a trajectory such that $x'(3)=7$, $y'(3)=2$, $z'(3)=-1$. What is the
rate of change of the temperature measured by the drone at $t=3$? }

\bigskip


We have 
\begin{align*}
T_x(x,y,z,t) & =3+ ye^{0.03t},\ \ T_x(5,2,1,3)=3+ 2e^{0.09},
\\
T_y(x,y,z,t) & =-2 + x e^{0.03t},\ \ T_y(5,2,1,3)=-2+ 5e^{0.09},
\\
T_z(x,y,z,t) & = 4z ,\ \ T_z(5,2,1,3)= 8,
\\
T_t(x,y,z,t) &=0.03 xye^{0.03t}, \ \ T_t(5,2,1,3)=10 \cdot 0.03 e^{0.09}= 0.3 e^{0.09}.
\end{align*}
Therefore at $t=3$, we have
\begin{align*}
\frac{dT}{dt} &= T_x (5,2,1,3) x'(3) + T_y (5,2,1,3) y'(3) + T_z (5,2,1,3) z'(3) + T_t (5,2,1,3) 
\\
&= (3  + 2e^{0.09}) \cdot 7 + (-2 + 5e^{0.09}) 
\cdot 2 + 8 (-1) + 0.3 e^{0.09}
\\
&= 21 -4-8+ ( 14+10+ 0.3 ) e^{0.09}= 9+ 24.3 e^{0.09}.
\end{align*}

\bigskip

\item 
{\it  Let $z=f(u,v)$, where $f(u,v)$ is $C^1$ for all $u,v$.
Let $u=xy$, $v=y/x$.

\smallskip

(a) Find $\displaystyle \frac{\partial z}{\partial x}$ and 
$\displaystyle \frac{\partial z}{\partial y}$ in terms of $f_1$ and $f_2$.}

\bigskip

We compute
\begin{align*}
\frac{\partial z}{\partial x} &= \frac{\partial z}{\partial u}\, \frac{\partial u}{\partial x}
+ \frac{\partial z}{\partial v}\, \frac{\partial v}{\partial x}
\\
&= f_1(xy,y/x) \cdot y + f_2(xy,y/x) \cdot \Big( -\frac{y}{x^2} \Big)
\\
\frac{\partial z}{\partial y} &= \frac{\partial z}{\partial u}\, \frac{\partial u}{\partial y}
+ \frac{\partial z}{\partial v}\, \frac{\partial v}{\partial y}
\\
&= f_1(xy,y/x) \cdot x + f_2(xy,y/x) \cdot \Big( \frac{1}{x} \Big)
\end{align*}

\bigskip

{\it (b) If $\displaystyle f_1\Big( -6,-\frac{3}{2}\Big) = 4$ and
$\displaystyle f_2\Big( -6,-\frac{3}{2}\Big) = -1$, find
$\displaystyle \frac{\partial z}{\partial x}$ and 
$\displaystyle \frac{\partial z}{\partial y}$ at $(x,y)=(-2,3)$.
}

\bigskip

For $(x,y)=(-2,3)$, we have $(u,v) = (xy,y/x) = ( -6,-\frac{3}{2})$, so that
\begin{align*}
\frac{\partial z}{\partial x} 
&= f_1( -6,-\frac{3}{2} ) \cdot 3 + f_2( -6,-\frac{3}{2}) \cdot  \Big(- \frac{3}{4} \Big)
= 4\cdot 3 + (-1) \cdot \Big( -\frac{3}{4} \Big)
\\
&= 12 + \frac{3}{4}=12.75
\\
\frac{\partial z}{\partial y} 
&= f_1( -6,-\frac{3}{2} ) \cdot (-2) + f_2( -6,-\frac{3}{2}) \cdot \Big( -\frac{1}{2} \Big)
= 4 \cdot (-2) + (-1) \cdot \Big( -\frac{1}{2} \Big)
\\
& = -8 + \frac{1}{2}=-7.5
\\
\end{align*}

\bigskip


\item {\it Suppose that a function $f(x,y)$ is defined everywhere in the plane and has continuous partial derivatives of all orders. Assume that $f(2,3)=2$, $f_1(2,3)=-1$, $f_2(2,3)=4$, $f_{11}(2,3)=0$, $f_{12}(2,3)=f_{21}(2,3)=3$, $f_{22}(2,3)=1$, Find 
$$ \frac{\partial }{\partial x} f(2x^2,x+y)\hbox{ and }
 \frac{\partial^2 }{\partial x^2} f(2x^2,x+y) \hbox{  at }(x,y)=(1,2).
 $$
 }
\bigskip


We start with 
$$
\frac{\partial }{\partial x} f(2x^2,x+y)= f_1(2x^2,x+y)\cdot(4x)+f_2(2x^2,x+y)\cdot 1.
$$
At $x=1,y=2$, we have $2x^2=2$, $x+y=3$, and
$$
\frac{\partial }{\partial x} f(2x^2,x+y)\Big|_{(x,y)=(1,2)}
= f_1(2,3)\cdot 4 +f_2(2,3 )\cdot 1 = -1\cdot 4 + 4 \cdot 1 = 0.
$$
Next, using Chain Rule again,
\begin{align*}
&\frac{\partial^2 }{\partial x^2} f(2x^2,x+y) 
= 
\frac{\partial }{\partial x}\Big( f_1(2x^2,x+y)\cdot(4x)\Big)
+ \frac{\partial }{\partial x} f_2(2x^2,x+y)\\
&\ \ = 
\Big ( f_{11}(2x^2,x+y)\cdot(4x) + f_{12}(2x^2,x+y)\cdot 1 \Big)(4x)
+  f_{1}(2x^2,x+y) \cdot 4
\\
&\ \ + 
f_{21}(2x^2,x+y)\cdot(4x)+f_{22}(2x^2,x+y)\cdot 1.
\end{align*}
Therefore
\begin{align*}
&\frac{\partial^2 }{\partial x^2} f(2x^2,x+y)\Big|_{(x,y)=(1,2)}
=
\Big ( f_{11}(2,3)\cdot 4 + f_{12}(2,3)\Big)\cdot 4
\\
&\ \ + f_{1}(2,3)\cdot 4
+ f_{21}(2,3 )\cdot 4 +f_{22}(2,3 )\\
&\ \ 
=
( 0\cdot 4 + 3)\cdot 4 + ( -1) \cdot 4
+ 3\cdot 4 +1\\
&\ \ =12-4+12+1=21.
\end{align*}
\end{enumerate}
