Maximize $x^2 + y^2$ subject to $x^2 + y^2 = 1 - xy$ The equation $x^2 + y^2 = 1 - xy$ represents an ellipse. I am trying to show that its major axis is along $y=-x$ and find the vertex. To find the vertex I tried to find the vector in the ellipse with the greatest norm, which is equivalent to maximizing $x^2 + y^2$ subject to $x^2 + y^2 = 1 - xy$. How can I approach this?
(The maximum value of the objective function $x^2 + y^2$ seems to be 2. If I start out by assuming this I am able to show that the function cannot exceed this value. But this is kind of doing it in reverse as I start by evaluating the function at $y=-x=1.$ This also doesn't prove that $y=-x$ is the only optimal solution. How would I do it without "guessing" the solution first?)
 A: If$$f(x,y)=x^2+y^2\quad\text{and}\quad g(x,y)=x^2+y^2+xy,$$then you want to know the maximum of $f$ under the restriction that $g(x,y)=1$. In order to do so, you can solve the system$$\left\{\begin{array}{l}f_x(a,b)=\lambda g_x(a,b)\\f_y(a,b)=\lambda g_y(a,b)\\g(a,b)=1\end{array}\right.\iff\left\{\begin{array}{l}2a=2\lambda a+\lambda b\\2b=2\lambda b+\lambda a\\a^2+b^2-ab=1\end{array}\right.$$The first two equations are a system of two linear equations, depending upon a parameter $\lambda$:$$\left\{\begin{array}{l}(2-2\lambda)a-\lambda b=0\\-\lambda a+(2-2\lambda)b=0.\end{array}\right.\label{a}\tag1$$The determinant of the matrix of coefficients of the system \eqref{a} is $3\lambda^2-8\lambda+4$ whose roots are $2$ and $\frac23$. If $\lambda$ is not one of these numbers, then the only solution of \eqref{a} is $(0,0)$, but $g(0,0)\ne1$. So, see what happens if $\lambda$ is one of those numbers:

*

*if $\lambda=2$, then the solutions are $\pm(1,-1)$;

*if $\lambda=\frac23$, then the solutions are $\pm\left(\frac1{\sqrt3},\frac1{\sqrt3}\right)$.

Since the value that $f$ takes at the first two points is $2$ and the values that it takes at the other two is $\frac23$, the maximum of $f$ is indeed $2$.
A: If you would like to avoid calculus and use linear algebra instead (to each their own!), let us write down this equation in a different way.
With matrices, if we set
$$ A = \begin{pmatrix}
1 & \frac{1}{2} \\
 \frac{1}{2}& 1 
\end{pmatrix}$$
then this equation is the same as $\textbf{x}^TA \textbf{x} = 1$ with $\textbf{x} = (x ,y)^T$.
Now, using linear algebra we know symmetric matrices can be orthogonally diagonalized so we get
$A = PDP^T = PDP^{-1}$ where $$P = \begin{pmatrix}
-1 & 1 \\
 1& 1 
\end{pmatrix} $$
$$D = 
\begin{pmatrix}
\frac{1}{2} & 0 \\
 0 & \frac{3}{2} 
\end{pmatrix}$$
So, this says that the major and minor axes of this quadratic are along $(-1, 1)^T$ and $(1,1)^T$ so exactly along the lines $y = x$ and $y= -x$.
The reason this works is that in the coordinates given by $P$ (or rather $P^T$), you end up with the equation of a circle in standard position i.e. something like $u^2 + v^2 = 1$ where $(u, v)^T = P^T (x,y)^T$. So $P$ gives you the directions along which to transform the circle into an ellipse, and $D$ tells you by how much to stretch along those axes.
A: $\Delta \thinspace \thinspace \rm {method \thinspace\thinspace works\thinspace .}$
You have :
$$
\begin{cases}x^2+y^2=a,\thinspace a\in\mathbb R\\
x^2+y^2+xy=1\end{cases}
$$
This implies that,
$$
\begin{cases}y=\frac {1-a}{x}\\
x^2+\frac{(a-1)^2}{x^2}-a=0\end{cases}
$$
Then, letting $x^2=u$, we have :
$$
\begin{align}&u+\frac {(a-1)^2}{u}-a=0\\
\implies &u^2-ua+(a-1)^2=0\end{align}
$$
This leads to:
$$
\begin{align}&\Delta_u=a^2-4(a-1)^2\geq 0\\
\implies &\frac 23\leq a\leq 2\thinspace .\end{align}
$$
The equality $a=2$ holds, iff when :
$$\begin{align}&u=\frac a2=1\\
\implies &(x,y)=\left(\pm 1,\mp 1\right)\end{align}$$
Thus, we obtain a global maximum :
$$
\begin{align}\max\left\{x^2+y^2\mid x^2+y^2=1-xy\right\}&=2\\
\rm {at} \thinspace\thinspace\thinspace (x,y)=\left(\pm 1\thinspace,\mp 1\right)\thinspace\thinspace\thinspace\thinspace\thinspace\thinspace\thinspace\thinspace\thinspace\thinspace\thinspace\end{align}
$$
Similarly, since $a\geq \frac 23$, then we obtain a global minimum :
$$
\begin{align}\min\left\{x^2+y^2\mid x^2+y^2=1-xy\right\}&=\frac 23\\
\rm {at} \thinspace\thinspace\thinspace (x,y)=\left(\pm \frac {\sqrt 3}{3},\thinspace \pm \frac {\sqrt 3}{3}\right)\end{align}
$$
This completes the answer .
A: Using polar coordinates, then
$ x = r \cos \theta $
$ y = r \sin \theta $
So we want to maximize $ r^2 = x^2 + y^2 $ subject to $ r^2 = 1 - \dfrac{1}{2} r^2 \sin(2 \theta) $
Hence,
$ r^2 = \dfrac{1}{1 + \frac{1}{2} \sin(2 \theta) } $
Clearly the maximum is when $ \sin(2 \theta) = -1 $, which corresponds to $ \theta = \dfrac{3 \pi}{4} $ and $ \theta = \dfrac{7 \pi}{4} $
At which points , $ r^2 = 2 $ (and this is the maximum value) and for the first value of $\theta$, we get
$ x = -1 , y = 1 $
And for the second value of $\theta$ we get
$ x = 1, y = -1 $
A: Substitutions work much faster .
Let $\thinspace x=a+b,\thinspace y=a-b$, then you have :
$$\begin{align}&x^2+y^2=1-xy\\
\iff
&3a^2+b^2=1\end{align}$$
This leads to the following :
$\underline{\rm {Global\thinspace\thinspace maximum}}$
$$\begin{align}x^2+y^2&=2(a^2+b^2)\\
&=2(a^2+1-3a^2)\\
&=2-4a^2\leq 2\end{align}$$
Equality occurs iff, when $a=0,\thinspace |b|=1$, which corresponds to $\left(x,y\right)=\left(\pm 1,\mp 1\right)\thinspace . $
$\underline {\rm {Global\thinspace\thinspace minimum }}$
$$\begin{align}x^2+y^2&=2(a^2+b^2)\\
&=2\left(\frac {1-b^2}{3}+b^2\right)\\
&=\frac 23\left(2b^2+1\right)\geq\frac 23\end{align}$$
Equality occurs iff, when $b=0,\thinspace |a|=\frac {\sqrt 3}{3}$, which corresponds to $\left(x,y\right)=\left(\pm \frac {\sqrt 3}{3},\pm \frac {\sqrt 3}{3}\right).$
This completes the answer.
A: If looking at a generalization is interesting the following:
Let $(f,g)$ be given object and constraint function respectively, Euler-Lagrange equation (in calculus of variations approach) can be also expressed as
$$\frac{f_{x}}{ f_{y}}=\frac{g_{x}}{ g_{y}}$$
$$\frac{2x}{2y}=\frac{2x+y}{2y+x}$$
which simplifies to
$$ x+y=0,~ x-y=0~ $$
The straight line pair intersects the constraint function graph $g(x,y)$ (green) at  four points solved which are shown at minimum and maximum respectively :
$$ D1=(\frac{ 1}{ \sqrt 3},\frac{ 1}{ \sqrt 3}),D2=(\frac{- 1}{ \sqrt 3},\frac{- 1}{ \sqrt 3}), ~ E1=(-1,1),E2=( 1,-1); $$

The choice between the extrema is decided by the Hessian with second partial derivatives. This approach gives insight also to the sign of Gauss curvature of the constraint function
$$z= g (x,y)$$
at these points in 3-space.
A: A conic can be brought to canonical form with only one translation and one rotation. In this example the center of the conic is $(0,0)$, so we need only a rotation. Since $x^2-xy+y^2=1$ is symmetric in $x$ and $y$, without the formula, the rotation angle is easily $45^{\circ}$. Let, $P=(x,y)$ be old coordinates and $P'=(x',y')$ be new coordinates and $R_{\theta}$ be rotation transformation about the origin $\theta$ degrees. Then $P'=R_{45^{\circ}}P$ or in other words, $P=R_{-45^{\circ}}P'$ which gives
$$(x,y)=(\frac{1}{\sqrt2}x'+\frac{1}{\sqrt2}y',-\frac{1}{\sqrt2}x'+\frac{1}{\sqrt2}y').$$
Substituting this in the ellipse equation and omiting dashes easily gives
$$\frac{x^2}{2}+\frac{y^2}{2/3}=1.$$
The vertices of this new ellipse is $\pm(\sqrt2,0)$ and $\pm(0,\frac{\sqrt2}{\sqrt3})$. Now we have to rotate back these vertices by $R_{-45^{\circ}}=\left[\begin{matrix}\cos(-45^{\circ})&-\sin(-45^{\circ})\\\sin(-45^{\circ})&\cos(-45^{\circ})\end{matrix}\right]$. We get $\pm(1,-1)$ and $\pm(\frac{1}{\sqrt3},\frac{1}{\sqrt3})$.
