If $x^2+y^2+xy=1\;,$ Then minimum and maximum value of $x^3y+xy^3+4\;,$ where $x,y\in \mathbb{R}$ 
If $x,y\in \mathbb{R}$ and $x^2+y^2+xy=1\;,$ Then Minimum  and Maximum value of $x^3y+xy^3+4$

$\bf{My\; Try::} $Given  $$x^2+y^2+xy=1\Rightarrow x^2+y^2=1-xy\geq 0$$
So we get $$xy\leq 1\;\;\forall x\in \mathbb{R}$$
and $$x^2+y^2+xy=1\Rightarrow (x+y)^2=1+xy\geq0$$
So we get $$xy\geq -1\;\;\forall x\in \mathbb{R}$$
So we get $$-1\leq xy\leq 1$$
$$\displaystyle f(x,y) = xy(x^2+y^2)+4 = xy(1-xy)+4 = (xy)-(xy)^2+4 = -\left[(xy)^2-xy-4\right]$$
So $$\displaystyle f(x,y) = -\left[\left(xy-\frac{1}{2}\right)^2-\frac{17}{4}\right] = \frac{17}{4}-\left(xy-\frac{1}{2}\right)^2$$
So $$\displaystyle f(x,y)_{\bf{Min.}} = \frac{17}{4}-\left(-1-\frac{1}{2}\right)^2 = 2\;,$$ which is occur when $xy=-1$
But I did not understand how can i calculate $f(x,y)_{\bf{Max.}}$
Plz Help me, Thanks 
 A: You already showed that $$f(x,y) = xy(x^2+y^2)+4=xy(1-xy)+4,$$
which is a quadratic function in $xy$. It remains to find the exact range for $xy$. For which you showed that $xy\ge -1$, equality happens when $(x,y)=(1,-1)$ or $(x,y)=(-1,1)$. 
The other restriction $xy\le1$, while correct, never reaches equality. Instead, note that
$$xy\le \frac{x^2+y^2}2=\frac{1-xy}2.$$
So $xy\le \frac13$, equality happens when $x=y=\pm\frac1{\sqrt3}$.
Now, let $t=xy$, then $-1\le t\le \frac13$, and
$$f =t-t^2+4.$$
Note that the derivative with respect to $t$ is $1-2t$ and is positive in the range $[-1,1/3]$. So $f_\min$ is at $t=-1$ and $f_\max$ is at $t=1/3$.
A: Using your second last line,
$$f(x,y) = \frac{17}{4} - (xy-\frac 12)^2 $$
now let $\displaystyle xy=u$,
$x^2 + y^2 + xy = 1$ becomes $(x+y)^2 = 1+u$
Therefore $x,y$ are roots of the quadratic $k^2 \pm \sqrt(1+u) k + u = 0.$
If $x, y$ are real, discriminant is non negative, solving this gets $\displaystyle u\leq \frac{1}{3}$
therefore $\displaystyle xy\leq \frac{1}{3}.$
Minimum value of $f(x,y)$ occurs when $\displaystyle \left(xy-\frac{1}{2}\right)^2$ is minimum. 
This occurs when $\displaystyle xy=\frac{1}{3}$ as shown above.
Therefore, max value $\displaystyle = \frac{17}{4} - \left(\frac{1}{3}-\frac{1}{2}\right)^2 = \frac{38}{9},$ which is what Wolfram Alpha says
