Find the maximum value of 2x + 2y + z on the sphere of radius 1 at the origin.
So your constraint is $\displaystyle \diaplystyle x^2+y^2+z^2=1$
Now find: $\displaystyle \displaystyle \triangledown f \ \mbox{and} \ \lambda\triangledown g$
Then set the i, j, and k components equal to each other of f and g where f is the function and g is the constraint.
I am just typing this up so I can see it.
$\displaystyle \displaystyle \triangledown f=2i+2j+k \ \mbox{and} \ \lambda\triangledown g=\lambda 2xi+\lambda 2yj+\lambda 2zk$
$\displaystyle \displaystyle 2=2x\lambda\rightarrow \lambda=\frac{1}{x}$
$\displaystyle \displaystyle 2=2y\lambda\rightarrow y=x$
$\displaystyle \displaystyle 1=2z\lambda\rightarrow z=\frac{x}{2}$
$\displaystyle \displaystyle x^2+x^2+\left(\frac{x}{2}\right)^2=1\rightarrow \frac{9x^2}{4}=1\rightarrow x=\pm \frac{2}{3}$
Since we want the max, we take the positive value.
$\displaystyle \displaystyle x=y=\frac{2}{3} \ \mbox{and} \ z=\frac{2}{6}$
Now plug into f.
Since the value of $\displaystyle \lambda$ is not part of the solution, you can often simplify by first eliminating $\displaystyle \lambda$ by dividing one equation by another.
Here, you have $\displaystyle 2= 2\lambda x$ and $\displaystyle 2= 2\lambda y$ so, dividing the first by the second,
$\displaystyle \frac{2}{2}= \frac{2\lambda x}{2\lambda y}$ so that
$\displaystyle 1= \frac{x}{y}$ or y= x. Similarly, dividing $\displaystyle 2= 2\lambda x$ by $\displaystyle 1= 2\lambda z$ gives x= 2z.
Putting those into $\displaystyle x^2+ y^2+ z^2= 1$ gives $\displaystyle 4z^2+ 4z^2+ z^2= 9z^2= 1$.