Proof of Cauchy-Schwarz Inequality

What we want to prove is $$ \left|\sum_{k=a}^n a_k b_k\right| \le \sqrt{\sum_{k=1}^n a_k^2 \sum_{k=1}^n b_k^2\quad{}}, $$ or equivalently $$ \left( \sum_{k=a}^n a_k b_k \right)^2 \le \sum_{k=1}^n a_k^2 \sum_{k=1}^n b_k^2. $$ We have \begin{align} A & = \sum_{k=1}^n a_k^2, \\[6pt] B & = \sum_{k=1}^n a_k b_k, \\[6pt] C & = \sum_{k=1}^n b_k^2. \end{align} So the goal is to prove $B^2\le AC$, with equality only if there is some scalar $x$ such that $x(a_1,\ldots,a_n)=(b_1,\ldots,b_n)$.

Notice that since $A=a_1^2+\cdots+a_n^2$, $A$ cannot be negative. Then notice that $$ \left( x + \frac B A \right)^2\qquad \begin{cases} =0 & \text{if }x=-B/A, \\[6pt] > 0 & \text{if }x\ne -B/A. \end{cases} $$ Consequently $$ A x^2 + 2Bx + C \qquad\begin{cases} = \dfrac{B^2-AC} A & \text{if }x=-B/A, \\[6pt] >\dfrac{B^2-AC} A & \text{if }x\ne B/A. \end{cases} $$ Thus the smallest possible of $Ax^2+2Bx+C$ is $\dfrac{B^2-AC} A$.

The smallest possible value cannot be negative since $Ax^2+2Bx+C$ is a sum of squares: $$ Ax^2+2Bx+C = (a_1 x+b_1)^2+\cdots+(a_n x+b_n)^2. \tag 1 $$ Hence $\dfrac{B^2-AC} A\le 0$. Since $A>0$, this implies $B^2-AC\le 0$, which was to be proved.

We can have $B^2-AC=0$ only if for some $x$, the sum in $(1)$ is $0$. But that can happen only if every term in the sum is $0$, and that implies that for some $x$ we have $x(a_1,\ldots,a_n)=(b_1,\ldots,b_n)$.


Hint. You may write $$ f(x)=Ax^2+2Bx+C $$ then $$ f'(x)=2Ax+2B=2(Ax+B) $$ and consider solutions $x$ of $$f'(x)=0.$$