TITLE: How find this maximum of the $\sin^2{\theta_{1}}+\sin^2{\theta_{2}}+\cdots+\sin^2{\theta_{n}}$
QUESTION [11 upvotes]: Question:

let $\theta_{1},\theta_{2},\cdots,\theta_{n}\ge 0$,and such
$$\theta_{1}+\theta_{2}+\theta_{3}+\cdots+\theta_{n}=\pi$$
find the $P$ the maximum of value $P(n)$
$$P=\sin^2{\theta_{1}}+\sin^2{\theta_{2}}+\cdots+\sin^2{\theta_{n}}$$

Find the closed $P(n)$
I found this
when $n=2$
then
$$P=\sin^2{\theta_{1}}+\sin^2{\theta_{2}}=1-\dfrac{1}{2}(\cos{2\theta_{1}}+\cos{2\theta_{2}})=1-\cos{(\theta_{1}+\theta_{2})}\cos{(\theta_{1}-\theta_{2})}=1+\cos{(\theta_{1}-\theta_{2})}\le 2$$
when $\theta_{1}=\theta_{2}=\dfrac{\pi}{2}$.
so
$$P(2)=2$$
and for general $n$,maybe have use other methods,Thank you

I guess we can prove
$$P(3)=P(4)=P(5)=\cdots=P(n)?$$

REPLY [3 votes]: We are told to find the maximum $\sigma_n$ of
$$f(\theta):=\sum_{k=1}^n\sin^2\theta_k$$
on the $(n-1)$-dimensional simplex
$$S:=\{\theta=(\theta_1,\ldots,\theta_n)\ |\ \theta_k\geq0, \quad \theta_1+\ldots+\theta_n=\pi\}\ .$$
Claim: One has (trivially) $\sigma_2=2$, and $\sigma_n={9\over 4}$ $(n\geq3)$. The latter value is realized by $\theta_k={\pi\over3}$ for $1\leq k\leq 3$ and $\theta_k=0$ for $k>3$.
Proof. Since the function $t\mapsto\sin^2 t$ has  inflection points at $t={\pi\over4}$ and $t={3\pi\over4}$ we have to envisage a great number of conditionally stationary points of $f$, most of them on $\partial S$. In order to avoid these complications we only look at two variables at a time and make use of the inherent symmetry of the problem.
From
$$h(\theta_1,\theta_2):=\sin^2\theta_1+\sin^2\theta_2=1-\cos(\theta_1+\theta_2)\cos(\theta_2-\theta_1)$$
we can draw the following conclusions:
(I) When $\theta\in S$ and $0<\theta_1\leq\theta_2<{\pi\over4}$ then $\cos(\theta_1+\theta_2)>0$. Therefore the value of $h$ can be increased by replacing $(\theta_1,\theta_2)$ by $\theta_1':=0$, $\theta_2':=\theta_1+\theta_2$, and the corresponding point $\theta':=(\theta_1',\theta_2',\theta_3,\ldots,\theta_n)$ is still feasible.
(II) When $\theta\in S$ and ${\pi\over4}\leq\theta_1<\theta_2$ then $\cos(\theta_1+\theta_2)<0$. Therefore the value of $h$ can be increased by replacing $(\theta_1,\theta_2)$ by $\theta_1':=\theta_2':={\theta_1+\theta_2\over2}$,  and the corresponding point $\theta':=(\theta_1',\theta_2',\theta_3,\ldots,\theta_n)$ is still feasible.
Consider now a point $\theta=(\theta_1,\ldots,\theta_n)\in{\rm argmax}_S(f)$. Then the fact (I) implies that one has $0<\theta_k<{\pi\over 4}$ for (a) no $k$ or (b) exactly one $k$, because otherwise there would be a point $\theta'\in S$ with $f(\theta')>f(\theta)$. In a similar way the fact (II) implies that all $\theta_k\geq{\pi\over4}$ have the same value. Let there be $r\in\{2,3,4\}$ of them. 
Case (a): When $r=2$  we have $\theta_1=\theta_2={\pi\over2}$, which leads to $f(\theta)=2<{9\over4}$.  When $r=3$  we arrive at the case described in the claim. When $r=4$ we arrive at $f(\theta)=2$ again.
Case (b): Let $\theta_1:=\alpha\in\ \bigl]0,{\pi\over4}\bigr[\ $. Then we have to study the auxiliary functions
$$g_2(\alpha):=\sin^2\alpha+2\sin^2{\pi-\alpha\over2},\qquad g_3(\alpha):=\sin^2\alpha+3\sin^2{\pi-\alpha\over3}$$
in the interval $0<\alpha<{\pi\over4}$. It turns out that $g_2$ is monotonically increasing  and $g_3$ monotonically decreasing in this interval (as expected). This implies that case (b) contains no points $\theta\in{\rm argmax}_S(f)$.