Find the maximum value of $a^2+b^2+c^2+d^2+e^2$ Find the maximum value of $a^2+b^2+c^2+d^2+e^2$ with the following condition:
i) $a\ge b\ge c\ge d\ge e\ge 0$
ii) $a+b\le m$
iii) $c+d+e \le n$
Where $m,n\ge 0$.
Playing with numbers I found that for $m=n$ we should get the maximum value is $m^2$.
 A: It seems the following.
Since a set $C$ of all sequences $(a,b,c,d,e)$ satisfying Conditions i-iii is compact, a continuous function $$f(a,b,c,d,e)= a^2+b^2+c^2+d^2+e^2$$ attains its maximum $M$ on the set $C$ at some point $p=(a, b, c, d, e)$. If $b>c$ then a point $p’=(m-c, c, c, d, e)$ also belongs to the set $M$ and $f(p’)>f(p)$, which contradicts to the maximality of $f(p)$. So $b=c$ and $a=m-c$. Similarly we can show that $d=c$ and $e=n-2c$ or $e=0$ and $d=n-c$. So we have two following cases. 
1)  $p=(m-c, c, c, c, n-2c)$. Then $m-c\ge c$ and $0\le n-2c\le c$, so $$\min\{m/2, n/2\}\ge c\ge n/3.$$  
The function $$g(c)=(m-c)^2+3c^2+(n-2c)^2=8c^2-c(2m+4n)+m^2+n^2$$ is convex (its graph is a parabola), so it attains its maximum at an end of the segment $[n/3, \min\{m/2, n/2\}]$. 
If $c=n/3$ then $g(c)=\frac 19(9m^2-6mn+5n^2)$. 
If $c=m/2$ then $g(c)=2m^2-2mn+n^2$. 
If $c=n/2$ then $g(c)=m^2-mn+n^2$. 
Compare these possible value for $f(p)=g(c)$:
$2m^2-2mn+n^2-\frac 19(9m^2-6mn+5n^2)=\frac 19(3m-2n)^2\ge 0.$
$2m^2-2mn+n^2-(m^2-mn+n^2)=m^2-mn\ge 0$ iff $m\ge n.$ But in this case $\min\{m/2, n/2\}=n/2$, and $c=m/2$ is allowed only if $n=m$, so we may skip this case. 
$\frac 19(9m^2-6mn+5n^2)-(m^2-mn+n^2)=\frac 19(3mn-4n^2)\ge 0$ iff  $m\ge (4/3)n.$
2)  $p=(m-c, c, c, n-c, 0)$. Then $m-c\ge c$ and $n-c\le c$ so $$m/2\ge c\ge n/2.$$ 
The function $$g(c)=(m-c)^2+2c^2+(n-c)^2=4c^2-c(2m+2n)+m^2+n^2$$ is convex (its graph is a parabola), so it attains its maximum at an end of the segment $[n/2, m/2]$. If $c=n/2$ or $c=m/2$ then $g(c)=m^2-mn+n^2$.
Now we can write 
The final answer. The maximum is
$\frac 19(9m^2-6mn+5n^2)$, if $m\ge (4/3)n$,
$m^2-mn+n^2$, if $(4/3)n\ge m\ge n$,
$2m^2-2mn+n^2$, if $n\ge m\ge (2/3)n$.
The case $(2/3)n>m$ is impossible, because $m/2=(a+b)/2\ge (c+d+e)/3=n/3$.
