# How to get this upper bound of this sum of squares?

Given n non-negative values. Their sum is k.

$x_1+x_2+⋯+x_n=k$

Given the constraints

$x_i \leq \sqrt{k}$ (thus, $n \geq \sqrt{k}$)

Is it possible to prove that

$x_1^2 + x_2^2 + ... + x_n^2 \leq k\sqrt{k}$

Thanks!

• I tried but couldn't figure it out – Pinch Feb 15 '15 at 0:40

For all $1 \leq i \leq n$ we have:

$$x_i \leq \sqrt{k}$$

So (because $x_i$ is non-negative):

$$x_i^2 \leq x_i\sqrt{k}$$

Add inequalities for all $i$, we get:

$$x_1^2 + x_2^2 + ... + x_n^2 \leq (x_1 + x_2 + ... + x_n)\sqrt{k}=k\sqrt{k}$$

• Good solution. But why not go directly from $x_i \leq \sqrt{k} \to x_i^2 \leq x_i \sqrt{k}$ ? – Winther Feb 15 '15 at 1:06
• Very good remark, thank you. – agha Feb 15 '15 at 1:11

Suppose $0<x_i\le x_j < \sqrt{k}$. Then $$x_i^2+x_j^2<(x_i-\varepsilon)^2+(x_j+\varepsilon)^2$$ whenever $\varepsilon$ is sufficiently small. This proves that we want to have as much $\sqrt{k}$ as we can, and $k\sqrt{k}$ is clearly the best case.

Holder's inequality gives for nonnegative values $$x_1 \cdot x_1 + \cdots + x_n \cdot x_n \leq \left( \max_i x_i \right) \left( x_1 + \cdots x_n \right)$$ from which the desired result clearly follows.