TITLE: Cauchy-Schwarz Inequality for Integrals for any two functions clarification
QUESTION [6 upvotes]: I'm trying to work through a homework set, and it states that for any two functions, $f$ and $g$, that the following inequality holds:
$$
\int{fg} \le ||f|| \cdot ||g|| \le \frac{c}{2}||f||^2 + \frac{1}{2c}||g||^2
$$
I am confused as to how to actually utilize this inequality.  First, what does it mean to say that the integral of a product of two functions is less than a weighted sum of the squares of their individual 2-norms?  I think my confusion stems in large part to the LHS of the above equation being an indefinite integral.
Let's say that $f = f(x)$ and $g = g(x)$.  For integration between bounds $[a, b]$, is the below use the correct way to apply the inequality?
\begin{align} 
\int_a^b f(x)g(x) dx \le \sqrt{f^2(b) - f^2(a)}\cdot\sqrt{g^2(b) - g^2(a)} \ ...
\\ \le \frac{c}{2}(f^2(b)-f^2(a)) + \frac{1}{2c}(g^2(b)-g^2(a))
\end{align}
I'm at a step in my assignment, which I believe requires me to use this inequality, but I am not sure how I should apply the inequality when given a definite integral that is the product of two functions.  Is my understanding of the application misguided here?

REPLY [9 votes]: Cauchy-Schwarz says
$$
\int_Efg\,\mathrm{d}x\le\left(\int_Ef^2\,\mathrm{d}x\right)^{1/2}\left(\int_Eg^2\,\mathrm{d}x\right)^{1/2}\tag{1}
$$
where $\int_E$ is a definite integral. Then the AM-GM says that for $a,b\ge0$
$$
\sqrt{ab}\le\frac{a+b}{2}\tag{2}
$$
Applying $(2)$ to $(1)$ yields (for $c\gt0$)
$$
\begin{align}
\int_Efg\,\mathrm{d}x
&=\int_E(\sqrt{c}f)(g/\sqrt{c})\,\mathrm{d}x\\
&\le \frac c2\int_Ef^2\,\mathrm{d}x+\frac1{2c}\int_Eg^2\,\mathrm{d}x\tag{3}
\end{align}
$$