Cauchy-Schwarz inequality for Integrals

Suppose that the functions $\displaystyle f,g,f^2,g^2, fg $ are integrable on the closed, bounded interval [a,b]. Prove that:

$\displaystyle \int ^b _a fg \leq \sqrt { \int ^b_a f^2 } \sqrt { \int ^b_a g^2 } $.

Proof.

Now, $\displaystyle 0 \leq \sqrt { \int _a ^b (f- \lambda g)(f- \lambda g) } ^2 $$\displaystyle = \int ^b_a (f^2- \lambda fg - \lambda fg + \lambda ^2 g^2 ) $

$\displaystyle = \int ^b_a f^2 - \lambda \int ^b _a fg - \lambda \int ^b _a fg + \lambda ^2 \int ^b _a g^2 $

Choose $\displaystyle \lambda = \int _a ^b fg [ \int ^b _a g^ {2}]^{-1} $

then the previous equation becomes $\displaystyle \int ^b _a f^2 - \int ^b _a (fg)^2 [ \int ^b _a g^2 ]^{-1} - \int ^b _a (fg)^2 [ \int ^b _a g^2 ] ^{-1} + \int ^b _a (fg)^2 $

which implies $\displaystyle 0 \leq \int ^b _a f^2 - \int ^b _a (fg)^2 (2 [ \int ^b _a g^2 ]^{-1}) $

$\displaystyle \int ^b _a (fg)^2 (2 [ \int ^b _a g^2 ] ^{-1} \leq \int ^b _a f^2 $

$\displaystyle \int ^b _a (fg)^2 \leq \frac { \int ^b _a f^2 \int ^b _a g^2 } {2} $

How do I get rid of the 2 at the bottom?

Thanks.