Derive Cauchy-Bunyakovsky by taking expected value In my notes, it is said that taking expectation on both sides of this inequality $$|\frac{XY}{\sqrt{\mathbb{E}X^2\mathbb{E}Y^2}}|\le\frac{1}{2}\left(\frac{X^2}{\mathbb{E}X^2}+\frac{Y^2}{\mathbb{E}Y^2}\right)$$ can lead to the Cauchy-Bunyakovxky (Schwarz) inequality $$\mathbb{E}|XY|\le\sqrt{\mathbb{E}X^2\mathbb{E}Y^2}$$ I am not really good at taking expected values, may anyone guide me how to go about it?
Note: I am familiar with the linearity and monotonicity of expected values, what I am unsure about is the derivation that leads to the inequality, especially when dealing with double expectation.
Thanks.

Hint. All you need to know here is that expected value is linear, i.e. for arbitrary random variables $X,Y$ and all $a,b\in \mathbb{R}$ $$\mathbb{E}(aX+bY)=a\mathbb{E}X +b\mathbb{E}Y.$$
Is this a fact you are familiar with?

Monotonicity is also important. Once you have $X\le Y$, then you also know that $\mathbb{E}X\le\mathbb{E}Y.$ This is exactly the case you are dealing with. For now, you have that one random variable (namely $\frac{\vert XY\vert}{\sqrt{\mathbb{E}X^2\mathbb{E}Y^2}}$) is not greater than the other. If you take the expected value of both sides then the inequality will remain true. It will be essentially the Cauchy-Schwarz you are looking for.
