Finding the axes of an ellipse using Lagrange multipliers

lagrange multipliermaxima-minimamultivariable-calculusoptimizationqcqp

From Demidovich:

Find the axes of the ellipse $5x^2 + 8xy + 5y^2 = 9$ using Lagrange multipliers.

I've tried to separate into two equations, $g(x,y)$ and $f(x,y)$, to apply

$$\nabla f(x,y) = -\lambda \nabla g(x,y)$$

What I got was that:

$$f(x,y) = 5x^2 + 5y^2 – 1 = 0$$ and $$g(x,y) = 8xy – 8 = 0$$

Then I applied the formula:

$$\nabla f(x,y) = (10x, 10y) \quad \nabla g(x,y) = (8y, 8x)$$

$$\begin{cases} 10x = -\lambda 8y \\
10y = – \lambda 8x \end{cases}$$

And what I got was that $ x = \pm 1 = y$, which gives me that $2a = 2b = 2$ but in the Demidovich it says that the solution is $2a = 6$ and $2b = 2$ and to use the fact that the distance from any point (x,y) of the ellipse from its centre is equal to $x^2 + y^2$. I've tried to considere $f(x,y) = x^2 + y^2$ and $g(x,y) = 5x^2 + 8xy + 5y^2 = 9$ but I can't get the right result.

Best Answer

Let us try with the function $F(x,y,\lambda)=x^2+y^2-\lambda(5x^2+8xy+5y²-9)$. $$\begin{cases} 2x=\lambda(10x+8y)\\ 2y=\lambda(8x+10y) \end{cases} \implies\frac{2x}{10x+8y}=\frac{2y}{8x+10y}\implies x^2=y^2. $$ Substituting $y=\pm x$ into the ellipse equation one obtains: $$\begin{cases} y=x:&2x^2=1;\\ y=-x:&2x^2=9, \end{cases} $$ which amounts to $a=3, b=1$ as claimed.