Find all global and local minimums and maximums of $f(x,y,z)=x-y+2z$ on the set $M=${$x^2+2y^2+2z^2=1$}
I have an idea to parameterize the surface with spherical coordinates:
$x=cos\phi cos \theta$
$y=\frac{1}{\sqrt2} sin\phi cos \theta$
$z=\frac{1}{\sqrt2}sin \theta$
Thus, the function is converted to
$f(\phi,\theta)=cos\phi cos \theta-\frac{1}{\sqrt2} sin\phi cos \theta+\sqrt2sin \theta$
where $phi$ from $0$ to $2\pi$, $\theta$ from $0$ to $\pi$
Then I calculate derivative of $\phi$ and $\theta$, and first gives
$cos\theta=0$ or $tg\phi=\frac{1}{\sqrt2}$
but what should I do with the theta derivative?
$x^2+2y^2+2z^2=0$ gives $x=y=z=0$ and from here: $$x-y+2z=0.$$
If $x^2+2y^2+2z^2=k>0$, so by C-S $$\sqrt{k}=\sqrt{x^2+2y^2+2z^2}=\sqrt{\frac{2}{7}}\sqrt{\left(1+\frac{1}{2}+2\right)(x^2+2(-y)^2+2z^2)}\geq$$ $$\geq \sqrt{\frac{2}{7}}\sqrt{(x-y+2z)^2}=\sqrt{\frac{2}{7}}|x-y+2z|.$$ The equality occurs for $\left(1,\frac{1}{\sqrt2},\sqrt2\right)||\left(x,-\sqrt2y,\sqrt2z\right),$ which gives $$\max_{x^2+2y^2+2z^2=k}(x-y+2z)=\sqrt{3.5k}$$ and $$\min_{x^2+2y^2+2z^2=k}(x-y+2z)=-\sqrt{3.5k}$$