Does the Cauchy-Schwartz inequality apply to integrals? The integral $\int f(t) g(t) \, \mathrm{d} t$ is like the dot product $\vec{u} \cdot \vec{v}$.

The Cauchy-Schwartz inequality is

$$ \left\lvert \vec{u} \cdot \vec{v} \right \rvert \le \left\lvert u \right\rvert \left\lvert v \right\rvert$$

Is the following true?

$$ \left\lvert \int^b_a f(t) g(t) \, \mathrm{d} t \right \rvert \le \left\lvert \int^b_a f(t) \, \mathrm{d} t\right\rvert \left\lvert \int^b_a g(t) \, \mathrm{d} t \right\rvert$$

I'd imagine that if this works it only applies for very carefully defined functions such as smooth functions and only on finite intervals.

This could be useful for integral transforms:

$$ \left\lvert \int^b_a K(s, t) f(t) \, \mathrm{d} t \right \rvert \le \left\lvert \int^b_a K(s, t) \, \mathrm{d} t\right\rvert \left\lvert \int^b_a f(t) \, \mathrm{d} t \right\rvert$$

But I don't think this applies to most common generalized functions used for such transforms.
Yes it does (although not in the way you stated):
$$\left|\int_{\mathbb{R}^n} f(x) \overline{g(x)}\,dx\right|^2 \leq \int_{\mathbb{R}^n} |f(x)|^2\,dx \cdot \int_{\mathbb{R}^n} |g(x)|^2 \,dx.$$
 https://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality#L2
Let $(\Omega,\Sigma,\mu)$ be a measure space and $f^2,g^2$ be summable ($ \int_{\Omega} f(x)^2 \, d\mu(x) &lt; \infty $). Then
$$ 2\left( \int_{\Omega} f(x)^2 \, d\mu(x) \right) \left( \int_{\Omega} g(x)^2 \, d\mu(x) \right) - 2\left( \int_{\Omega} f(x)g(x) \, d\mu(x) \right)^2 \\
= \int_{\Omega} \int_{\Omega} (f(x)^2g(y)^2+f(y)^2g(x)^2-2f(x)g(x)f(y)g(y)) \, d\mu(x) \, d\mu(y) \\
= \int_{\Omega} \int_{\Omega} (f(x)g(y)-f(y)g(x))^2 \, d\mu(x) \, d\mu(y) \geq 0, $$
since a square is nonnegative and the integral of a nonnegative number is nonnegative. Rearranging and taking the square root gives Cauchy–Schwarz for integrals. Equality holds when $ f(x)g(y)-f(y)g(x)=0 $ $\mu$-almost everywhere, which needs $f(x)=cg(x)$. This is easily the most straightforward method of proof. This applies in particular to any interval $(a,b)$ with ordinary Lebesgue measure $dx$, whether $a,b$ are finite or not.



The inequality you give does not work even for the simplest case of a function with two values: $a_1b_1+a_2b_2$ has no particular relationship with $(a_1+a_2)(b_1+b_2)$, because the difference is
$$ (a_1+a_2)(b_1+b_2)-(a_1b_1+a_2b_2) = a_1b_2+a_2b_1, $$
which can have whatever value we like: $(1-1)(1-1)-|(1)(1)+(-1)(-1)| = -2&lt;0 $, for example.