<s>[INST] Maximum and minimum value of a function. 
Let us consider a function $f(x,y)=4x^2-xy+4y^2+x^3y+xy^3-4$. Then find the maximum and minimum value of $f$.

My attempt. $f_x=0$ implies $8x-y+3x^2y+y^3=0$ and $f_y=0$ implies $-x+8y+x^3+3xy²=0$ and $f_{xy}=3x^2+3y^2-1$. Now $f_x+f_y=0$ implies $(x+y)((x+y)^2+7)=0$ implies $x=-y$ as $x$ and $y$ are reals. Now putting it in $f_x=0$ get the three values of $x$ as $0$, $(-3+3\sqrt{5})/2$ and $(-3-3\sqrt{5})/2$. And then $f_{xy}(0,0)<0$ implies $f$ has maximum at $(0,0)$. But at other two points $f_{xy}$ gives the positive value. So how can I proceed to solve the problem.
Please help me to solve it.
 [/INST] $f_x+f_y=\left(x^3+3 x y^2-x+8 y\right)+\left(3 x^2 y+8 x+y^3-y\right)=\\=x^3+3 x^2 y+3 x y^2+7 x+y^3+7 y=(x+y) \left(x^2+2 x y+y^2+7\right)=0$
$y=-x$. Substitute in $f_x=0$ and get
$9 x-4 x^3=0\to x_1=0;\;x_2=\dfrac{3}{2};\;x_3=-\dfrac{3}{2}$
and $y_1=0;\;y_2=-\dfrac{3}{2};\;y_3=\dfrac{3}{2}$
Now the Hessian, for the second partial derivative test
$H(x,y)=\left(
\begin{array}{rr}
 6 x y+8 & 3 x^2+3 y^2-1 \\
 3 x^2+3 y^2-1 & 6 x y+8 \\
\end{array}
\right)$
and $\det H(x,y)=-9 x^4+18 x^2 y^2+6 x^2+96 x y-9 y^4+6 y^2+63$
so we have 
$\det H(x_1,y_1)=63>0$ and $f_{xx}=8>0$ thus $(0,0)$ is a local minimum
$\det H(x_2,y_2)=\det H(x_3,y_3)=-126<0$ so $\left(\frac{3}{2}, -\frac{3}{2}\right)$ and $\left(-\frac{3}{2}, \frac{3}{2}\right)$ are  saddle points
Hope this helps
$$...$$

</s>