$$\begin{array}{ll} \text{minimize} & f(x,y,z) := x+2y+z\\ \text{subject to} & g(x,y,z) := x^2+y^2+z^2-1=0\end{array}$$
I get the following $\nabla f=(1,2,1)$ and $\nabla g=(2x,2y,2z)$. Now, I know that $\nabla f=\lambda \nabla g$, but I seem to get the wrong answer, since my answer is not consistent with Wolfram Alpha. Would appreciate a walkthrough.
Let the auxiliary function $F=f+\lambda g$, where $\lambda$ is the Lagrange's multiplier.
Then $F_x =1+2\lambda x=0$, which gives $\lambda=-\frac{1}{2x}$ ...(1)
$F_y =2+2\lambda y=0$, which gives $\lambda=-\frac{1}{y}$ ...(2)
$F_z =1+2\lambda z=0$, which gives $\lambda=-\frac{1}{2z}$ ...(3)
From (1), (2) and (3)
x=z and y=2z
Putting these values of x and y in g(x,y,z)
$z^2 + (2z)^2+ z^2 -1=0$
$ 6z^2=1$
$z=\pm \frac{1}{\sqrt6}$
Therefore stationary points are $(\frac{1}{\sqrt6},\frac{2}{\sqrt6},\frac{1}{\sqrt6})$ and $(-\frac{1}{\sqrt6},-\frac{2}{\sqrt6},-\frac{1}{\sqrt6})$
f$(\frac{1}{\sqrt6},\frac{2}{\sqrt6},\frac{1}{\sqrt6})=\sqrt6$ and f$(-\frac{1}{\sqrt6},-\frac{2}{\sqrt6},-\frac{1}{\sqrt6})= -\sqrt6$
Therefore, minimum value of f(x,y,z) is $-\sqrt6$.