# A question about the proof of Schwarz inequality

There are many proofs of the Cauchy-Schwarz inequality, here's one of them: Consider the following quadratic polynomial: $$f(x)=\left(\sum_{i=1}^{n} a_i^2 \right)x^2-2\left(\sum_{i=1}^{n} a_ib_i \right)x+\sum_{i=1}^{n} b_i^2=\sum_{i=1}^{n} (a_ix-b_i)^2.$$ Since $f(x)\geqslant0$ for all $x\in\Bbb R$, it follows that the discriminant of $f(x)$ is negative, i.e., $$\left(\sum_{i=1}^{n}a_ib_i\right)^2-\left(\sum_{i=1}^{n}a_i^2\right)\left(\sum_{i=1}^{n}b_i^2\right)\leqslant0$$ Therefore: $$\left(\sum_{i=1}^{n}a_i^2\right)\left(\sum_{i=1}^{n}b_i^2\right)\geqslant\left(\sum_{i=1}^{n}a_ib_i\right)^2.$$

the question is: why are we able to say :"Since $f(x)\geqslant0$ for all $x\in\Bbb R$, it follows that the discriminant of $f(x)$ is negative" ??

• Becuase $x^2 \geq 0$ for all $x$. Meaning the parabola either has one root or the two roots are complex which means the discriminant is negative.
– user139708
Mar 25, 2015 at 17:05
• @ProbabilityGuy i am sorry but its not x^2 that is positive, it is ax^2+bx+c which is positive or null,any comments?(i still did not get your point)
– HHH
Mar 25, 2015 at 17:09
• @haidar $f$ can be expressed as the sum of $(a_i x - b_i)^2$, each of these terms are non negative as ProbabilityGuy pointed out and the sum of non negative terms is non negative Mar 25, 2015 at 19:12

The discriminant $D=B^2-4AC$ of a quadratic poinomial $Ax^2+Bx+C$ is the thing you take the square root of to find the two roots. Thus
• $D>0$ corresponds to two distinct real roots
• $D=0$ corresponds to a double real root
• $D<0$ corresponds to two distinct complex roots.
If $f(x)\ge 0$ for all $x$, there are certainly not two distinct real roots (between which it would have a different sign then outside). We conclude $D\le 0$.
More down-to-earth you might notice that $$f(x)=Ax^2+Bx+C=A\left(x+\frac B{2A}\right)^2-\frac{B^2-4AC}{4A}$$ and if $A>0$ this is $\ge -\frac{B^2-4AC}{4A}$ with equality at $x=-\frac B{2A}$, so we better have $-\frac{B^2-4AC}{4A}\ge0$ if we want $f(x)\ge0$ for all $x$.
We are not able to say that the discriminant of $f(x)$ is negative. Look at exactly what you wrote:"Since $f(x) \ge 0$ for all x∈R, it follows that the discriminant of f(x) is negative, i.e., $$\left(\sum_{i=1}^{n}a_ib_i\right)^2-\left(\sum_{i=1}^{n}a_i^2\right)\left(\sum_{i=1}^{n}b_i^2\right)\leqslant0$$. This inequality does not follow from what you said (i.e. it is not a strict inequality, which your statement implies). We don't know the discriminant is negative, it could be $0$. We know it can't be positive, for then the quadratic would have two real roots, but since $f(x) \ge$ $0$ $\forall$ $x$ $\in \mathbb{R}$, it can have at most 1 real root.