prove the Riemann-Lebesgue lemma: $\int^b_af(x)\cos(nx)dx\rightarrow 0$ as $n\rightarrow \infty$ for any regulated function $f$

I would like to prove the Riemann-Lebesgue lemma, namely that $\int^b_af(x)\cos(nx)dx\rightarrow 0$ as $n\rightarrow \infty$ for any regulated function $f$.

The textbook which I'm working from says that I need to prove 3 things in the following order:

  1. For all $a \lt b$, show that $\int^b_a\cos(nx)dx \rightarrow 0$ as $n \rightarrow \infty$
  2. By considering separately each interval of the partition, show that $\int^b_a\phi(x)\cos(nx)dx\rightarrow 0 $ as $n \rightarrow \infty$, where $\phi(x)$ is a step function on $[a,b]$
  3. Extend this to all $f \in R[a,b]$

So, here's my proof:

  1. $\int^b_a\cos(nx)dx= \frac{1}{n}\sin(nb)-\frac{1}{n}\sin(na) \rightarrow 0$ by the sandwhich rule: $$-1 \leq \sin(nx) \leq 1 \Leftrightarrow \frac{-1}{n} \leq \frac{\sin(nx)}{n} \leq \frac{1}{n} \Leftrightarrow 0 \leq \frac{\sin(nx)}{n} \leq 0 \text{ as } n \rightarrow \infty \Rightarrow \frac{1}{n}\sin(nx)=0$$ $\Rightarrow \int^b_a \cos(nx)dx \rightarrow 0$ as $n \rightarrow \infty$
  2. Let $\phi(x) \in S[a,b]$ be a step function in $[a,b]$ and let $P=\{p_0,\ldots,p_k\}$ be a compatible partition with $\phi(x)$. Then: $$\int\phi(x)\cos(nx)dx= \frac{1}{n}\phi(x)\Bigl(\sin(nb)-\sin(na)\Bigr)+ \frac{1}{n^2}cos(nx)(p_i-p_{i-1}) \rightarrow 0 \text{ as $n \rightarrow \infty$ for $x\in [p_i,p_i-1)$}$$ using IBP: $\phi(x)=u \Rightarrow (p_i-p_{i-1})dx=du$ and then $\cos(nx)dx=dv \Rightarrow \frac{1}{n}\sin(nx)=v$. Hence, If I apply the same to every interval, $\int^b_a\phi(x)\cos(nx)dx \rightarrow 0$ as $n \rightarrow \infty$ for each interval of the partition $P$.
  3. Let $\phi_n \in S[a,b]$ be a sequence of step functions converging uniformly to $f$. Then $$\lim_{n \rightarrow \infty} \int^b_a \phi_n \cos(nx)dx= \int^b_af(x)\cos(nx) \rightarrow 0$$ as $n \rightarrow \infty$ by (2)

Is my proof correct? Any help is appreciated!


Here is the correct proof of the Riemann Lebesgue lemma (in the form you gave).

Let $I_n = \int_a^b f(x)\cos(nx)dx$. Changing $x$ to $x+\frac{\pi}{n}$ gives $I_n = \int_{a-\pi/n}^{b-\pi/n} f(x+\frac{\pi}{n})\cos(nx+\pi)dx$. Noting $\cos(nx+\pi) = -\cos(nx)$, we see $$2I_n = \int_{a-\pi/n}^a -f(x+\frac{\pi}{n})dx+\int_a^{b-\pi/n} [f(x)-f(x+\frac{\pi}{n})]\cos(nx)dx+\int_{b-\pi/n}^b f(x)\cos(nx)dx.$$ Say $|f(x)| \le C$ for all $x \in [a,b]$. Then $$\left|\int_{a-\pi/n}^a -f(x+\frac{\pi}{n})dx\right| \le C\frac{\pi}{n}$$ $$\left|\int_{b-\pi/n}^b f(x)\cos(nx)dx\right| \le C\frac{\pi}{n}.$$ Also, by uniform continuity, for all $\epsilon > 0$, for $n$ large enough, $|f(x)-f(x+\frac{\pi}{n})| \le \epsilon$ for all $x \in [a,b-\frac{\pi}{n}]$, and so $$\left| \int_a^{b-\pi/n} [f(x)-f(x+\frac{\pi}{n})]\cos(nx)dx\right| \le \epsilon(b-a).$$ Therefore, for any $\epsilon > 0$, $$\limsup_{n \to \infty} |I_n| \le \frac{b-a}{2}\epsilon.$$ It follows that $I_n \to 0$, as desired.