Let $a_1,a_2,a_3,....a_n\geq0$ and $a_{n+1}=a_1$ with $a_1+a_2+a_3+....+a_n=2m$,then find the greatest possible value of $$\sum_{i=1}^{n}\ a_i\cdot a_{i+1}$$
I tried Cauchy-Schwarz but did not achieve success.How should I get its greatest value. Please suggest me some method.The answer given in the book is $m^2$.
The question is equivalent to proving that $$4(a_1a_2+a_2a_3+...+a_na_1) \leq (a_1+a_2+...+a_n)^2.$$
Yes, we can prove it. WLOG, let $a_1=\max \{a_1,a_2,...,a_n\}$, then $$\begin{eqnarray} 4(a_1a_2+a_2a_3+...+a_na_1) &\leq& 4a_1(a_2+a_4+a_5+...+a_n)+4a_2a_3 \\ &\leq& 4(a_1+a_3)(a_2+a_4+a_5+...+a_n) \\ &\leq& (a_1+a_2+...+a_n)^2. \text{(AM-GM)} \end{eqnarray}$$
The equality holds if and only if $a_1=a_2=m, a_3=a_4=...=a_n=0$.
Edited:
However, this argument works only if $n>3$. If $n=3$, mfl has given a counterexample such that $a_1=a_2=a_3=2m/3$. To see what is wrong, notice that if $n>3$, $a_3$ won't appear in this part of the third formula $(a_2+a_4+a_5+...+a_n)$ and the proof works well. However, once we consider $n=3$, then $a_n=a_3$ - something wrong happens. As a result, the inequality doesn't holds anymore.
For $n=1$, it is trivial, since the sum is fixed. It equals to $a_1^2=4m^2$.
For $n=2$, it is still trivial. You only need to use $\text {AM-GM}$ inequality: $$a_1a_2+a_2a_1=2a_2a_1\leq \frac{(a_1+a_2)^2}{2}=2m^2.$$ The equality holds if and only if $a_1=a_2=m$.
For $n=3$, $a_2+a_3=2m-a_1$. $$\begin{eqnarray} a_1a_2+a_2a_3+a_3a_1 &=&a_1(2m-a_1)+a_2a_3 \\ &\leq& a_1(2m-a_1)+\frac{(2m-a_1)^2}{4} \\ &=&\frac{-3a_1^2}{4}+ma_1+m^2 \\ &=&-\frac{3}{4}(a_1-\frac{2m}{3})^2+\frac{4m^2}{3} \\ &\leq& \frac{4m^2}{3}. \end{eqnarray}$$ The equality holds if and only if $a_1=a_2=a_3=\frac{2m}{3}$.