\documentclass[a4paper,12pt]{article}
\setlength\oddsidemargin{0pt} \setlength\evensidemargin{0pt}
\setlength\topmargin{0pt}
\begin{document}
\parindent=0pt
{\bf Exam Question

Topic: CriticalPoints}

Find and classify the critical points of the function
$$f(x,y)=y(x-2)^2+2x^2+y^2-8x-12y.$$ Calculate the value of the
function at each of the critical points. \vspace{0.5in}

{\bf Solution}

\begin{eqnarray*}
f(x,y)&=&y(x-2)^2+2x^2+y^2-8x-12y\\
f_x&=&2y(x-2)+4x-8=2(y+2)(x-2)\\ f_y&=&(x-2)^2+2y-12.\\
\mathrm{So}\ f_x&=&0\Rightarrow y=-2\ \mathrm{or}\ x=2.
\end{eqnarray*}

When $x=2,f_y=0\Rightarrow 2y-12=0;\ y=6.$

When $y=-2, f_y=0\Rightarrow (x-2)^2-4-12=0,$

giving $(x-2)^2=16;\ x=2\pm 4;\ x=6\ \mathrm{or}\ x=-2.$

So the critical points are $(2,6); (6,-2); (-2,-2).$

The second partial derivatives are given by $$f_{xx}=2y+4;\
f_{yy}=2;\ f_{xy}=2(x-2).$$ Classifying the critical points gives
\vspace{0.3in}

\begin{tabular}{|c|c|c|c|c|c|}
\hline
  &$2(x-2)$&$2y+4$&2&D&  \\
  \hline
 $(2,6)$&0&16&2&$-32<0$&MIN\\
 \hline
 $(6,-2)$&8&0&2&$64>0$&SADDLE\\
 \hline
 $(-2,-2)$&$-8$&0&2&$64>0$&SADDLE\\
 \hline
\end{tabular}

\end{document}
