Deriving Cauchy-Schwarz inequality for random variables

cauchy-schwarz-inequalityprobability theory

My textbook, Introduction to Probability, Second Edition, by Blitzstein and Hwang, says the following:

Theorem 10.1.1 (Cauchy-Schwarz). For any r.v.s $X$ and $Y$ with finite variances,

$$|E(XY)| \le \sqrt{E(X^2)E(Y^2)}.$$

Proof. For any $t$,

$$0 \le E(Y – tX)^2 = E(Y^2) – 2tE(XY) + t^2E(X^2).$$

Where did $t$ come from? The idea is to introduce $t$ so that we have infinitely many inequalities, one for each value of $t$, and then we can use calculus to find the value of $t$ that gives us the best inequality. Differentiating the right-hand side with respect to $t$ and setting it equal to $0$, we get that $t = E(XY)/E(X^2)$ minimizes the right-hand side, resulting in the tightest bound. Plugging in this value of $t$ we have the Cauchy-Schwarz inequality.

I substituted $t = E(XY)/E(X^2)$ as follows:

$$0 \le E(Y^2) – 2\left[ \dfrac{E(XY)}{E(X^2)}\right]E(XY) + \left[ \dfrac{E(XY)}{E(X^2)} \right]^2 E(X^2)$$

$$\begin{align} E(Y^2) – 2\left[ \dfrac{E(XY)}{E(X^2)}\right]E(XY) + \left[ \dfrac{E(XY)}{E(X^2)} \right]^2 E(X^2) &= E(Y^2) – 2\dfrac{E(XY)^2}{E(X^2)} + \dfrac{E(XY)^2}{E(X^2)} \\ &= E(Y^2) – \dfrac{E(XY)}{E(X^2)} \end{align}$$

$$\Rightarrow E(XY) \le E(Y^2)E(X^2)$$

I'm confused as to why I didn't get $|E(XY)| \le \sqrt{E(X^2)E(Y^2)}$? Did I make an error that I missed?

I would greatly appreciate it if people would please take the time to clarify this.

Best Answer

In your penultimate step, $E(XY)^2$ was mistakenly replaced with $E(XY)$.

Related Question