Maximize $x^2+y^2+z^2$ subject to $x+2y+3z=4$ and $x,y,z\geq 0$ If $x+2y+3z=4$, then find maximum value of $x^2+y^2+z^2$, where $x,y,z\geq 0$.


My try, using Lagrange multiplier method:

$$x^2+y^2+z^2=\lambda(x+2y+3z)$$

So $\displaystyle 2x=\lambda$ and $2y=2\lambda$ and $2z = 3\lambda$

Put $\displaystyle x=\frac{\lambda}{2}\;\;,y=z\;\;,z=\frac{3}{2}$ in $x+2y+3z=4$. We get $\displaystyle \lambda = \frac{4}{7}$

So $$\displaystyle (x^2+y^2+z^2)_{\max} = \frac{164}{49}\;,$$ When $\displaystyle x=\frac{2}{7}\;\;,y=\frac{4}{7}\;\;,z=\frac{12}{7}$

Is my solution right? If not then how can we calculate it?

Thanks
After replacing the constraint $x$, $y$, $z&gt;0$ by $x$, $y$ , $z\geq0$ the feasible domain becomes a closed triangle $T$ with its vertices on the positive coordinate axes. Imagine a sphere centered at $O$, so large that it contains the triangle $T$ in its interior. Now continually shrink this sphere until it hits one of the vertices of $T$. This will be the vertex $X:=(4,0,0)$, since the other vertices are lying nearer to $O$. It follows that the point of $T$ farthest away from $O$ is $X$, and that the maximum of the given function on $T$ is $4^2=16$.
The choice of using Lagrange's multiplier is correct but your calculation seems a little correction i guess, you get  $$2x=\lambda$$$$2y=2\lambda$$$$2z=3\lambda$$
using these values you put $$x=\lambda/2$$$$y=\lambda$$$$z=3\lambda/2$$
putting these values in the constraint function you get $\lambda=4/7$
using these values you get $$x=2/7$$$$y=4/7$$$$z=12/14$$