How do you find the condition where the Cauchy-Schwarz inequality is equal? 
Cauchy-Schwarz inequality: $\left| \sum\limits_{i=1}^n a_i b_i \right|^2 \leq \sum\limits_{i=1}^n |a_i|^2 \sum\limits_{i=1}^n |b_i|^2$

The answer is known to be when $a_i k + b_i = 0$ for some $k \in \mathbb{R}$, or any other equivalence (e.g. in linear algebra, when the vectors are linearly dependent).
My question is, without a priori knowledge that equality holds for Cauchy-Schwarz if and only if [condition such as $a_i k + b_i = 0$ or some equivalent condition], how do you find this condition? i.e. the question is not to prove some 'if and only if' statement, but how you go about discovering the specific condition(s) required for equality, which leads to the 'if and only if' statement.
For example, I tried experimenting with the Cauchy-Schwarz inequality in more familiar terms:
$\left| x_1 y_1 + x_2 y_2 \right|^2 = \left(\left| x_1 \right|^2 + \left| x_2 \right|^2 \right) \left( \left| y_1 \right|^2 + \left| y_2 \right|^2 \right)$
$x_1^2 y_1^2 + x_2^2 y_2^2 + 2x_1y_1x_2y_2 = x_1^2 y_1^2 + x_2^2 y_2^2 + x_1^2y_2^2 + x_2^2y_1^2$
So they are equal when $2x_1y_1x_2y_2 = x_1^2y_2^2 + x_2^2y_1^2$. But I couldn't conclude anything from this equation.
 A: You can re-write the Cauchy-Schwarz inequality (for sequences of real numbers) as:
$$
\displaystyle\sum_{i<j} (a_ib_j - a_jb_i)^2 \geq 0
$$
But squares are non-negative, and so we only have equality when all terms are zero, i.e. when 
$$
a_ib_j = a_jb_i
$$
for all $i,j$.
Verifying this alternative form is just a matter of expanding all the terms - trying it for small cases may help you to see how it works.
A: Here is an elementary point of view. You may observe that, for any $\lambda \in \mathbb{R}$,
$$
\sum_{i=1}^n \left(a_i\lambda+b_i \right)^2\geq0 \tag1
$$ is equivalent to 
$$
\left(\sum_{i=1}^n a_i^2\right)\lambda^2+2\left(\sum_{i=1}^n a_i b_i\right) \lambda+\left(\sum_{i=1}^n b_i^2\right)\geq0 \tag2
$$ which is equivalent to (one may think in terms of the discriminant of the quadratic equation)
$$
\Delta'=\left(\sum_{i=1}^n a_i b_i\right)^2-\left(\sum_{i=1}^n a_i^2\right)\left(\sum_{i=1}^n b_i^2\right)\leq 0 \tag3
$$ giving the Cauchy-Schwarz inequality. 
From $(1)$, it is clear that $\Delta'=0$ if and only if 

$$\sum_{i=1}^n \left(a_i\lambda+b_i \right)^2=0 \tag4$$ 

that is if and only if

$$
a_i\lambda+b_i=0,\quad i=1,2,\cdots. \tag5
$$

A: One way of doing it:


*

*It's simple to show that if $a=\alpha\cdot b$ where $a,b$ are vectors, then $$\langle a,b \rangle\ = \alpha \|b\|^2 = \|a\|\|b\|$$

*Let's say that $a,b$ are not linearly dependent. Then, take $b'$ to be the orthogonal projection of $b$ onto $a$. Then, $b = b' + (b-b')$ and $b-b'$ is orthogonal to $a$ and $b'$ is paralel to $a$, $b'=\alpha a$ (by definition). Also, $$\|b\|^2 = \|b'\|^2 + \|b'-b\|^2$$This means that $$\langle a,b\rangle = \langle a,b'\rangle + \langle a,b-b'\rangle = \alpha \langle a,a\rangle + 0 = \alpha \|a\|^2 = \|a\|^2 \|b'\|^2 < \|a\|^2\|b\|^2$$

