# Upper bound to sum of squares using given sum

If $$\sum_{i = 1}^n a_i = x$$ for $$a_i \geq 0$$, then is it possible to find upper bound to $$\sum_{i=1}^n a_i^2$$? I know that the lower bound can be easily determined using Cauchy- Schwarz Inequality. But how to derive the upper bound?

• Welcome to MSE. If you want to type in italic, enclose your text between a pair of asterisks. Apr 18, 2021 at 9:43

One simple bound is $$\sum_{i=1}^{n} a_i^2 \leq \sum_{i=1}^{n}\sum_{j=1}^{n}a_ia_j = \left(\sum_{i=1}^{n} a_i\right) \left(\sum_{j=1}^{n} a_j\right) = x^2.$$ The inequality holds because the LHS is the sum of just the $$i=j$$ terms in the double sum.
This bound is achieved if and only if $$a_i a_j = 0$$ whenever $$i \neq j$$, which is true if and only if at most one of the $$a_i$$'s is nonzero.
Do you assume that $$a_i\ge 0$$ ?
Otherwise take $$a_1+a_2=0$$ with $$a_1=t$$, $$a_2=-t$$, then $$a_1^2+a_2^2=2t^2$$ has no upper bound.
• Yes $a_i \geq 0$ Apr 18, 2021 at 9:36
If you also know an upper bound on the $$a_i \ge 0$$. Then you also have: $$\sum_{i=1}^n a_i^2 \le \max_i a_i \cdot \sum_{i=1}^n a_i = x \cdot \max_i a_i$$