<s>[INST] Using Lagrange Mult. to find maximum of $2x + y^2$ with constraints: $x^2 + y^2 + z^2 = 2$ and $x + y^2 + z = 0$ I was trying to maximize the function $2x + y^2$ with the following constraints: $x^2 + y^2 + z^2 = 2$ and $x + y^2 + z = 0$ using Lagrange multipliers. I already did all the work of proving that  the maximum does exist and showing that we can apply the technique of Lagrange multiplies. After that I arrived at the following systems of equations:
$$\begin{cases}2 = 2\alpha x + \beta  \\
2y = 2\alpha y + 2 \beta y \\
0 = 2\alpha z + \beta \\
x^2 +y^2 + z^2 =2 \\ 
x + y^2 + z = 0\end{cases}$$
Where $\alpha$ and $\beta$ are the Lagrange multipliers. The problem is that I'm having a lot of trouble solving this system for $(x,y,z)$.
My plan was trying to write $x,y,z$ in terms of $\alpha,\beta$ and then using the equations $x^2 + y^2 + z^2 = 2$ and $x + y^2 + z = 0$ find the values for $\alpha $ and $\beta$, but I wasn't able to find an expression for $y$ in terms of $\alpha$ and $\beta$.
How can this system be solved?
 [/INST] $x^2+y^2+z^2=2$.
$x+y^2+z=0.$
Minimize: $2x+y^2$
$z=-(x+y^2)\implies z^2=x^2+2xy^2+y^4.$
$x^2+y^2+(x^2+2xy^2+y^4)=2\implies 2x^2+(2x+1)y^2+y^4=2$
$4x+2y^2=2\lambda\implies 2x+y^2=\lambda$
$2y(2x+1)+4y^3=2y\lambda$
$y=0$ or $(2x+1)+2y^2=\lambda\implies 1+y^2=0$
Case 1: $y=0$.
$x^2+z^2=2$ and $x+z=0$. Then $x=\pm1$ and $z=-x$.
Minimum occurs if $x=-1$. Minimum = $-2$.
Case 2: $y^2=-1$
$x^2+z^2=3$ and $x+z=1$.
Then: $x^2+x^2-2x+1=3\implies 2x^2-2x-2=0\implies x=\frac{1\pm\sqrt{5}}{2}$, $z=\frac{1-\mp\sqrt{5}}{2}$.
Minimum is $-\sqrt{5}$. While that's lower, complex values aren't allowed, so minimum is $-2$.
</s>