# Proof of Cauchy-Schwarz Inequality in probability form

In my university course, we were given the following proof of the Cauchy-Schwarz Inequality:

My issue is with the last line, surely we get that:

$$|E(XY)| \leq \sqrt{E(X^2)E(Y^2)}$$ but it is not true in general that $$E(|XY|)\leq |E(XY)|$$

Any help would be much appreciated.

Simply apply what you have proved with $$X,Y$$ replaced by $$|X|,|Y|$$.