Compute integral of a Lebesgue measurable set Let $B \subset [0,2\pi]$ be a Lebesgue measurable set. Prove that:
$\displaystyle \lim_{n \to \infty} \int_{B} \cos(nx) dx = 0$
OK I did this assuming B is an open interval, this is pretty easy using the fact that the sine function is bounded by 1. Now I'm stuck in the general case, I'm somewhat confused by "Lebesgue measurable" I know this means that the measure is given by the outer measure i.e the infimum of the sum of all measures of open covers of B. But I'm having trouble writing it, I get confused when working with Lebesgue measurable sets. Can you please help me?
 A: hint
Re-write the integral as the following
$$ \int_0^{2\pi} \chi_B(x) \cos(nx) dx $$
where $\chi_B$ is the characteristic function of the set $B$ (so that it equals 1 on $B$ and 0 else where). 
Now, you've already proven the case where $B$ is an open interval. Now take a sequence of decreasing coverings for $B$ by finitely many disjoint open intervals. For each covering, the result is true by what you've already shown. Take the limit using dominated convergence theorem (if $B \subset C$, then $|\chi_B \cos| \leq |\chi_C \cos|$). 
A: Each Lebesgue integrable function can be approximated by a finite step function in norm. That is if $f\in L^1$ and $\varepsilon>0$ then there are intervals $I_1,\ldots,I_N$, and scalars $a_1,\ldots,a_N$ such that 
$$\int |f-\sum_{n=1}^N a_n\chi_n|<\varepsilon.$$
Where $\chi_n$ is the characteristic function on $I_n$, that is $\chi_n(x)=1$ for $x\in I_n$ and $\chi_n(x)=0$ otherwise.
Now, on each bounded interval $I$ you have already proved that $\int_I \cos(nx)dx\to 0$, hence given $\varepsilon>0$ there is a step function as above and we get
$$\limsup\left|\int_B\cos(kx)dx\right|= \limsup\left|\int (\chi_B-\sum_{n=1}^N a_n\chi_n +\sum_{n=1}^N a_n\chi_n)\cos(kx)dx\right|$$
$$\leq \limsup\int |\chi_B-\sum_{n=1}^N a_n\chi_n|dx +\limsup\left|\int\sum_{n=1}^N a_n\chi_n\cos(kx)dx\right|$$
$$\le\varepsilon + \sum_{n=1}^N |a_n|\cdot \limsup\left|\int\chi_n\cos(kx)dx\right| =\varepsilon +0.$$
From which you conclude the result since this holds for any $\varepsilon>0$. 
This works not only for $\chi_B$, but for any $f\in L^1$ - it is called the Riemann-Lebesgue Lemma. 
