How to maximize $\sum x_i\times x_j$ as $1\leq i,j\leq n$ with $i\neq j$ subject to $\sum x_i=1$? I want to maximize $$\sum_{i,j \in [n], i \ne j} x_i \times x_j$$ where $\forall i ~~$ $0\le x_i \le 1$ and $x_1 + x_2 + x_3 + \ldots +x_n = 1$
I want to prove that the sum will be maximized when $\forall i ~~$ $x_i = \frac{1}{n}$. I don't know whether this statement is true or not.
Note:-
It would be more helpful if you can prove that using shifting of weights from one $x_i$ and $x_j$. Even the proof is not following that method it is fine.

If you take the derivative wrt $x_i$ you get, for each $i$
$$ \sum_{j=1}^n x_j-x_i-\lambda=0\implies x_i=1-\lambda$$
where $\lambda$ is the Lagrange multiplier. This means that all the $x_i$ need to take the same value. Adding the $n$ FOC's results in
$$ 1=n(1-\lambda)\implies \lambda=\frac{n-1}{n},$$
and, therefore, $$ x_i=\frac{1}{n}$$
