How to prove the sum of squares is minimum? Given $n$ nonnegative values. Their sum is $k$.
$$
x_1 + x_2 + \cdots + x_n = k
$$
The sum of their squares is defined as:
$$
x_1^2 + x_2^2 + \cdots + x_n^2
$$
I think that the sum of squares is minimum when $x_1 = x_2 = \cdots = x_n$. But I can't figure out how to prove it. Can anybody help me on this? Thanks.

More generally, if the objective function is strictly convex (objective is quadratic, check), the feasible region is convex (constraint is linear, check), and the problem is symmetric (i.e., the variables can be interchanged without changing the problem, check), then the global minimum has all the variables equal to each other.  (See for, example Boyd and Vandenberghe, Convex Optimization, Exercise 4.4.).  That immediately gives $x_i = \frac{k}{n}$ as well.
