Let f(x1,x2,…,xn)=(n−1)(x12+x22+⋯+xn2)+nx1x2…xn. Assuming 0≤x1≤x2≤⋯≤xn, we first show that
f(x1,x2,…,xn)≥f(x1,(x2+xn)/2,x3,…,xn−1,(x2+xn)/2).
To begin with, notice that xn≥1, to get
f(x1,x2,…,xn)−f(x1,(x2+xn)/2,x3,…,xn−1,(x2+xn)/2)=41(x2−xn)2(2(n−1)−nx1x3⋯xn−1)≥41(x2−xn)2(2(n−1)−nx1x3⋯xn−1xn).
We now show that x1x3⋯xn−1xn≤2(n−1)/n, so the difference above is indeed non-negative. Notice first that
n=x1+x2+⋯+xn≥2x1+x2+⋯+xn≥(n−1)(2x1x3⋯xn−1xn)1/(n−1),
so x1x3⋯xn−1xn≤nn−1/(2(n−1)n−1). Since nn−1/(2(n−1)n−1)≤2(n−1)/n, n≥2, the conclusion follows. (The latter follows from the well-known fact that the sequence un=(1+1/n)n+1, n≥1, is decreasing, so un≤u1=4, n≥1; that un decreases is easily seen by Bernoulli's inequality: n2(n+1)/(n2−1)n+1=(1+1/(n2−1))n+1≥1+(n+1)/(n2−1)=n/(n−1), n≥2.)
Consequently, the value of f does not increase when the largest and the second smallest of the xk is replaced by their arithmetic mean. It follows that f achieves its minimum when n−1 of the xk are all equal to some x, and the smallest of the xk is n−(n−1)x. (That f actually achieves a minimum subject to the stated conditions follows by a standard compactness argument which may be assumed without proof.) Since the xk are all non-negative, and n−(n−1)x is the smallest among them, it follows that 1≤x≤n/(n−1).
So we have to minimise the polynomial function
g(x)=(n−1)((n−(n−1)x)2+(n−1)x2)+n(n−(n−1)x)xn−1
on the closed interval 1≤x≤n/(n−1). To this end, recall the guess made in the beginning, to evaluate
g(x)−n2=n(n−(n−1)x)(x−1)2k=1∑n−2(xk−1+xk−2+⋯+1)≥0,
1≤x≤n/(n−1). Equality holds if and only if x=1 or x=n/(n−1), whence the conclusion.