How find this maximum of the $\sin^2{\theta_{1}}+\sin^2{\theta_{2}}+\cdots+\sin^2{\theta_{n}}$ 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)?$$
If you restrict in the interior of $ \tilde {\theta} = \{  ( \theta _1 , \dots , \theta _n)\mid \theta _1 + \dots + \theta _n=\pi\}$ the critical point is $ \theta _1= \dots =\theta _n$ where you get $P= n \sin^2 ( \pi/n)$.

For case $n=2$ you have found the maximum. For $n=3$, you compare the value of $P$ at the critical point and the maximum at the boundary. The maximum at the boundary is the same as the previous case namely for $n=2$. So you compare $3 \sin^2 \pi /3=9/4 &gt;2$ and you conclude the the maximum for $n=3$ is $ 9/4$.

Now you can proceed inductively comparing the critical value you get from Lagrange multipliers with the max at the boundary, which is known.
Use a Lagrange multiplier to fix the constraint. It then falls out that all $\theta_i$ are the same and the rest is easy.