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?
 A: To simplify things, solve for $z$ from the second constraint, and plug it into the first constraint, as follows
From $x + y^2 + z = 0 $ you get $ z = - x -  y^2 $
Plug this into $ x^2 + y^2 + z^2 = 2$ you get $ x^2 + y^2 +(x + y^2)^2 = 2 $
which simplifies to $ 2 x^2 + y^2 (1 + 2 x) + y^4 = 2 $
The Lagrange function is
$ g = 2x +  y^2 + \lambda ( 2 x^2 + y^2 (1 + 2 x) + y^4 - 2 ) $
$g_x = 2 + \lambda ( 4 x + 2y^2 ) $
$ g_y = 2 y + \lambda ( 2 y (1 + 2 x) + 4 y^3 )$
$g_\lambda = 2 x^2 + y^2 (1 + 2 x) + y^4 - 2$
Setting these to zero, implies
$ \lambda = \dfrac{-2}{ 4 x + 2 y^2} = \dfrac{ - 2 y}{ 2 y(1+ 2x) + 4y^3 } $
Cross multiplying,
$2 y (1 + 2 x) + 4 y^3 = y ( 4 x + 2 y^2 ) $
Dividing through by $2$,
$y (1 + 2 x) + 2 y^3 = y (2 x + y^2 ) $
$ y + 2 x y + 2 y^3 = 2 x y + y ^ 3 $
$ y + y^3 = 0 $
$ y( 1 + y^2) = 0 $
Hence, $ y = 0 $
Using the third constraint,
$ 2 x^2 - 2 = 0 $
So $x = \pm 1 $
Clearly the maximum occurs at $x = 1$, hence $z = -x - y^2 = -1$
Therefore, the maximum of $2$ is achieved at $(1, 0, -1)$
A: $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$.
A: Using the two constraint-multiplier equations you wrote,
$$  2 \ - \ 2\alpha x \ - \ \beta \ \ = \ \ 0 \ \  \ , \ \ \ 2y \ - \ 2\alpha y \ - \  2 \beta y \ \ = \ \ 0 \ \ \ , \ \ \ 0 \ - \  2\alpha z \ - \ \beta \ \ = \ \ 0 \ \ ,  $$
we could eliminate $ \ \beta \ $ between the first and third equations to write $ \ 2·(1 - \alpha·x) \ = \ -2·\alpha·z $ $ \Rightarrow \ 1 - \alpha·(x - z) \ = \ 0 \ \Rightarrow \ \alpha \ = \ \frac{1}{x \ - \ z} \ \ . $  The second equation is factorable as $ \ y·(1 - \alpha - \beta) \ = \ 0 \ \ .  $
The first case from this equation is the easier one to deal with:  with $ \ y \ = \ 0 \ \ , $ the constraint equation $ \ x + y^2 + z \ = \ 0 \ \ $ requires that $ \ z \ = \ -x \ \ .  $   The constraint sphere then produces
$$ x^2 \ + \ 0^2 \ + \ (-x)^2 \ \ = \ \ 2·x^2 \ \ = \ \ 2 \ \ , $$
giving us the extremal points $ \ ( \ \pm 1 \ , \ 0 \ , \ \mp 1 \ ) \ \ $ and the function values $ \ \mathbf{f( \ 1 \ , \ 0 \ , \ -1 \ ) } \ = \ 2·1 + 0 \ \mathbf{= \ +2} \ \ $ and   $ \ \ \mathbf{f( \ -1 \ , \ 0 \ , \ 1 \ )} \ = \ 2·(-1) + 0 \ \mathbf{= \ -2} \ \ . $
With  $ \ y \ \neq \ 0 \ \ , $ we have $ \ 1 - \alpha - \beta  \ = \ 1 - \frac{1}{x \ - \ z} - \beta  \ = \ 0 \ \Rightarrow \ \beta \ = \ 1 - \frac{1}{x \ - \ z} \ \ . $  As the third equation gave us $ \ \beta \ = \ -2\alpha z  \ \  ,  $ we obtain $ \ \frac{x \ - \ z \ - \ 1}{x \ - \ z} \ = \ -\frac{2·z}{x \ - \ z}  \ \Rightarrow \ x - z \ = \ 1 - 2z \ \Rightarrow \ z \ = \ 1 - x \ \ . $  Inserting this into the constraint parabolic-cylinder equation  yields
$$ x \ + \ y^2 \ + \ ( \ 1 \ - \ x \ ) \ \ = \ \ 0 \ \  \Rightarrow \ \ y^2 \ \ = \ \ -1 \ \ . $$
As this is impermissible for coordinate values, the only two extrema are those found above. We can see this in the graph below:  the constraint sphere in orange and   the constraint skewed-parabolic cylinder $ \ x + y^2 + z \ = \ 0 \ \ $ [in yellow] intersect on a three-dimensional curve.  However, the level-surfaces   $ \ f(x,y) \ = \ x + y^2 \ = \ c \ $ are (upright) parabolic cylinders which are only tangent to this curve when the vertex of the parabolic cross-section lies at $ \ x \ = \ -1 \ , \ y \ = \ 0 \ \ [ \ c \ = \ -2 \ ] \ \ $  or  $ \ x \ = \ +1 \ , \ y \ = \ 0 \ \ [ \ c \ = \ +2 \ ] \ \ . $

