We are asked to find the maximum of $$f(x,y,z) = x+2y+3z$$ in the region in $\mathbb R^3$ where $$g(x,y,z) = x^2 +y^2 +z^2\leq w$$ as a function of w.
I've found the critical point (1,2,3) and their value for f. I've then taken the g term and singled out the x value, replacing x in f with the new value for x. I subsequently took the partial derivative of both y and z.
The answer I get is that y=z.
I put this into g and find a critical point, where the value of f is: $$f(w-5y^2, h^{-1/2}, h^{-1/2}) = w-5y^2 + 5h^{-1/2}$$ where $$h=({w-2y^2-3z^2})^{-1/2}$$
How is possible to determine the maximum from that?
We have a function $f(x,y,z)=x+2y+3z$ as well as a constraint $g(x,y,z)=x^2+y^2+z^2=w$.
Then we set $\nabla f=\lambda\nabla g$: $$1=2\lambda x$$ $$2=2\lambda y$$ $$3=2\lambda z$$
We get: $$x=\frac{1}{2\lambda}$$ $$y=\frac{1}{\lambda}$$ $$z=\frac{3}{2\lambda}$$
Substituting, we get: $$(\frac{1}{2\lambda})^2+(\frac{1}{\lambda})^2+(\frac{3}{2\lambda})^2=w$$ which gives $$\lambda=\pm\sqrt{\frac{14}{4w}}$$
So we have either $$(x,y,z)=(\sqrt{\frac{w}{14}},2\sqrt{\frac{w}{14}},3\sqrt{\frac{w}{14}})$$ or $$(x,y,z)=(-\sqrt{\frac{w}{14}},-2\sqrt{\frac{w}{14}},-3\sqrt{\frac{w}{14}})$$
It's clear that $f$ evaluated at the first of these two points is our maximum.