# 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

• Do you mean "then find the maximum value of $x^2+y^2+z^2$"? – Ali Feb 21 '16 at 15:36
• Yes abi maximum of $x^2+y^2+z^2$ – juantheron Feb 21 '16 at 15:38
• I think your answer is wrong - take $x= 4-2dl$ ;$2y=dl$; $3z=dl$ You get $x^2+y^2+z^2 =$ nearly $16$ – Win Vineeth Feb 21 '16 at 15:47
• The $\lambda$ is not right, and there is no reason to think it gives a maximum. – André Nicolas Feb 21 '16 at 15:48

After replacing the constraint $x$, $y$, $z>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 maximum of this function occurs at the boundary. i.e, at $x=4, y=0, z=0$ . The maximum happens to be $16$.

If you wanted the minimum though, It occurs at $x=\frac 27; y=\frac 47; z=\frac 67$ The minimum is $\frac {56}{49}$ . It follows your own way, with a few corrections.

• To win vineeth, how can we prove that maximum occur at boundry – juantheron Feb 21 '16 at 16:06
• To finish (or rather start) your argument, you need to show the objective function is convex, on a closed compact domain, which is true. – Macavity Feb 22 '16 at 2:10

Consider the product

$$p=(x+2y+3z-4)(2x+y+6z+8)$$

Expanding $p$, we have

$$p=2x^2+2y^2+18z^2+5xy+12xz+15yz+12y-32 \geq 2x^2+2y^2+18z^2-32$$

Since $p=0$, dividing by $2$ we deduce

$$x^2+y^2+z^2 \leq x^2+y^2+9z^2 \leq 16$$

Equality is when $x=2,y=z=0$.

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$$

Your answer is clearly wrong. Put $y=z=0$ giving $x=4$, and $x^2+y^2+z^2=16$.

If $x+2y+3z=4$ then $x=4-2y-3z$. Substitute into $x^2+y^2+z^2$ giving \begin{equation*} 5y^2+10z^2+12yz-16y-24z+16 \end{equation*} as the function.

This has a MINIMUM value at $x=2/7, y=4/7, z=6/7$ using standard two-variable partial derivative methods. The maximum is unbounded.

• The maximum is bounded, because $x,y,z$ are all bounded (from $x+2y+3z=4$) – Ewan Delanoy Feb 21 '16 at 15:55
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/1665661/maximize-x2y2z2-subject-to-x2y3z-4-and-x-y-z-geq-0", "fetch_time": 1585498332000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2020-16/segments/1585370494349.3/warc/CC-MAIN-20200329140021-20200329170021-00255.warc.gz", "warc_record_offset": 596851427, "warc_record_length": 34516, "token_count": 1217, "char_count": 3234, "score": 4.25, "int_score": 4, "crawl": "CC-MAIN-2020-16", "snapshot_type": "latest", "language": "en", "language_score": 0.7718596458435059, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00051-of-00064.parquet"}