I am having some trouble finding the max and min of the below problem using Lagrange multipliers:
$$ f(x,y) = x^2 -2xy + 3y^2 \\ \text{subject to} \ \ x^2 + 2y^2 + x + y = 0$$
Is there a trick or something i am missing? that was a question in one of my friends test and no one was able to solve it.
--------------------------------------------------------//--------------------------------------------------------
i get:
$$ 2x-2y = \lambda(2x+1) \\ -2x+6y = \lambda(4y+1) \\ x^2 + 2y^2 + x + y = 0$$
i can't solve it, is there a shortcut?
I assume you are looking for real solutions.
The Lagrangian function is: $$ L(x,y,\lambda)= x^2-2xy + 3y^2-\lambda(x^2+2y^2+x+y) $$
Taking derivatives with respect to $x, y, \lambda$ respectively yields: $$ 2x-2y -2\lambda x -\lambda=0$$
$$-2x+6y-4 \lambda y -\lambda = 0$$
$$x^2+2y^2+x+y=0$$
To solve the system (three equations, three unknowns), note that: $\lambda = \frac{2x-2y}{2x+1} = \frac{-2x+6y}{4y+1}$. Therefore: $$ (2x-2y)(1+4y) = (2x+1) (6y-2x) $$ or $$ 4x^2-8y^2-4xy+4x-8y=0 \,(I) $$ Multiplying the constraint by 4 gives: $$4x^2 + 8y^2 + 4x + 4y=0. \, (II)$$
Deducting (I) from (II) yields:
$$16y^2 + 4xy +12y=0$$
Therefore, either $y=0 \Rightarrow x=0$ or $x=-1$, or $16y+4x+12=0$. Combine the last equation with the constraint to find additional solutions, and you will get none (they are complex). So there are two solutions for $(x,y)$, namely $(0,0)$ and $(-1,0)$
You should check also the second order conditions at the optimum, e.g. bordered Hessian, or KKT conditions.
Plugging these values into the objective function gives: $f(0,0)=0$, $f(-1,0)=3$. The point (0,0) is a minimum; (-1,0) is a maximum.