# Why is the discriminant of quadratic $f$, $\Delta \leq 0$, when $f(x) \geq 0 \forall x \in \mathbb{R}$?

I was reading a proof of the Cauchy-Schwarz inequality (elementary form). However, I was unable to understand some part of it. Here is the proof:

Proof: Consider the following quadratic polynomial $$f(x)=\sum_ {i=1}^ n (a_ix-b_i)^2=(\sum_ {i=1}^ n a_i^2)x^2-2(\sum_ {i=1}^ n a_ib_i)x+\sum_ {i=1}^ n b_i^2$$ $$\color{red}{\textrm{Since f(x) \geq 0 for any x \in \mathbb{R}, it follows that the discriminant of f(x) is negative or zero}}$$, i.e., $$4(\sum_ {i=1}^ n a_ib_i)^2-4(\sum_ {i=1}^ n a_i^2)(\sum_ {i=1}^ n b_i^2) \leq 0$$ This follows the desired inequality. $$\blacksquare$$

I am unable to understand the red part. I understand that $$f(x) \geq 0$$ for any $$x \in \mathbb{R}$$. But how does this imply that the discriminant is negative or zero?

See

$$f(x)=\sum_ {i=1}^ n (a_ix-b_i)^2$$

Clearly $$f(x)$$ will be non-negative as it is sum of squares of real some real numbers

Therefore we can write $$f(x)\geq 0$$

Now let's turn to otgere form of $$f(x)$$

$$f(x)=(\sum_ {i=1}^ n a_i^2)x^2-2(\sum_ {i=1}^ n a_ib_i)x+\sum_ {i=1}^ n b_i^2$$

Clearly this is a quadratic equation (assuming at least when $$a_i\neq 0$$)

Now coefficient of $$x^2$$ is $$\sum_ {i=1}^ n a_i^2$$ which will be always positive (under our assumption), therefore the parabola corresponding to equation will open upwards.

Three cases arise:

$$1)$$ $$D<0$$

In this case our quadratic equation will have no real roots , therefore to satisfy this condition our parabola must always be above $$x-$$ axis because if it comes a little down the x-axis then it will have to cross it ( since it will extend to $$\infty$$

) giving two real roots. Therefore parabola remains above x-axis and hence y-coordinate of all points on parabola is positive. Hence $$D<0$$ satisfies $$f(x)>0$$ for all real x

$$2)$$ $$D=0$$

In this case our quadratic equation will have repeated roots therefore the parabola will only touch x-axis while remaining above it only. therefore this condition satisfies $$f(x)\geq 0$$ for all real x

$$3)$$ $$D>0$$

Now the equation will have two real roots and therefore parabola will be below $$x-$$ axis between the roots therefore $$f(x)\ngeq 0$$ for all real x

Therefore now you can easily figure out what does red line wants to convey.

Let $$P(x)=ax^2+bx+c$$ and suppose $$P(x)\geq 0$$ for all $$x$$.

• Case 1: $$a=0$$. In this case, $$P(x)=bx+c$$ and $$P(x)\geq 0$$ for all $$x$$, so it follows $$b=0$$ (think of what the graph of a straight line looks like if $$b\neq 0$$). So, $$b^2-4ac=0$$.

• Case 2: $$a> 0$$. Then, we can complete the square, $$P(x)=a\left(x+\frac{b}{2a}\right)^2+c-\frac{b^2}{4a}$$ is $$\geq 0$$ for all $$x$$, so in particular when $$x=-\frac{b}{2a}$$, and thus $$c-\frac{b^2}{4a}\geq 0$$. Rearranging yields $$b^2-4ac\leq 0$$ (where did I use the fact $$a>0$$?).

This completes the proof (Why is case 3 of $$a<0$$ not possible?)

If $$D<0$$, this means that the quadratic has no real roots. This forces us to conclude that the graph of the function must either lie completely above, or completely below the $$x$$-axis, since it can neither touch nor intersect it. Since the coefficient of $$x^2$$ is positive, this means that the parabola must be upward-opening (because any curve of this nature is of the form $$a(x+b)^2+c$$, hence can be formed by shifting and compressing/expanding the graph of $$y=x^2$$). So it can't lie below the $$x$$-axis, hence it must lie above.