\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 March ${\bf 16}^\mathrm{\bf th}$, 2021}

\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 {-5,...,5}
       \addplot [domain = -1:1, samples = 50, 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 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
    ]
    \addplot [domain = -1:1, samples = 30, color=black] ({x},{x});
    \addplot [domain = -1:1, samples = 30, color=black] ({x},{-x});

    \foreach \C in {0,0.45,0.65,0.85} { 
       \addplot [domain = -3:3, smooth, samples=50, color=black] ({\C*cosh(x)}, {\C*sinh(x)});
       \addplot [domain = -3:3, smooth, samples=50, color=black] ({-\C*cosh(x)}, {\C*sinh(x)});
       \addplot [domain = -3:3, smooth, samples=50, color=black] ({\C*sinh(x)}, {\C*cosh(x)});
       \addplot [domain = -3:3, smooth, samples=50, color=black] ({\C*sinh(x)}, {-\C*cosh(x)});
    }
    \node[fill=white] at (axis cs: -0.25,-0.85) {\color{red}\bf lower};
    \node[fill=white] at (axis cs: 0.25,0.85) {\color{red}\bf lower};
    \node[fill=white] at (axis cs: 0.75,-0.15) {\color{red}\bf higher};
    \node[fill=white] at (axis cs: -0.75,0.15) {\color{red}\bf higher};
    
    \draw[red,fill=red,ultra thick] (axis cs:-0.15,-0.15) circle [radius=3pt];
    \node[below left] at (axis cs:0.05,-0.1) {\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 {1,...,6}
       \addplot [domain = 0:360, samples = 50, color=black] ({\C/5*cos(x)}, {\C/5*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.205,0.564) circle [radius=3pt];
    \node[below right] at (axis cs:-0.205,0.564) {\color{red}\bf C};
  \end{axis}
\end{tikzpicture}
\hfill \force

\iffalse

\fi
  
\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)=1-x^2-y^2$, $f(x,y)=\sqrt{x^2+y^2}$, $f(x,y)=2x^3+y$, $f(x,y)=2x^2+y$, and $f(x,y)=x^2-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. (7 points)} Let $w=f(x,y,z)$, $x=g(t)$, $y=h(t)$ and $z=\ell(t)$. State the chain rule for the derivative of $w$ with respect to $t$. Clearly distinguish between regular derivatives (i.e., d's) and partial derivatives (i.e., $\partial$'s).


\vfill


\noindent {\bf \large 3. (9 points)} Consider some unknown function $f(x,y)$.

\begin{enumerate}[(a)]

\item It is possible to have a function where $f_{xy}(3,4)=5$ and $f_{yx}(3,4)=6$? \qquad {\Large\bf YES \quad / \quad NO}\\
\force \qquad If not, why not? If so, what does this tell us? 

\vspace{0.75in}

\item If $\nabla f(x,y)$ exists, can I conclude that $f(x,y)$ is differentiable? \qquad {\Large\bf YES \quad / \quad NO}

\vspace{0.15in}

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

\vspace{0.1in}

\end{enumerate}

\newpage


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

\begin{enumerate}[(a)]
\item Show that $\displaystyle \lim\limits_{(x,y) \to (0,0)} \dfrac{3x^2+3y^2+xy^2}{x^2+y^2}$ exists and find this limit. 

\vfill

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

\vfill

\end{enumerate}

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

\vfill

\item Find the directional derivative of $F$ at the point $(1,0,2)$ in the direction of the vector $\langle -1,2,-2 \rangle$.

\vfill

\item Is it possible to find a direction vector $\B u$ so that $D_{\B u}F(1,0,2)=-2$? Why or why not?

\vspace{1in}

\end{enumerate}

\newpage

\noindent {\bf\large 6. (8 points)} Suppose that $z=x^3y$ where $x$ is measured within 1\% accuracy and $y$ is measured within 2\% accuracy. Use a total derivative to estimate the maximum percent error in the corresponding $z$ measurement.

\vspace{1.75in}

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

\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.]
   
\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) = 13+4(x-3)^2-3(x-3)(y+2)+2(y+2)^2$ is the quadratic approx. at $(x,y)=(3,-2)$. 

\vspace{0.1in}

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

\vspace{0.1in}

Is $(x,y)=(3,-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}

\item $Q(x,y) = 11+5(x+1)-y+4(x+1)^2-6(x+1)y$ is the quadratic approx. at $(x,y)=(-1,0)$. 

\vspace{0.1in}

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

\vspace{0.1in}

Is $(x,y)=(-1,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}

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

\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)= xy^2$ constrained to $x^2+y^2=12$. 

\vfill



\end{document}