\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\usepackage{ifthen}
\usepackage{ulem} % for strikethrough \sout{...} command
\usepackage{color}


% PGFPlots and Tikz
\usepackage{pgfplots}
%\pgfplotsset{compat=1.12}
\usepackage{tikz}

\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\setlength{\topmargin}{-0.25in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.75in}
\setlength{\textwidth}{7in}

\newcommand{\bdot}{\, {\scriptstyle{\bullet}} \,}
\newcommand{\B}[1]{{\bf {#1}}}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}

\newcommand{\myspace}{\parbox[c][0.25in]{0.25in}{\hfill}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\force}{{\noindent $\mbox{\;}$}}

\begin{document}

\pagestyle{empty}

\noindent
\parbox{2in}{\bf Math 2130}
\hfill {\Large \bf Test \#2} \hfill
\parbox{2in}{\bf \hfill June ${\bf 17}^\mathrm{\bf th}$, 2019}

\vspace{0.3in}

\noindent {\large\bf Name:} \underline{\hskip 3.0 truein}
\hfill {\bf Be sure to show your work!}

\vspace{0.1in}

\noindent
If $F(x,y)=C$, then 
$\displaystyle{ \frac{d y}{d x} = - \frac{F_x}{F_y}}$ \hfill \hfill
If $F(x,y,z)=C$, then 
$\displaystyle{ \frac{\partial z}{\partial x} = - \frac{F_x}{F_z}}$ and
$\displaystyle{ \frac{\partial z}{\partial y} = - \frac{F_y}{F_z}}$

\vspace{0.1in}

\noindent {\bf \large 1. (12 points)} Three level curve plots are shown below. I have labeled the levels so you know which curves are higher and which are lower.

\force \hfill
\begin{tikzpicture}[scale=0.8]
  \begin{axis}[
      axis x line=middle, 
      axis y line=middle, 
      axis equal,
      xlabel = {},  ylabel = {},
      xtick={0}, ytick={0},
      restrict y to domain = -1:1,
      restrict x to domain = -1:1,
      color=black!30
    ]
    \foreach \C in {-6,...,3}
       \addplot [domain = -1:1, samples = 300, color=black] ({x^2+\C/4}, {x});
    
    \node[fill=white] at (axis cs: -0.75,-0.85) {\color{red}\bf lower};
    \node[fill=white] at (axis cs: 0.75,0.85) {\color{red}\bf higher};
    
    \draw[red,fill=red,ultra thick] (axis cs:-0.25,0) circle [radius=3pt];
    \node[below left] at (axis cs:-0.25,0) {\color{red}\bf A};
  \end{axis}
\end{tikzpicture}
\hfill
\begin{tikzpicture}[scale=0.8]
  \begin{axis}[
      axis x line=middle, 
      axis y line=middle, 
      axis equal,
      xlabel = {},  ylabel = {},
      xtick={0}, ytick={0},
      restrict y to domain = -1:1,
      restrict x to domain = -1:1,
      color=black!30
    ]
    \foreach \C in {1,...,10}
       \addplot [domain = 0:360, samples = 300, color=black] ({2*sqrt(\C)*0.2*cos(x)}, {3*sqrt(\C)*0.2*sin(x)});
    
    \node[fill=white] at (axis cs: 0.25,-0.45) {\color{red}\bf lower};
    \node[fill=white] at (axis cs: 0.75,-0.85) {\color{red}\bf higher};
    
    \draw[red,fill=red,ultra thick] (axis cs:-0.28,0.425) circle [radius=3pt];
    \node[below right] at (axis cs:-0.28,0.425) {\color{red}\bf B};
  \end{axis}
\end{tikzpicture}
\hfill
\begin{tikzpicture}[scale=0.8]
  \begin{axis}[
      axis x line=middle, 
      axis y line=middle, 
      axis equal,
      xlabel = {},  ylabel = {},
      xtick={0}, ytick={0},
      restrict y to domain = -1:1,
      restrict x to domain = -1:1,
      color=black!30
    ]
    \foreach \C in {-5,...,5}
       \addplot [domain = -1:1, samples = 300, color=black] ({x}, {-2*x^3+\C/2-0.15});
    
    \node[fill=white] at (axis cs: -0.5,-0.85) {\color{red}\bf lower};
    \node[fill=white] at (axis cs: 0.5,0.85) {\color{red}\bf higher};
    
    \draw[red,fill=red,ultra thick] (axis cs:0.25,-0.175) circle [radius=3pt];
    \node[below left] at (axis cs:0.25,-0.175) {\color{red}\bf C};
  \end{axis}
\end{tikzpicture}
\hfill \force
  
\noindent  
\force \hfill 
\fbox{\varspace{0.4in}{1.65in}}  
\hfill \quad
\fbox{\varspace{0.4in}{1.65in}}
\hfill \quad
\fbox{\varspace{0.4in}{1.65in}}
\hfill \force
  
\begin{enumerate}[(a)]
   \item The plots above correspond to 3 of the 5 functions listed here: $f(x,y)=x^2/2+y^2/3$, $f(x,y)=x^2+y^2$, $f(x,y)=2x^3+y$, $f(x,y)=y-x^2$, and $f(x,y)=x-y^2$. Write the correct formula below each plot.
   \item Sketch a gradient vector at the points A, B, and C. If the vector is $\B 0$ or does not exist, draw an ``X'' on the point.\\ {}[Don't worry about having the correct length. I'm just looking for the correct direction.] 
\end{enumerate}

\vspace{0.05in}

\noindent {\bf \large 2. (8 points)} Let $w=f(x,y,z)$, $x=g(u,v)$, $y=h(u,v)$, and $z=\ell(u,v)$. \quad State the chain rule for $\dfrac{\partial w}{\partial u}$.

\vfill


\noindent {\bf \large 3. (9 points)} Suppose we have a function $f(x,y)$ where $\nabla f(x,y)$ exists everywhere.

\begin{enumerate}[(a)]

\item It is possible for $f_{xy}(2,3)=4$ and $f_{yx}(2,3)=5$? If not, why not? If so, what does this tell us?

\vspace{1in}

\item Can I conclude $f(x,y)$ is differentiable? \qquad {\Large\bf YES \quad / \quad NO}

\vspace{0.3in}

\item Can I conclude that $f(x,y)$ is continuous? \qquad {\Large\bf YES \quad / \quad NO}

\vspace{0.3in}

\end{enumerate}

\newpage


\noindent {\bf\large 4. (10 points)} Limits and continuity.

\begin{enumerate}[(a)]
\item Where is the function $f(x,y)=\ln(x^2+y^2)$ continuous?
%\item Where is the function $f(x,y)=\sqrt{1-x^2-y^2}$ continuous?

\vfill

\item Show that $\displaystyle \lim\limits_{(x,y) \to (0,0)} \dfrac{2xy}{x^2+y^2}$ does not exist. 
%\item Show that $\displaystyle \lim\limits_{(x,y) \to (0,0)} \dfrac{x^2-y^2}{x^2+y^2}$ does not exist. 

\vfill

\end{enumerate}

\noindent {\bf \large 5. (14 points)} Let $F(x,y,z)=y^2z^3+e^{x^2z}$. \quad {\it Note:} All three parts use the same function and point.
\begin{enumerate}[(a)]
\item Find an equation for the plane tangent to $y^2z^3+e^{x^2z}=-3$ at $(x,y,z)=(0,2,-1)$

\vfill

\item Find the directional derivative $D_{\bf u}F(0,2,-1)$ where ${\bf u}$ points in the same direction as ${\bf v}=\langle 2,-2,1 \rangle$.

\vfill

\item Find the direction vector $\B u$ which maximizes $D_{\bf u}F(0,2,-1)$. What is the maximum value?

\vspace{1in}

\end{enumerate}

\newpage

\noindent {\bf\large 6. (8 points)} Let $e^{3x}\sin(y^2z)+y\ln(x^4+z^2)=99$. Assuming $z$ is a function of $x$ and $y$, find $\dfrac{\partial z}{\partial y}$.\\ \force \hfill {}[Don't worry about simplifying.]

\vspace{1.75in}

\noindent {\bf \large 7. (13 points)} Let $f(x,y) = -x^4+4xy-2y^2-3$.
\begin{enumerate}[(a)]
   \item Compute the gradient and Hessian matrix for $f$.
   \item Find the quadratic approximation of $f$ at $(x,y)=(0,-1)$.

\vfill
   
   \item Find and classify all of the critical points of $f$. {}[Use the ``$2^{\mathrm{nd}}$-derivative'' test to determine if critical points are relative max's, min's or saddle points.]

{\it To speed you along:} There are exactly 3 critical points. Their $x$-coordinates are $x=0,\pm 1$. 
   
\vspace{0.5in}

\vfill


\end{enumerate}

\newpage

\noindent {\bf \large 8. (14 points)} Suppose $f(x,y)$ is a ``nice'' function (with continuous partials of all orders).

\begin{enumerate}[(a)]
\item $Q(x,y) = 1+2(x-1)+3(x-1)(y+2)+4(y+2)^2$ is the quadratic approx. at $(x,y)=(1,-2)$. 

\vspace{0.1in}

$\nabla f(1,-2) =$ $\displaystyle\Big\la$ \hspace*{2in} $\displaystyle\Big\ra$ \qquad \qquad
$H_f(1,-2) =$ $\displaystyle\Bigg[$ \hspace*{2in} $\displaystyle\Bigg]$

\vspace{0.1in}

Is $(x,y)=(1,-2)$ a critical point of $f(x,y)$?  {\large\bf \qquad YES \quad / \quad NO}

If not, why not? If so, what kind (relative min, relative max, saddle point or not enough information)?

\vspace{1in}

The linearization of $f(x,y)$ at $(x,y)=(1,-2)$ is $L(x,y)=$ \underline{\hspace*{3.2in}}\\
\force \hfill {}[If there is not enough information answer ``N/A''.]

\item $Q(x,y) = 12-5(x-2)^2+(x-2)y-3y^2$ is the quadratic approx. at $(x,y)=(2,0)$. 

\vspace{0.1in}

$\nabla f(2,0) =$ $\displaystyle\Big\la$ \hspace*{2in} $\displaystyle\Big\ra$ \qquad \qquad
$H_f(2,0) =$ $\displaystyle\Bigg[$ \hspace*{2in} $\displaystyle\Bigg]$

\vspace{0.1in}

Is $(x,y)=(2,0)$ a critical point of $f(x,y)$?  {\large\bf \qquad YES \quad / \quad NO}

If not, why not? If so, what kind (relative min, relative max, saddle point or not enough information)?

\vspace{1in}

\end{enumerate}

\noindent {\bf \large 9. (12 points)} Use the method of Lagrange multipliers to find the minimum and maximum values of 

\force \hfill $f(x,y)= 2x-4y$ constrained to $x^2+y^2=5$. 

\vfill



\end{document}