Problem about find the extreme of a function (Multipliers of Lagrange) Good morning. I have a problem with this:
Find the maximum and minimum distances from the origin to the curve* $$g\left(x,y\right)=5x^{2}+6xy+5y^{2}$$
I have done this:
Function to optimize:$f\left(x,y\right)=x^{2}+y^{2}$
Restriction: $g\left(x,y\right)=5x^{2}+6xy+5y^{2}=8
 $
Applying Lagrange multipliers:
$\nabla f\left(x,y\right)=\lambda\nabla g\left(x,y\right)$
Then,
$\nabla f\left(x,y\right)=2x\hat{i}+2y\hat{j}$ and   $\lambda\nabla g(x,y)=\lambda(2x+\frac{6}{5}y)\hat{i}+\lambda\left(2y+\frac{6}{5}x\right)\hat{j}
 $
Making the ecuation system:
$\begin{cases}
2x=(2x+\frac{6}{5}y)\lambda\\
2y=(2y+\frac{6}{5}x)\lambda\\
x^{2}+\frac{6}{5}xy+y^{2}=8
\end{cases}$
But I have serious problem solving the system. Any suggestions?
 A: Have you tried a software like Mathematica? There are four solutions to your system: $x=y=Sqrt[5/2]$ and the negative of that root (both with $λ=5/8$), and $x=-y=Sqrt[10]$ and the negative of that root (both with  $λ=5/2$).
A: divide the first equation with the second one to get rid of the $\lambda$ then you can solve for $x$ and $y$ with the third equation
A: It turns out that this system of Lagrange equations doesn't really warrant the use of Mathematica.  We are faced with
$$ \ 2x \ = \ (2x \ + \ \frac{6}{5}y)\lambda \ \ , \ \ 2y \ = \ (2y \ + \ \frac{6}{5}x)\lambda \ \ . $$
Since bringing all the terms to one side in each equation won't help us to factor the expressions, we might instead solve each equation for $ \ \lambda \ $ to obtain
$$ \lambda \ \ = \ \ \frac{x}{x \ + \ \frac{3}{5} y} \ \ = \ \ \frac{y}{y \ + \ \frac{3}{5} x} \ \ . $$
Assuming for the moment that neither denominator is equal to zero (it will turn out that they are not), we can "cross-multiply" the ratios to produce
$$ xy \ + \ \frac{3}{5} x^2 \ \ = \ \ xy \ + \ \frac{3}{5} y^2 \ \ \Rightarrow \ \  x^2 \  = \  y^2 \ \ \Rightarrow \ \ y \ = \ \pm x \ \ . $$
We have two cases now for insertion into the curve equation:
$$ \mathbf{y = x :} \quad 5x^2 \ + \ 6xy \ + \ 5y^2 \ = \ 8 \ \ \rightarrow \ \ 5x^2 \ + \ 6·x·x \ + \ 5x^2 \ = \ 8 \ \ \Rightarrow \ \ 16x^2 \ = \ 8 $$ $$ \Rightarrow \ \ x^2 \ = \ \frac{1}{2} \ \ ; $$
$$ \mathbf{y = -x :} \quad \quad \quad \rightarrow \ \ 5x^2 \ + \ 6·x·(-x) \ + \ 5x^2 \ = \ 8 \ \ \Rightarrow \ \ 4x^2 \ = \ 8 \ \ \Rightarrow \ \ x^2 \ = \ 2 \ \ . $$
If we only need the "distance-squared" from the origin for the extremal points, then the cases are $ \ \mathbf{y = x :} \ \ x^2 \ + \ y^2 \ = \ \frac{1}{2} \ + \ \frac{1}{2} \ = \ 1 \ \ $ and $ \ \ \mathbf{y = -x :} \ \ x^2 \ + \ y^2 \ = \ 2 \ + \ 2 \ = \ 4  \  ,  $ making the extremal distances from the origin $ \ 1 \ $ and $ \ 2 \ . $  [The points at these distances are $ \ \left( \pm  \frac{1}{\sqrt{2}} \ , \ \pm  \frac{1}{\sqrt{2}} \right) \ $ and $ \ \left( \pm   \sqrt{2} \ , \ \mp   \sqrt{2} \right) \ , $ respectively.
The constraint curve $ \ 5x^2 \ + \ 6xy \ + \ 5y^2 \ = \ 8 \ $ has symmetry about the origin, so it is reasonably to expect that there should be a critical point in each quadrant (with extremal points of the same type in opposite quadrants).  The curve is a "rotated ellipse" for which we have found the lengths of its semi-major and semi-minor axes and the locations of their endpoints.

