TITLE: find the minimum of the values $\sum ij\cos{(x_{i}-x_{j})}$
QUESTION [13 upvotes]: Fix a positive integer $n$. Out of all possible $0\le x_{1}\le x_{2}\le\cdots\le x_{n}\le \pi$, find the minimum of the value of
$$F=\sum_{1\le i<j\le n}ij\cos{(x_{i}-x_{j})}$$
I have try since
$$2F=(\sum_{i=1}^{n}i\sin{x_{i}})^2+(\sum_{i=1}^{n}i\cos{x_{i}})^2-\sum_{i=1}^{n}i^2$$

REPLY [2 votes]: Let us minimize the OP expression
$$2F = \left(\sum\limits_{i=1}^n i\sin x_i\right)^2 + \left(\sum\limits_{i=1}^n i\cos x_i\right)^2 - \sum\limits_{i=1}^n i^2.\tag1$$
The stationary points of F can be defined from the system
$$\dfrac{\partial F}{\partial x_j}=0,\quad j=1,2,\dots,n,$$
or
$$j\cos x_j\left(\sum\limits_{i=1}^n i\sin x_i\right) - j\sin x_j\left(\sum\limits_{i=1}^n i\cos x_i\right) =0,\quad j=1,2,\dots,n,\tag2$$
with the solutions in the forms of

$\sin x_1 =\sin x_2 = \dots = \sin x_n =0,\; F =0,\;$ and
$\cos x_1=\cos x_2=\dots=\cos x_n=0.$

Since $\;0\le x_1\le x_2\le \dots\le x_n\le \pi,\;$ then in the second case there are $\;(n+1)\;$ stationary points with the first k zero unknowns, or
$$x^{(k)}_i = \pi \theta(i-k-\,^1\!/_2),\quad k=0,1,\dots n,\tag3$$
$$2F_k = \left(\sum\limits_{i=1}^k i -\sum\limits_{i=k+1}^n i\right)^2-\dfrac{n(n+1)(2n+1)}6,\tag4$$
where $\;\theta(t)\;$ is the Heaviside's step function.
At the same time,
$$d_k=\sum\limits_{i=1}^{k} i - \sum\limits_{i=k+1}^{n} i = \dfrac12(k^2+k-(n-k)(n+k+1)) = k^2+k-\dfrac{n^2+n}2,\tag5$$
and then from $(4)$ should
$$\min\limits_k F_k = F_{m},\quad\text{where}\quad d_{\large m\pm1}^2 \ge d_{\large m}^2. \tag6$$
Thus,
\begin{cases}
(2m^2-2m-n^2-n)^2 - (2m^2+2m-n^2-n)^2 \ge0\\[4pt]
(2m^2+6m+4-n^2-n)^2 - (2m^2+2m-n^2-n)^2 \ge0,
\end{cases}
\begin{cases}
2m^2\le n^2+n\\[4pt]
2(m+1)^2\ge n^2+n,
\end{cases}
and finally
$$\color{green}{\mathbf{\min F = \dfrac18(2m^2+2m-n^2-n)^2 -\dfrac{n(n+1)(2n+1)}{12},}}\tag7$$
where
$$\color{green}{\mathbf{m=\left\lfloor\sqrt{\dfrac{n^2+n}2}\;\right\rfloor.}} \tag8$$