<s>[INST] Difficulty finding Lagrange multiplier because of $\leq$ 
Let $f: \mathbb R^3 \to \mathbb R$ be defined by $$f(x,y,z)=x-y+z$$
  and $$E:=\{(x,y,z)\in \mathbb R^{3} \mid x^2+2y^2+2z^2\leq1\}$$ Find the extrema of $f$ on $E$. 

Path: I have already proven that $E$ is compact and then defined $g_\lambda:=f-\lambda h$ where $h:\mathbb R^{3} \to \mathbb R, h(x,y,z)=x^2+2y^2+2z^2-1$ and $\lambda \in \mathbb R$
Setting $0=\nabla g_{\lambda}(x,y)=\begin{pmatrix}
1-2\lambda x\\
-1-4\lambda y\\
1-4\lambda z
\end{pmatrix}$ while $x^2+2y^2+2z^2\leq1$(*)
It follows that: $\frac{1}{2}=\lambda x, -\frac{1}{4}=\lambda y,\frac{1}{4}=\lambda z$
And this is where I get stuck: and using (*) does not help that much as all we gain from it is that: $x\leq 1, y\leq\frac{1}{\sqrt{2}}$ and $z\leq\frac{1}{\sqrt{2}}$
We could of course look at $(0,0,1),(0,\frac{1}{\sqrt{2}},0),(0,0\frac{1}{\sqrt{2}})$
But what about all the points in between? Aren't there so many points to cover in order to assess the extrema. Is there any standardized way about going about this?
That is why the "$\leq$" is causing trouble.
 [/INST] You can handle the inequality condition introducing a slack variable $\epsilon$ such that
$$
E\to x^2+2y^2+z^2+\epsilon^2 = 1
$$
and now the lagrangian formulation gives
$$
L(x,y,z,\lambda,\epsilon) = f(x,y,z) + \lambda(x^2+2y^2+z^2+\epsilon^2 -1)
$$
and the stationary conditions give
$$
\nabla L = \left\{
\begin{array}{rcl}
 2 \lambda  x+1=0 \\
 4 \lambda  y-1=0 \\
 2 \lambda  z+1=0 \\
 \epsilon ^2+x^2+2 y^2+z^2-1=0 \\
 2 \epsilon  \lambda =0 \\
\end{array}
\right.
$$
and solving gives
$$
\left[
\begin{array}{cccccc}
x & y & z & \lambda & \epsilon & f\\
 \sqrt{\frac{2}{5}} & -\frac{1}{\sqrt{10}} & \sqrt{\frac{2}{5}} & -\frac{\sqrt{\frac{5}{2}}}{2} & 0 & \sqrt{\frac{5}{2}} \\
 -\sqrt{\frac{2}{5}} & \frac{1}{\sqrt{10}} & -\sqrt{\frac{2}{5}} & \frac{\sqrt{\frac{5}{2}}}{2} & 0 & -\sqrt{\frac{5}{2}} \\
\end{array}
\right]
$$
Analyzing the solution we conclude that it is at the ellipsoid surface because $\epsilon = 0$
</s>