TITLE: Limit of definite integral of $f(x)\cos(mx)$
QUESTION [9 upvotes]: Source: Old comp./preliminary exam.
Let $f(x)$ be a Riemann integrable function on $[0,1]$. Prove that $$\lim_{m\to\infty}\int_{0}^{1}f(x)\cos(mx) \, \,dx=0$$
Thought
$(1)$ Because we don't know if $f(x)$ is differentiable, we can only use integration by part by setting $du=f(x)\, \,dx$ and $v=\cos(mx)$, the result is not quite helpful.
$(2)$ We don't know whether $f(x)\cos(mx)$ converges as $m\rightarrow \infty$ so those convergence theorems cannot be applied.
Side note: This exam assume no knowledge in measure theory and Lebesgue integral.

REPLY [12 votes]: Here is a proof that uses no Lebesgue machinery.
Fix $\epsilon > 0$.
Since $f$ is Riemann integrable on $[0,1]$, there exists a partition $P$ defined by the points $0=x_0 < x_1 < \ldots < x_N = 1$ such that
$$0 \leq \int_0^1 f(x) dx - \sum_{n=1}^{N}a_n(x_n - x_{n-1}) < \epsilon$$
where $a_n = \inf_{x \in [x_{n-1}, x_n]} f(x)$. In other words, $f$ can be approximated from below by a step function, such that the approximation error is less than $\epsilon$.
The inequality can be rewritten as
$$0 \leq \sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} (f(x) - a_n) dx < \epsilon$$
Therefore,
$$\begin{aligned}
\left|\sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} (f(x) - a_n) \cos(mx) dx\right|
& \leq \sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} |f(x) - a_n| dx \\
&= \sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} (f(x) - a_n) dx \\
&< \epsilon
\end{aligned}$$
Now, we compute
$$\left|\int_{x_{n-1}}^{x_n}a_n \cos(mx) dx\right| = \frac{|a_n|}{m}\left|\sin(mx_n) - \sin(mx_{n-1})\right| \leq \frac{2|a_n|}{m}$$
Now choose $m$ large enough that $\displaystyle \frac{2|a_n|}{m} < \frac{\epsilon}{N}$ for all $1 \leq n \leq N$. We then can conclude that
$$\begin{aligned}
\left|\int_{0}^{1}f(x)\cos(mx)dx\right| &= 
\left|\sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} f(x)\cos(mx) dx\right| \\
&\leq \left|\sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} (f(x) - a_n)\cos(mx) dx\right|
+ \left|\sum_{n=1}^{N}\int_{x_{n-1}}^{x_n} a_n \cos(mx) dx\right| \\
&\leq \epsilon + N\left(\frac{\epsilon}{N}\right) \\
&= 2\epsilon
\end{aligned}$$