In my lecture notes I've written the proof of Cauchy-Schwarz inequality as:
Let t $\in$ R and $\langle x+ty, x+ty\rangle \geq 0$, then
$\langle x+ty, x+ty\rangle $ = $\langle x, x+ty \rangle + t\langle y, x+ty\rangle$
= $\langle x, x \rangle + t \langle x, y \rangle + t \langle y, x \rangle + t^{2}\langle y, y \rangle$
= $\| x \|^{2} +2t \langle x, y \rangle + t^{2} \| y\|^{2} \geq 0$
On the second line of the proof, I wonder if I forgot to write a $t$ before $\langle x, x+ty \rangle $, and also what is $t$'s purpose in the proof?
You didn't forget a $t$ at the second line before $\langle x,x+ty\rangle$ and you have to use the fact that it is a polynomial of degree 2 in $t$ so the discriminant is $\leq 0$.