\section{Linear Approximation and Differentiability}
\begin{enumerate}[1.]
\item
{\it Let $f(x,y)=ye^{xy^2}$.

\medskip
\noindent
(a) Find the equation of the tangent plane to the graph of the function
$f(x,y)$ at the point $(x,y)=(0,2)$.}

\medskip

We compute
\begin{align*}
f(0,2) &= 2\cdot 1 = 2 
\\
f_1(x,y) &= y \cdot y^2 e^{xy^2} = y^3 e^{xy^2},\ \ f_x(0,2) =8,
\\
f_2(x,y) &= e^{xy^2} + y\cdot 2xy e^{xy^2} = (1+2xy^2) e^{xy^2}, \ \ f_y(0,2) = 1.
\end{align*}
Hence the equation of the tangent plane is 
$$
z=2+ 8(x-0) +(y-2) = 8x + y .
$$

\medskip\noindent
{\it (b) Use linear approximation at $(0,2)$ to give an approximate value of
$f(-0.2, 2.01)$.}

From (a), the linear approximation at $(0,2)$ is 
$$
L(x,y) =2+ 8(x-0) + (y-2) = 8x + y .
$$
Hence
$$
f(-0.2, 2.01) \approx L(-0.2, 2.01) = 2 + 8 (-0.2) + (0.01) 
=2-1.6 + .01 = 0.41
$$

\noindent
{\it (c) Find $f_{12}(x,y)$.}

\medskip

Differentiate $f_1$ in $y$:
\begin{align*}
f_{12}(x,y) &= \frac{\partial}{\partial y}  y^3 e^{xy^2}
\\
&= 3y^2 e^{xy^2} + y^3 \cdot 2xy e^{xy^2}
\\
&= (3y^2+2xy^4) e^{xy^2}.
\end{align*}



\item {\it Let $z = \frac{\sin (x)}{\cos(y)} = \sin (x) \sec (y)$.

\medskip
\noindent
(a) Find the general expression for the differential of $z (x,y)$ for $x$ and $y$ in the interval $[0, \frac{\pi}{2})$. 
}



\medskip

We first  calculate the first-order derivatives,
$$
\frac{\partial z}{\partial x} =  \cos (x) \sec (y), \quad \frac{\partial z}{\partial y} = \sin (x) \sec (y) \tan (y).
$$
Hence, the formula for our differential of $z$ is
$$
z(x,y) = \frac{\partial z}{\partial x} \, dx + \frac{\partial z}{\partial y} \, d y = \bigg[ \cos (x) \sec (y) \bigg] dx + \bigg[\sin (x) sec (y) \tan (y) \bigg] dy.
$$
\medskip

{\it
\medskip
\noindent
(b) Now, utilizing the differential calculated in Part (a),  approximate the value of the function at $(a,b) = (0.1,0.3)$ using a nearby point.}

\medskip
The nearest convenient point of approximation is $(0,0)$.  We calculate
$$
z(0,0) = 0, \quad \frac{\partial z}{\partial x} (0,0) = 1, \quad \frac{\partial z}{\partial y} (0,0) = 0.
$$
Hence, our linearization at $(0,0)$ is simply:
$$
L(x,y) (x,y) = z(0,0) + \frac{\partial z}{\partial x} (0,0) \cdot x + \frac{\partial z}{\partial y} (0,0) \cdot y = x,
$$
and so we take our approximation to be:
$$
z (0.1, 0.3) \approx L(0.1, 0.3) = 0.1
$$

{\it
\medskip
\noindent
(c) Rather than utilizing the the linearization formula from Lecture Notes 3.1, utilize first order Taylor approximation for $\sin$ and $\cos$ to give another estimation of the function at $(0.1,0.3)$.  Do your approximations agree?}

\medskip
Using single-variable first-order Taylor approximation for $x, y \approx y$, we have:
$$
\sin (x) \approx x, \quad \cos (y) \approx 1
$$
In particular, we see that:
$$
z(x,y) = \frac{\sin (x)}{\cos (y)} \approx x,
$$
which agrees with our previous approximation.

\medskip

\item{\it Suppose that $f(x,y)$ is a differentiable function of $x$ and $y$,  and that $ x = x(s,t)$ and $y = y(s,t)$ are themselves differentiable functions of $s,t$.

\medskip
\noindent
(a) Using the Multivariable Chain Rule (see \textit{Lecture Notes 2.6}), find a general formula for the linearization of $f(x(s,t), y(s,t))$ for $(s,t)$ near a point $(a,b)$ in terms of the first-order partial derivatives of the functions $f$, $x$ and $y$. 
}

\medskip
Let $x_0 = x(a,b)$ and $y_0 = y(a,b)$. The linearization of $f$ near a point $(s,t) = (a,b)$ then takes form
$$
L(s,t) : = f(x_0, y_0) + \frac{\partial f}{\partial s} (x_0,  y_0) (s - a) + \frac{\partial f}{\partial t} (x_0, y_0) (t - b).
$$
The multivariable chain rule states that
$$
\frac{\partial f}{\partial s} = \frac{\partial f}{\partial x} \frac{\partial x}{\partial s} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial s}
$$
$$
\frac{\partial f}{\partial t} = \frac{\partial f}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial t}.
$$
Hence, our (very long) formula for the linearization of $f$ then becomes
\begin{eqnarray*}
L(s,t) & = & f(x_0, y_0) + \bigg[\frac{\partial f}{\partial x} (x_0, y_0) \frac{\partial x}{\partial s} (a,b) + \frac{\partial f}{\partial y} (x_0, y_0) \frac{\partial y}{\partial s} (a,b) \bigg] (s - a) \\[2ex]
\quad & \quad & \quad + \bigg[\frac{\partial f}{\partial x} (x_0, y_0) \frac{\partial x}{\partial t} (a,b) + \frac{\partial f}{\partial y} (x_0, y_0) \frac{\partial y}{\partial t} (a,b) \bigg](t - b)
\end{eqnarray*}

\medskip
\begin{definition}
 A function $g (x,y)$ of two-variables is called \textbf{Lipschitz} if there exists a number $C > 0$ such that, given any pair of points $(x_0, y_0)$ and $(x_1,y_1)$ in $\mathbb{R}^2$, one has
$$
\big\vert g(x_1, y_1) - g(x_0, y_0) \big\vert \leq C \sqrt{(x_1 - x_0)^2 + (y_1 - y_0)^2}.
$$
The smallest value of $C > 0$ for which the above inequality holds is known as the \textbf{Lipschitz constant} of $g$.
\end{definition}

{\it
\medskip
\noindent
(b) Suppose that $f(x,y)$, $x(s,t)$ and $y(s,t)$ are all functions whose first-order partial derivatives are bounded by some number $M > 0$.  By \textbf{bounded}, we mean that:
$$
\big\vert \frac{\partial f}{\partial x} (x,y) \big\vert, \, \big\vert \frac{\partial f}{\partial y} (x,y) \big\vert \leq M, \textrm{ for every pair } (x,y) \in \mathbb{R}^2,
$$
$$
\big\vert \frac{\partial x}{\partial s} (s,t) \big\vert, \, \big\vert \frac{\partial x}{\partial t} (s,t) \big\vert , \,  \leq M, \textrm{ for every pair } (s,t) \in \mathbb{R}^2.
$$
$$
\big\vert \frac{\partial y}{\partial s} (s,t) \big\vert, \, \big\vert \frac{\partial y}{\partial t} (s,t) \big\vert , \,  \leq M, \textrm{ for every pair } (s,t) \in \mathbb{R}^2.
$$
Prove that for any $(a,b) \in \mathbb{R}^2$, the linearization of $f(x(s,t), y(s,t))$ for $(s,t)$ near $(a, b)$ is Lipschitz, with Lipschitz constant $C \leq 4 M^2$.

\medskip
\noindent
Hint: this is tricky! You will need four tools to prove this. They are (in order of likely use): the formula you obtained from Part (a.),  the triangle inequality (used twice), the bound on the first-order partial derivatives,  and the inequality 
$$|U| + |V| \leq 2 \max \{|U|, |V| \} \leq 2 \sqrt{|U|^2 + |V|^2},$$
which is valid for any two real numbers $U,V$ (prove this to yourself!)
}

\medskip
Let $(a,b)$ be given and again let $(x_0,y_0) : = (x(a,b), y(a,b))$.  To show that the linearization $L$ near $(a,b)$ is Lipschitz, we consider points $(s_0,t_0)$ and $(s_1, t_1)$, and prove that:
$$
\big\vert L(s_1, t_1) - L(s_0, t_0) \big\vert \leq 4M^2\sqrt{(s_1 -s_0)^2 + (t_1 - t_0)^2}.
$$
We first use the formula from Part (a.), which tells us that for any $(s,t) \in \mathbb{R}^2$
\begin{eqnarray*}
L(s,t) & = & f(x_0, y_0) + \underbrace{\bigg[\frac{\partial f}{\partial x} (x_0, y_0) \frac{\partial x}{\partial s} (a,b) + \frac{\partial f}{\partial y} (x_0, y_0) \frac{\partial y}{\partial s} (a,b) \bigg]}_{A_s} (s - a) \\[2ex]
\quad & \quad & \quad + \underbrace{\bigg[\frac{\partial f}{\partial x} (x_0, y_0) \frac{\partial x}{\partial t} (a,b) + \frac{\partial f}{\partial y} (x_0, y_0) \frac{\partial y}{\partial t} (a,b) \bigg]}_{A_t} (t - b),
\end{eqnarray*}
and notice that the terms $A_s$ and $A_t$ do not depend upon any of the variables $s,t,x$ or $y$! In particular, this means that:
\begin{eqnarray*}
\big\vert L(s_1, t_1) - L(s_0, t_0)  \big\vert & =  & \bigg\vert \bigg[f(x_0,y_0) + A_s (s_1 - a) + A_t (t_1 - b) \bigg]  \\
\quad & \quad & \quad \quad - \bigg[ f(x_0, y_0) + A_s (s_0 - a) + A_t (t_0 - b)  \bigg] \bigg\vert \\[1ex]
\quad & = & \big\vert A_s (s_1 - s_0) + A_t (t_1 - t_0) \big\vert.
\end{eqnarray*}
Now, use the triangle inequality for the first time, giving
\begin{equation}\label{eq:triangleinequality1}
\big\vert L(s_1, t_1) - L(s_0, t_0)  \big\vert \leq \vert A_s \vert \vert s_1 - s_0 \vert + \vert A_t \vert \vert t_1 - t_0 \vert.
\end{equation}
We now look at the terms $A_s$ and $A_t$, which involve the partial derivatives of $f(x,y)$, $x(s,t)$ and $y(s,t)$.  Using the triangle inequality again, we see that
\begin{eqnarray*}
\big\vert A_s \big\vert & \leq & \bigg\vert \frac{\partial f}{\partial x} (x_0, y_0) \frac{\partial x}{\partial s} (a,b) \bigg\vert + \bigg\vert \frac{\partial f}{\partial y} (x_0, y_0) \frac{\partial y}{\partial s} (a,b) \bigg\vert \\[1ex]
\quad & = & \bigg\vert \frac{\partial f}{\partial x} (x_0, y_0) \bigg\vert \, \bigg\vert \frac{\partial x}{\partial s} (a,b) \bigg\vert + \bigg\vert \frac{\partial f}{\partial y} (x_0, y_0) \bigg\vert \, \bigg\vert \frac{\partial y}{\partial s} (a,b) \bigg\vert \\[2ex]
\quad & \leq & 2 M^2,
\end{eqnarray*}
where, in the final inequality, we used the fact that all partial derivatives are uniformly bounded by the number $M > 0$. Substituting this estimate into inequality \eqref{eq:triangleinequality1} shows us that
$$
\big\vert L(s_1, t_1) - L(s_0, t_0)  \big\vert \leq 2M^2 \big(|s_1 -s_0| + \vert t_1 - t_0 \vert \big).
$$
We finish by bounding the sum by twice the maximum, which is bounded by square root of the sum of squares
$$
|s_1 -s_0| + \vert t_1 - t_0 \vert \leq 2 \max \{\cdots \} \leq 2 \sqrt{|s_1 - s_0|^2 + |t_1 - t_0|^2}
$$
Since this inequality holds for two arbitrary pairs $(s_1, t_1), (s_0,t_0) \in \mathbb{R}^2$, we have shown that $L(s,t)$ is Lipschitz with the appropriate constant.
\end{enumerate}
