Maximum and minimum of $f(x,y)=xy$ when $x^2 + y^2 + xy =1$ It is asked to find the maximum and minimum points of the function
$$f(x,y)=xy$$
when $x^2 + y^2 + xy=1$
I've tried Lagrange and obtained
$$\lambda = \frac{y}{2x+y}=\frac{x}{2y+x}$$
but what should I do with this? Any other suggestion?
Thanks!
 A: An elementary approach: using $2xy\leq x^2+y^2$, you can write
$$
xy=\frac{1}{3}(2xy+xy)\le\frac{1}{3}(x^2+y^2+xy)=\frac{1}{3}1=\frac{1}{3}
$$
with equality iff $x=y=\frac{1}{\sqrt{3}}$. For minimum, note that
$$
xy+1=xy+(x^2+y^2+xy)=(x+y)^2\geq 0\implies xy\geq-1
$$
where equality realizes when $(x,y)=(1,-1)$ or $(x,y)=(-1,1)$.
A: you can do this without calculus. the $x$-coordinates of the points common to both $xy = k$ and $x^2 + y^2 + xy = 1$ satsfies $ x^2 + k^2/x^2 + k - 1 = 0$ which can be turned into a quadratic equation for $u = x^2$ as $$u^2 + (k-1)u^2 + k^2 = 0$$ whose discriminant $ 1 - 2k - 3k^2 $ is positive for $-1 \le k \le 1/3.$ 
so the maximum value of $f$ is $2/3$ and the minimum of $f$ is $-1.$  
A: Generally, the first thing you should do is to check that there is a solution.
Noting that the constraint can be written as $g((x,y)) =(x+{y \over 2})^2+ {3 \over 4} y^2 = 1$, we can see that the feasible set is non-empty ($(1,0)^T$ is feasible), closed (by continuity), bounded ($y$ is bounded, hence so is $x$) and hence compact.
It is a good idea to check for obvious symmetries.
It is easy to check that if $(x,y)^T$ is a solution, then so is $(-x,-y)^T$.
We have $Dg((x,y)) = \begin{bmatrix}2x+y & 2y+x\end{bmatrix}$, and we see that $Dg((x,y)) = 0$ iff $(x,y)^T = 0$, hence $Dg((x,y)) \neq 0$ for all feasible $(x,y)^T$, and so we can use Lagrange multipliers.
Then at an extremum we have $Df((x,y))+ \lambda Dg((x,y)) = 0$, which gives the equation
$A(\lambda) \begin{bmatrix}x \\ y\end{bmatrix} = \begin{bmatrix}2 \lambda & 1 + \lambda \\
1+ \lambda & 2 \lambda \end{bmatrix} \begin{bmatrix}x \\ y\end{bmatrix}  = 0$. Since we know that $(0,0)^T$ is not a solution, we must have that the matrix $A(\lambda)$ is singular and a quick computation shows that the only
values of $\lambda$ for which $A(\lambda)$ is singular are $1, -{1 \over 3}$.
If $\lambda = 1$, then we must have $x+y=0$, which gives the possible solutions $\pm(1,-1)^T$.
If $\lambda = -{1 \over 3}$, then we must have $x-y=0$ which gives the possible solutions $\pm({1 \over \sqrt{3}}, {1 \over \sqrt{3}})^T$.
Evaluating shows that the minimum is $-1$ and the maximum is ${1 \over 3}$.
A: We can also implement a coordinate transformation:  let $$x = \frac{u+v}{\sqrt{2}}, \quad y = \frac{u-v}{\sqrt{2}}.$$  Then the given constraint becomes $$1 = x^2 + xy + y^2 = \frac{3u^2+v^2}{2},$$ and the function of interest is $$f(u,v) = xy = \frac{u^2-v^2}{2}.$$  Under the constraint, we have $$f(u,v) = 2u^2 - 1, \quad |u| \le \sqrt{2/3},$$ which is obviously minimized when $u = 0$ with minimum $f(0, \pm \sqrt{2}) = -1$, and maximized when $u = \pm \sqrt{2/3}$ with maximum $f(\pm \sqrt{2/3}, 0) = 1/3$.  Of course it is just as easy to express the extrema in terms of $x$ and $y$.
