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.

You can use Lagrange multipliers.
We want to minimize $\sum_{i=1}^{n} x_{i}^{2}$ subject to the constraint $\sum_{i=1}^{n} x_{i} = k$. 
Set $J= \sum x_{i}^{2} + \lambda\sum_{i=1}^{n} x_{i}$. Then $\frac{\partial J}{\partial x_i}=0$ implies that $x_{i} = -\lambda/2$. Substituting this back into the constraint give $\lambda = -2k/n$. Thus $x_{i} = k/n$, as you thought.
