\section{Critical Points}
\begin{enumerate}[1.]
\item {\it Let $\displaystyle f(x,y)=\frac{y}{x} + \frac{1}{y} +x$.

(a)
This function has exactly one critical point. Find it.}

\medskip

We have 
$$
f_1(x,y)=-\frac{y}{x^2}+1,\ \ f_2(x,y)=\frac{1}{x}-\frac{1}{y^2}.
$$
For $f_1=f_2=0$, we need $1=y/x^2$, so that $y=x^2$, and $\frac{1}{x}=\frac{1}{y^2}$,
so that 
$$x=y^2=(x^2)^2=x^4.$$
 We cannot have $x=0$ since then $f$ would not be defined, so
we must have $x^3=1$, $x=1$, and $y=1^2=1$. The critical point is at $(1,1)$.

\medskip

{\it (b)
Find the second order Taylor polynomial of $f(x,y)$ at the critical point found in (a).}

\medskip
We have $f(1,1)=1+1+1=3$, and
$$
f_{11}(x,y)=\frac{2y}{x^3},\ \ 
f_{12}(x,y)=f_{21}(x,y)=-\frac{1}{x^2},\ \ 
f_{22}(x,y)=\frac{2}{y^3}.
$$
Therefore $f_{11}(1,1)=2$, $f_{12}(1,1)=f_{21}(1,1)=-1$, and $f_{22}(1,1)=2$.
The Taylor polynomial is
$$
p_2(x,y)=3+\frac{1}{2}\Big( 2(x-1)^2 - 2 (x-1)(y-1) + 2(y-1)^2 \Big).
$$

\medskip

{\it (c) Does $f(x,y)$ have a minimum, maximum, or a saddle point at this critical point?}

\medskip

We check the minors of the Hessian matrix:
$$
\left| \begin{matrix}
2 & -1 \\
-1 & 2 \\      
            \end{matrix}\right|  = 4-1=3>0,\ \ f_{11}(1,1)=2>0,
 $$
 so by the second derivative test, $f$ has a local minimum at $(1,1)$.         

\bigskip
         

\item {\it Let $\displaystyle f(x,y)=x^3 + 3 x^2y -y -y^3$. Find all critical points of $f$ and classify them as local minima,
maxima, or saddle points.}

\medskip

We have 
$$
f_1(x,y)=3x^2+6xy, \ \ f_2(x,y)=3x^2 -1 -3y^2.
$$
We look for points with $f_1=f_2=0$.
If
$f_1=3x^2+6xy=3x(x+2y)=0$, then $x=0$ or $x=-2y$. If $x=0$, then from $f_2=0$ we get
$3x^2-1-3y^2 = -1-3y^2=0$, so that $3y^2=-1$, which is not possible. Therefore $x=-2y$.
From $f_2=0$, we then get
$$3x^2-1-3y^2 = 12y^2-1-3y^2=9y^2-1=0,$$
 so that $y=\pm\frac{1}{3}$.
This corresponds to two critical points, 
$(-\frac{2}{3}, \frac{1}{3})$ and  $(\frac{2}{3}, -\frac{1}{3})$.

\medskip

The second order partials are $f_{11}(x,y)=6x+6y$, $f_{12}(x,y)=f_{21}(x,y)=6x$, $f_{22}(x,y)=-6y$.

\medskip

\begin{itemize}

\item At $(-\frac{2}{3}, \frac{1}{3})$,
$$
\left| \begin{matrix}
-2 & -4 \\
-4 & - 2 \\      
            \end{matrix}\right|  = 4 -16<0,\ \ 
 $$
 and $-2<0$, so by the second derivative test, $f$ has a saddle point.    
 
 \medskip
 
\item At $(\frac{2}{3}, -\frac{1}{3})$
$$
\left| \begin{matrix}
2 & 4 \\
4 & 2 \\      
            \end{matrix}\right|  = 4 -16<0,\ \ 
 $$
 and $2>0$, so by the second derivative test, $f$ has a saddle point.      
 
 
\end{itemize}

\bigskip


\item {\it Let $\displaystyle f(x,y)=x^4-4xy+y^2$. Find all critical points of $f$ and classify them as local minima,
maxima, or saddle points.}

\bigskip

We have 
$$
f_1(x,y)=4x^3 - 4y, \ \ f_2(x,y)=-4x + 2y.
$$
For $f_1=f_2=0$, we need $y=2x$ and $4x^3=4y=8x$, $x^3=2x$, so that $x=0$ or $x=\pm\sqrt{2}$.
This corresponds to three critical points $(0,0)$, $(\sqrt{2},2\sqrt{2})$, $(-\sqrt{2},-2\sqrt{2})$.

\smallskip

The second order partials are $f_{11}(x,y)=12x^2$, $f_{12}(x,y)=f_{21}(x,y)=-4$, $f_{22}(x,y)=2$.

\medskip

\begin{itemize}

\item At $(0,0)$,
$$
\left| \begin{matrix}
0 & -4 \\
-4 & 2 \\      
            \end{matrix}\right|  = -16<0,\ \ 
 $$
and $f_{11}=0$, so by the second derivative test, $f$ has a saddle point.    
 
 \medskip
 
\item At $(\sqrt{2},2\sqrt{2})$ and $(-\sqrt{2},-2\sqrt{2})$,
$$
\left| \begin{matrix}
24 & -4 \\
-4 & 2 \\      
            \end{matrix}\right|  = 48 -16>0,\ \ f_{11}=24>0
 $$
and $f_{11}>0$, so by the second derivative test, $f$ has local minima at these points.      
 
 
  

\end{itemize}



\bigskip

\item {\it Let $\displaystyle f(x,y)=x^3-3x^2y+xy-y^2$. Do there exist constants $A,B$ such that the function 
$g(x,y)=f(x,y)-Ax-By$ has a local minimum or maximum at $(1,2)$? If so, find all such $A$ and $B$.
If no, explain why.}


\medskip


Suppose that such $A,B$ exist. Then $g(x,y)$ has a critical point at $(1,2)$. We have
\begin{align*}
g_1(x,y)&=3x^2 -6xy+y-A, \ \ g_1(1,2) = 3-12+2-A = -7-A,
\\
g_2(x,y)& =-3x^2+x-2y-B,\ \ g_2(1,2)=-3+1-4-B = -6-B.
\end{align*}
If $g_1(1,2)=g_2(1,2)=0$, then $A=-7$ and $B=-6$, and these are the only possible values of $A$ and $B$.

\smallskip

Let us now check what type of a critical point this is. 
The second order partials are 
\begin{align*}
g_{11}(x,y)&=6x-6y,\\
g_{12}(x,y) & =g_{21}(x,y)=-6x+1,
\\
g_{22}(x,y)& =-2.
\end{align*}
 At $(1,2)$, $g_{11}(1,2)=-6$ and $g_{12}(1,2)=-5$. We have
$$
\left| \begin{matrix}
-6 & -5 \\
-5 & -2 \\      
            \end{matrix}\right|  = 12-25 <0,\ \ 
 $$
 and $-6< 0$, so by the second derivative test, $g$ has a saddle point.   
Therefore there are no constants $A,B$ such that 
$g(x,y)$ has a local minimum or maximum at $(1,2)$.

\bigskip


%%%%%%%%%%%%%%%%%%%%%%%%



\item{\it Let $f(x,y,z) = x^2 -2x + 2 y^2 + 3 z^2$. 

\smallskip

(a) This function has one critical point.  Find it and classify it.
}

\medskip
The gradient of $f$ is
$$
\nabla f (x,y,z) = (2x-2) \mathbf{i} + 4y \mathbf{j} + 6z \mathbf{k}.
$$
We see that $\nabla f (x,y,z) = \mathbf{0}$ if and only if $x=1$ and $y=z=0$.  So, $f$ has a critical point at $(x,y,z) = (1,0,0)$, and this is the only critical point.

\smallskip

To classify this critical point,  we will evaluate the principal minors of the Hessian matrix of $f$.  For this function $f(x,y,z)$,  our evaluation is simplified once we first notice that $f_{ij} = 0$ whenever $i \neq j$ (for $i,j = 1,2,3$).  Another way of explaining this simplification is to observe that the Hessian matrix $\mathscr{H} f (x,y,z)$ is a diagonal matrix at all points $(x,y,z)$.

Using this observation, the  principal minors are
$$
D_1 (x,y,z) : = f_{11} (x,y,z) = 2,
$$
\smallskip
$$
D_2 (x,y,z) : =
\begin{vmatrix}
f_{11} & 0 \\
0 & f_{22} 
\end{vmatrix}
=
\begin{vmatrix}
2 & 0 \\
0 & 4
\end{vmatrix}
=8,
$$
\medskip
$$
D_3 (x,y,z) : =
\begin{vmatrix}
f_{11} & 0 & 0 \\
0 & f_{22} & 0 \\
0 & 0 & f_{33}
\end{vmatrix}
=
\begin{vmatrix}
2 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 8
\end{vmatrix}
=
48.
$$
\smallskip


All three principal minors $D_1, D_2,$ and $D_3$ are positive constant functions. In particular, we see that the origin is a minimum of the function $f$.

\medskip

{\it (b) Why can we conclude that the critical point from part (a) is, in fact, a \underline{global} minimum?}

\medskip

This follows from a direct evaluation of the function.  Since $t^2 \geq 0$ for every real number $t$, we see that
$$
f(x,y,z) = (x-1)^2 -1 + 2 y^2 + 3 z^2 \geq (0)^2 -1 + 2 (0)^2 + 3 (0)^2 = -1,
$$
and $f(1,0,0)=-1$. Therefore $f(x,y,z) \geq f(1,0,0)$ for every point $(x,y,z)$, so that $f$ has a global minimum at $(1,0,0)$,

\medskip

\item{\it Let $f(x,y,z) = x^2 y^2 \sin (z)$.

\smallskip

(a) Determine all critical points of the function $f(x,y,z)$. 
}


\medskip

All critical points of $f$ must satisfy the equation $\nabla f(x,y,z) = (0,0,0)$.
This corresponds to the following system of equations
\begin{eqnarray*}
2x y^2 \sin (z) & = & 0 \\[1ex]
2 x^2 y \sin (z) & = & 0 \\[1ex]
x^2 y^2 \cos (z) & = & 0
\end{eqnarray*}
Clearly, then, if $(x_0,y_0,z_0)$ is any point satisfying $x_0 = 0$ or $y_0 = 0 $, then $\nabla f (x_0, y_0, z_0) = (0,0,0)$.  Hence,  all points contained in both sets $C_1 : = \{(x,y,z) : x = 0 \}$ and $C_2 = \{(x,y,z) : y = 0 \}$ are critical points of $f$.  

Now, suppose that $(x_0, y_0, z_0)$ is such that $x_0$ and $y_0$ are both nonzero. This is just another way of saying that $(x_0,y_0,z_0)$ is \textit{not} an element of either $C_1$ or $C_2$.   If it were true that $\nabla f (x_0, y_0, z_0) = (0,0,0)$ for such a point $(x_0, y_0, z_0)$,  the above system of equations would then imply that $\sin (z_0) = \cos (z_0) = 0$. But this is impossible! Hence, the set $C = C_1 \cup C_2$ contains all of the critical points of $f$.
\medskip

{\it (b) Calculate the Hessian matrix $\mathscr{H} (x,y,z)$ for an arbitrary point $(x,y,z)$.  }

\medskip

We apply the formula from Section 1.2 of Lecture Notes 4.1:
$$
\mathscr{H} (x,y,z) : =
\begin{vmatrix}
f_{11}  & f_{12}  &f_{13} \\[1ex]
f_{21}  & f_{22} &f_{23} \\[1ex]
f_{31} & f_{32} & f_{33}
\end{vmatrix}
=
\begin{vmatrix}
2 y^2 \sin (z) & 4 x y \sin (z)& 2xy^2 \cos(z) \\[1ex]
4 x y \sin (z) & 2 x^2 \sin (z) & 2x^2y\cos(z) \\[1ex]
2xy^2\cos (z) & 2x^2y\cos(z) & -x^2y^2\sin(z)
\end{vmatrix}
$$


\medskip

{\it (c) Based on your answers to (a) and (b), explain why the second-order
test must necessarily fail at all critical points of this function.  
}

\medskip
From (a), we know that critical points $(x,y,z)$ of $f$ must satisfy $x = 0$ or $y = 0$.  Using our formula from (b), we see that at any such point we have
$$
\mathscr{H} (x,y,z) 
=
\begin{vmatrix}
2 y^2 \sin (z) & 0& 0 \\[1ex]
0& 2 x^2 \sin (z) & 0 \\[1ex]
0& 0& 0
\end{vmatrix}
$$
which has determinant 0. The second derivative test is thus \textit{inconclusive} at all critical points of the function $f$.


\bigskip




\item {\it 
Let $f(x,y)$ be a function defined for all $(x,y)\in\rr^2$. Assume that $f$ and all its partial derivatives of all orders are continuous everywhere in the plane. Assume also that the second order Taylor polynomial of $f$ at $(a,b)=(0,0)$ is
$$
p_2(x,y)=2x^2+3y^2,
$$
and that the error $f(x,y)-p_2(x,y)$ satisfies
$$
\lim_{(x,y)\to (0,0)} \frac{f(x,y)-p_2(x,y)}{x^2+y^2}=0.
$$
Prove that $f$ has a local minimum at $(0,0)$. }


\medskip

We start with $f(0,0)=p_2(0,0)=0$. 
Next, by the $\epsilon-\delta$ definition of the limit with $\epsilon=1$, there is a $\delta>0$ such that for all $(x,y)$ with $0<\sqrt{x^2+y^2}<\delta$,
$$
\left| \frac{f(x,y)-p_2(x,y)}{x^2+y^2}\right| <1.
$$
We rewrite this as $|f(x,y)-p_2(x,y)|<x^2+y^2$, or equivalently,
$$
p_2(x,y)-(x^2+y^2) < f(x,y) < p_2(x,y)+ (x^2+y^2).
$$
The first inequality tells us that, for $(x,y)$ as above, we have 
$$
f(x,y)>(2x^2+3y^2)- (x^2+y^2)=x^2+2y^2>0 = f(0,0).
$$
Therefore $f(x,y)\geq f(0,0)$ for all $(x,y)$ in the $\delta$-neighbourhood of $(0,0)$, meaning that $f$ has a local minimum at $(0,0)$.






\bigskip



\item {\it 
Let $f(x,y)$ be a function defined for all $(x,y)\in\rr^2$. Assume that $f$ and all its partial derivatives of all orders are continuous everywhere in the plane. Assume also that 
$$
f(x,y)=x^4-2y^4+g(x,y),
$$
where the function $g(x,y)$ satisfies $g(0,0)=0$ and 
$$
\lim_{(x,y)\to (0,0)} \frac{g(x,y)}{x^4+y^4}=0.
$$
Prove that $f$ does not have a local minimum or maximum at $(0,0)$. }


\medskip

We start with $f(0,0)=p_2(0,0)=0$. 
Next, by the $\epsilon-\delta$ definition of the limit with $\epsilon=1/2$, there is a $\delta>0$ such that for all $(x,y)$ with $0<\sqrt{x^2+y^2}<\delta$,
$$
\left| \frac{g(x,y)}{x^4+y^4}\right| <\frac{1}{2}.
$$
We rewrite this as $|g(x,y) |<\frac{1}{2}(x^4+y^4)$.

Consider first what happens when $y=0$ but $x\neq 0$. Then
$$
f(x,0)= x^4 + g(x,0) \geq x^4-\frac{x^4}{2} = \frac{x^4}{2}>0=f(0,0),
$$
so that in any neighbourhood of $(0,0)$ there are points $(x,0)$ where $f(x,0)>f(0,0)$.

Now consider what happens when $x=0$ but $y\neq 0$. Then
$$
f(x,0)= -2y ^4 + g(0,y ) \leq -2y^4+ \frac{y^4}{2} = -\frac{3y^4}{2}<0=f(0,0),
$$
so that in any neighbourhood of $(0,0)$ there are also points $(0,y)$ where $f(0,y )<f(0,0)$. Hence, there is no local minimum
or maximum at $(0,0)$.








\end{enumerate}

