Prove $\lvert\int_a^bf \cdot g\rvert \le (\int_a^bf^2)^{1/2} \cdot (\int_a^bg^2)^{1/2}$ I'm studying from Spivak's Calculus on Manifolds and I'm trying to prove problem 1-6 which looks like Cauchy-Schwarz applied to continuous functions.
Assume $f$ and $g$ are integrable. Prove that
$$\lvert\int_a^bf \cdot g\rvert \le (\int_a^bf^2)^{1/2} \cdot (\int_a^bg^2)^{1/2}$$
 A: Consider the following integrals below:
$$Q(x)=\int_{a}^{b}(xf(t)+g(t))^2dt$$
$$A:=\int_{a}^{b}f^2(t)dt, \ B:=2\int_{a}^{b}f(t)g(t)dt, \ C:=\int_{a}^{b}g^2(t)dt$$
Expressing $Q(x)$ in terms of $A$, $B$, and $C$ yields:
$$Q(x)=\int_{a}^{b}((x^2f^2(t)+2xf(t)g(t)+g^2(t))dt$$
$$=\int_{a}^{b}x^2f^2(t)dt+2x\int_{a}^{b}f(t)g(t)dt+\int_{a}^{b}g^2(t)dt$$
$$\Rightarrow Q(x)=Ax^2+Bx+C\geq 0$$
We note for $Q(x)$, that its discriminant $\leq 0$, that is: $B^2-4AC\leq0$
Now, we can prove the above claim, that is:
$$|\int_{a}^{b}fg|\leq(\int_{a}^{b}f^2)^{1/2}\cdot (\int_{a}^{b}g^2)^{1/2}$$
By the triangle inequality for integrals, and noting $B^2-4AC\leq 0\Rightarrow |\frac B2|\leq \sqrt{AC}$, we have:
$$|\frac B2|=|\int_{a}^{b}fg|\leq(\int_{a}^{b}|f^2|)^{1/2}\cdot (\int_{a}^{b}|g^2|)^{1/2}\leq (\int_{a}^{b}f^2)^{1/2}\cdot (\int_{a}^{b}g^2)^{1/2}=\sqrt{AC}$$
A: Following the advice by angryavian, we prove that
$$<f,g>=\int_a^b f \cdot g \tag{1}$$
is an inner product on the vector space of real functions.
Positivity, definitiveness and symmetry are obvious.
$$\int_a^b f^2 \ge 0$$
$$\int_a^b f^2 = 0 \iff f=0$$
$$\int_a^b f \cdot g = \int_a^b g \cdot f$$
Additivity in the first slot:
$$<f+h,g>=\int_a^b (f+h) \cdot g$$
$$<f+h,g>=\int_a^b f \cdot g + h \cdot g$$
$$<f+h,g>=\int_a^b f \cdot g + h \cdot g$$
$$<f+h,g>=\int_a^b f \cdot g + \int_a^b h \cdot g$$
$$<f+h,g>= <f,g> + <h,g>$$
Then homogeneity in the first slot
$$<af,g>=\int_a^b af \cdot g$$
$$<af,g>=a\int_a^b f \cdot g$$
$$<af,g>=a<f,g>$$
The original statement follows from the Cauchy-Schwartz inequality and the fact that $(1)$ is an inner product on the space of real functions.
A: Assume $\int f^2 dx \ne 0$ and $\int g^2 dx \ne 0$. Let $F=f/(\int f^2 dx)^{1/2}$ and $G=g/(\int g^2 dx)^{1/2}$. Then $\int F^2 dx = 1$ and $\int G^2 dx = 1$. Then
$$
         (|F|-|G|)^2 \ge 0 \implies  |FG| \le \frac{1}{2}(|F|^2+|G|^2) \\
    \implies \int |FG|dx \le \frac{1}{2}\int |F|^2dx+\frac{1}{2}\int|G|^2 dx = 1 \\
    \implies  \frac{\int |fg|dx}{(\int |f|^2dx)^{1/2}(\int |g|^2dx)^{1/2}} \le 1 \\
    \implies \int |fg|dx \le \left(\int |f|^2dx\right)^{1/2}\left(\int|g|^2dx\right)^{1/2}
$$
