Find the maximum of $\sum_{k=1}^n x_k^4$ Given $x_k\in\mathbb{R}$ satisfying
$$\sum_{k=1}^n x_k=0\quad\text{and}\quad\sum_{k=1}^n x_k^2=n^2-n$$
Find the maximum of
$$\sum_{k=1}^n x_k^4$$
I have notice that $\displaystyle\sum_{k=1}^n x_k=0$ implies that
$$x_m^2=\bigg(\sum_{\substack{k=1\\ k\not=m}}^n x_k\bigg)^2\leq (n-1)\sum_{\substack{k=1\\ k\not=m}}^n x_k^2=(n-1)(n^2-n-x_m^2)$$
using Chebyshev's inequality and $\displaystyle\sum_{k=1}^n x_k^2=n^2-n$. Therefore we obtain $nx_m^2\leq n(n-1)^2\Leftrightarrow x_m\leq n-1$. Hence we have
\begin{align*}\begin{split}&\sum_{k=1}^n (x_k-n+1)(x_k+1)^2\leq0\\ \Leftrightarrow \sum_{k=1}^n x_k^3 &\leq (n-3)\sum_{k=1}^n x_k^2+\sum_{k=1}^n (n-1)\quad\text{since}\;\sum_{k=1}^n x_k=0 \\ &= n(n-1)(n-2)=(n-1)^3-(n-1)\end{split}\end{align*}
since I notice that $(x_k+1)^2$ would result me with an optimal, but I have no idea why is it so. Now using a similar approach, we find that
\begin{align*}\begin{split}&\sum_{k=1}^n (x_k^2-(n-1)^2)(x_k+1)^2\leq0 \\ \Leftrightarrow \sum_{k=1}^n x_k^4 &\leq-2\sum_{k=1}^n x_k^3+(n^2-2n)\sum_{k=1}^n x_k^2+\sum_{k=1}^n (n^2-2n+1)\\ &=-2\sum_{k=1}^n x_k^3+(n^2-2n)(n^2-n)+n(n^2-2n+1)\end{split}\end{align*}
and I have no idea to how to proceed from here since I do not know the minimum of $\displaystyle\sum_{k=1}^n x_k^3$ but I would like to give a guess that the maximum of $\displaystyle\sum_{k=1}^n x_k^4$ is $(n-1)^4+(n-1)$.

It looks smart at the first glance to use $(x_k^2-(n-1)^2)(x_k+1)^2\leq0$, but it would not get you to anywhere. In this case the equity holds at $x_1=1-n$, and $x_2=\cdots=x_n=1$, therefore we obtain $x_m\geq1-n$, hence we have
\begin{align*}\begin{split}&\qquad\qquad\sum_{k=1}^n (x_k+n-1)^2(x_k-1)^2\geq 0\\ \therefore \sum_{k=1}^n x_k^4 &\leq (4-2n)\sum_{k=1}^n x_k^3-(n^2-6n+6)\sum_{k=1}^n x_k^2-\sum_{k=1}^n (n^2-2n+1)\\ &\leq (4-2n)(-(n-1)^3+(n-1))-(n^2-6n+6)(n^2-n)-n(n^2-2n+1)\\ &= n^4-4n^3+6n^2-3n=(n-1)^4+(n-1)\end{split}\end{align*}
Not too sure if this is the solution since the inequality is flip yet I have no reason for that, maybe it is because of the $x_k^3$. Another thing to consider is that $x_m\geq1-n\Leftrightarrow x_m^3\geq(1-n)^3=-(n-1)^3$, one may also try using the fact that $x_m^3+(n-1)^3\geq0$.
