Finding extrema of $x^2y^2+2xy^2+y^4$ on $\{(x,y)\in\mathbb R^2\ |\ |x|\le 2, |y|\le 2\}$ 
Let $f:\mathbb R^2\rightarrow\mathbb R$ be defined by $f(x,y)=x^2y^2+2xy^2+y^4$ and the region $D\subset\mathbb R^2$ by $D=\{(x,y)\in\mathbb R^2\ |\ |x|\le 2, |y|\le 2\}$. I have to find the extrema of $f$ on $D$ and I have to concider wether the found extrema are global or local.

I already have found that 
$\nabla f=\vec{0}$ for $(x,0)$ if $x\in\mathbb R$ and $(-1,\pm\frac{1}{2}\sqrt{2})$  and that $f(x,y)=0$ for $(x,0)$, $x\in\mathbb R$ and for $(x,\pm\sqrt{-x^2-2x})$ for $-2<x<0$. 
I guess I have to do something with the level curve $N_0=f^{-1}(\{0\})$ and the fact that the complement of this set consists of path-connected sets on which $f(x,y)\ne0$, therefore $f$ is either strictly positive or strictly negative on these sets (every set can have one of the two options separately). However, I do not know if this approach will get me anywhere and I was wondering if anyone could help me solve this problem (another way).
Please note that this exercise comes in an introductory real-analysis course so I'm not too familiar with very advanced math.
 A: Since
$$ f(x,y)=[(x+1)^2+y^2-1]y^2 $$
we know that the $f(x,y)=0$ iff $(x,y)$ lies on $y=0$ or on the circle $(x+1)^2+y^2=1$. $f(x,y)<0$ iff $(x,y)$ lies in the interior of the circle $(x+1)^2+y^2=1$.
Of the four critical points $(0,0),(-2,0),(-1,\frac{2}{2}),(-1,-\frac{2}{2})$ the first two lie on $f^{-1}(0)$ and the second two line in a connected component of its complement. The boundary points of the $4\times4$ square, with the exception of the point $(-2,0)$ also lie in a connected component of the complement of $f^{-1}(0)$.

A: $$x^2y^2+2xy^2+y^4\leq2^2\cdot2^2+2\cdot2\cdot2^2+2^4=48$$
and it's obvious that it's a maximal value.
If $x=-1$ and $y=\frac{1}{\sqrt2}$ then we get a value $-\frac{1}{4}$.
But $$x^2y^2+2xy^2+y^4+\frac{1}{4}=x^2y^2+2xy^2+y^2+y^4-y^2+\frac{1}{4}=$$
$$=y^2(x+1)^2+\left(y^2-\frac{1}{2}\right)^2\geq0,$$
which says that $-\frac{1}{4}$ it's a minimal value.
A: First of all, find the critical points for $f$ in the interior of $D$:
$$
C=\{(x,0)\mid |x|<2\}\cup\{(-1,\pm\frac{\sqrt{2}}{2})\}.
$$
The place where you find the min and max of $f$ should be $C$ together with the boundary $\partial D$. 
Now, on the set $C$ we have,
$$
f(x,0)=0,\quad f(-1,\pm\frac{\sqrt{2}}{2})=\frac{1}{2}(1-2+\frac{1}{2})=-\frac{1}{4}.
$$
On each side (the closed segament) of the boundary of $D$, the function is a function of single variable; so you can find the min and max on it. 
Eventually, put all the results above together to give the answer. 
