How to prove that $f(x,y) =(x^2-y^2)e^{-x^2-y^2} $ attains its maximum and its minimum. Let $f:\Bbb R^2\to \Bbb R$ given $$f(x,y) =(x^2-y^2)e^{-x^2-y^2} $$
what is tricking me are the odering of the following questions, 


*

*Prove that $f$ attains its maximum and its minimum. 

*solve $\nabla f(x,y)=0$ and 

*Classical the global and local maximum and minimum of $f$


I have answered perfectly the two las questions I found and classify the extrema which are $(0,0), (0,1), (0,-1), (1,0)$ and $(-1,0).$ (the classification is easy to obtain within the Hessian matrix )

I am wondering how can one solve the first question ignoring the question 3. and 2.? 

I was thinking about using some compactness argument. But here the domain $f$ is clearly not compact. Can any one help ?

 A: You can use the extreme value theorem. It's not difficult to show that $f(x,y) \to 0$ as $\|(x, y)\| \to \infty$. Note also that $f(1, 0) = e^{-1} > 0$ and $f(0, 1) = -e^{-1} < 0$. By the limit expression, there must exist an $M$ large enough such that $\|(x, y)\| > M \implies |f(x, y)| < e^{-1}$. By the extreme value theorem, $f$ must attain a maximum and minimum on this compact ball $B[(0, 0); M]$, and such a maximum must be at least $e^{-1}$ and similarly the minimum is at most $-e^{-1}$. This maximum on $B[(0, 0); M]$ is therefore a global maximum, and similarly for the minimum.
The questions are, in my opinion, in a good order. Finding the stationary points and classifying them with derivative tests cannot show anything more than local maximality or minimality. Whereas, if you know in advance that a global maximum/minimum must exist, you know it must occur at a stationary point (since the function is differentiable), so it is sound to compare the values of the function at the stationary points, taking the greatest to be the maximum and the least to be the minimum.
A: Write the function in polar coordinates:
$$f(r,\theta)=r^2(\cos^2\theta-\sin^2\theta)e^{-r^2}=r^2e^{-r^2}\cos2\theta$$
and if we look for extrema values:
$$\begin{cases}f'_r=2re^{-r^2}\cos2\theta-2r^3e^{-r^2}\cos2\theta=2re^{-r^2}\cos2\theta(1-r^2)=0\iff r=1\\{}\\
f'_\theta=-2r^2e^{-r^2}\sin2\theta=0\iff2\theta=k\pi\,,\,\,k\in\Bbb Z\iff\theta=\frac k2\pi,\,\,k\in\Bbb Z\\{}\\
f''_{rr}=2e^{-r^2}\cos2\theta\left[1-r^2-2r(1-r^2)-2r^2\right]=2e^{-r^2}\cos2\theta\left[2r^3-3r^2-2r+1\right]\\{}\\
f''_{\theta\theta}=-4r^2e^{-r^2}\cos2\theta\\{}\\
f''_{r\theta}=-4r(1-r^2)e^{-r^2}\sin2\theta\end{cases}$$
and thus the Hessian is
$$H(r,\theta)=\begin{vmatrix}2e^{-r^2}\cos2\theta\left[2r^3-3r^2-2r+1\right]
&-4r(1-r^2)e^{-r^2}\sin2\theta\\
-4r(1-r^2)e^{-r^2}\sin2\theta&-4r^2e^{-r^2}\cos2\theta\end{vmatrix}=$$$${}$$
$$=-8r^2e^{-2r^2}\left[(2r^3-3r^2-2r+1)\cos^22\theta+2(1-r^2)^2\sin^22\theta\right]$$
Thus, at the critical points, we get:
$$H\left(1,\frac k2\pi\right)=-8e^{-2}(-2)\cos^2k\pi=16e^{-2}\cos^2k\pi>0\;,\,\,k\in\Bbb Z$$
and since 
$$f''_{rr}\left(1,\frac k2\pi\right)=2e^{-2}\cos k\pi\cdot(-2)=-4e^{-2}\cos k\pi$$
we get that 
$$\begin{cases}k\in\Bbb Z\;\text{odd}\implies f''_{rr}\left(1,\frac k2\pi\right)>0\implies\text{ we get a local minimum}\\{}\\
k\in\Bbb Z\;\text{even}\implies f''_{rr}\left(1,\frac k2\pi\right)<0\implies\text{ we get a local maximum}\end{cases}$$
We thus get the local extrema points are on the unit circle (or at the origin, which we didn't check since we assumed all the time $\;r>0\;$), and thus anyway they are within the closed unit disk, which is a compact set and thus the function, being continuous, attains its maximum and minimum there.
