# How to prove this inequality $(\sum_i x_i y_i)^2 - \sum_i x_i^2y_i^2 \leq 1-1/n$?

How to prove this inequality: $$(x_1y_1+x_2y_2+ \cdots + x_ny_n)^2 - (x_1^2y_1^2+x_2^2y_2^2+\cdots+x_n^2y_n^2)\leq 1-\frac{1}{n},$$ where $x_i,y_i \geq 0,i=1,2,\ldots,n$, and $x_1^2+x_2^2+\cdots+x_n^2=y_1^2+y_2^2+\cdots+y_n^2=1$?

Clearly, the equality is reached when $x_i=y_i=\frac{1}{n},i=1,2,\ldots,n$.

• I think Titu's Lemma might help. – Prasun Biswas Apr 13 '15 at 11:43

By$\let\leq\leqslant$ Cauchy-Schwarz, \begin{align*}(x_1y_1+\cdots+x_ny_n)^2&\leq(x_1^2y_1^2+\cdots+x_n^2y_n^2)\cdot(1^2+\cdots+1^2)\\&=n(x_1^2y_1^2+\cdots+x_n^2y_n^2)\end{align*}\tag A and $$(x_1y_1+\cdots+x_ny_n)^2\leq(x_1^2+\cdots+x_n^2)(y_1^2+\cdots+y_n^2).\tag B$$
$\frac1n\cdot({\rm A})+(1-\frac1n)\cdot({\rm B})$ gives your inequality:
\begin{align*}(x_1y_1+\cdots+x_ny_n)^2&\leq(x_1^2y_1^2+\cdots+x_n^2y_n^2)+\left(1-\frac1n\right)(x_1^2+\cdots+x_n^2)(y_1^2+\cdots+y_n^2)\\&=x_1^2y_1^2+\cdots+x_n^2y_n^2+1-\frac1n\end{align*}