TITLE: A plausible inequality
QUESTION [8 upvotes]: I come across the following problem in my study. 
Let $x_i, y_i\in \mathbb{R}, i=1,2,\cdots,n$ with $\sum\limits_{i=1}^nx_i^2=\sum\limits_{i=1}^ny_i^2=1$, and $a_1\ge a_2\ge \cdots \ge a_n>0 $. Is it true $$\left(\frac{\sum\limits_{i=1}^na_i(x_i^2-y_i^2)}{a_1-a_n}\right)^2\le 1-\left(\sum\limits_{i=1}^nx_iy_i\right)^2~~?$$
Has anyone seen this inequality before, or can you give a counterexample?

REPLY [5 votes]: The following proof is a bit heavy-handed; I'm sure you it can be simplified.  Assume $a_1=1, a_n=0$ as suggested above and write:
Write $$F(x,y) = \sum_{i=1}^n a_i(x_i^2-y_i^2)$$, $$G(x,y)=F(x,y)^2+\langle x,y\rangle^2.$$
Let $(x,y)\in S^{n-1}\times S^{n-1}$ be a point where $G$ is maximized, where we may assume that for each $i$ at least one of $x_i,y_i$ is non-zero.  It is clear that $-\sum_i y_i^2 \leq F(x,y) \leq \sum_i x_i^2$ so we may also assume $\langle x,y\rangle \neq 0$.
By the method of Lagrange multipliers there exist $\xi,\eta$ such that for all $i$
$$  4a_i x_i F+2\langle x,y\rangle y_i=2\xi  x_i$$ and
$$ -4a_i y_i F+2\langle x,y\rangle x_i=2\eta y_i.$$
Multiplying the first equation by $x_i$, the second by $y_i$, adding the two and summing over $i$ gives
$ 4G = 2(\xi+\eta)$.  Multiplying the second equation by $y_i$, the first by $x_i$ and adding gives $$ \langle x,y\rangle (y_i^2+x_i^2) = (\xi+\eta)x_i y_i = 2G\cdot x_i y_i. $$  By assumption one of $x_i,y_i$ is non-zero.  Dividing by the square of that number we see that the quadratic $$\langle x,y\rangle t^2 - 2G t + \langle x,y\rangle = 0$$ has a real root.  Evaluating the discriminant it follows that $$ G^2 \leq \langle x,y\rangle^2 \leq 1.$$