Change of variable for a limit inside Lebesgue integration? To calculate $\lim\limits_{n \to \infty } \int_A \cos (nx) \, dx $ where $A$ is a compact set, say $[0,1]$, the objective is to show the integral $\rightarrow 0$.
My question is can I first exchange the integration and limit and then do the change of variable?
Since $| \cos (nx)| \le 1$ and $1$ is measurable on $A$, so $\lim\limits_{n \to \infty } \int_A \cos (nx) \, dx  = \int_A \lim\limits_{n \to \infty } \cos (nx) \, dx $ by dominated convergence theorem. If we can do change of variable, then $t = nx$ and we have $$\int\limits_A \lim\limits_{n \to \infty } \cos (nx) \, dx  = \int\limits_A \lim\limits_{n \to \infty } \cos (t)\frac{1}{n} \, dt =0.$$
But I feel it has problem. If this is not right, what is the correct way to solve the problem? 
Added:
I realized this is wrong by Michael Hardy's comment. Now can I first do exchange of variable and then do exchange of limit and integration?
$\mathop {\lim }\limits_{n \to \infty } \int_A {\cos (nx)dx}  = \mathop {\lim }\limits_{n \to \infty } \int_A {\frac{{\cos (t)}}{n}dt}  = \int_A {\mathop {\lim }\limits_{n \to \infty } \frac{{\cos (t)}}{n}dt}  = 0$
 A: Note: My previous, deleted answer was mistaken. I apologize. I present a new proof (hopefully a correct one this time), which uses the properties of the Lebesgue measure. (As Michael Hardy's answer and the comments by zhw. demonstrated, the use of Lebesgue's dominated convergence theorem is quite elusive.)

Lemma: For any open interval $(a,b)$ (where $a$ and $b$ are real numbers such that $a<b$), one has $$\int_a^b\cos(nx)\,\mathrm d x\to0\quad\text{as $n\to\infty$}.$$
Proof: This is not very difficult: $$\int_a^b\cos(nx)\,\mathrm d x=\frac{\sin(nb)-\sin(na)}{n}\quad\text{for any $n\in\mathbb N$}.$$ Now, the numerator stays between $[-2,2]$, and the denominator diverges to infinity as $n\to\infty$. $\blacksquare$
Fix $\varepsilon>0$. Since $A$ is compact, $m(A)<\infty$ and, by the construction of the Lebesgue measure, there exist sequences of real numbers $(a_k)_{k\in\mathbb N}$ and $(b_k)_{k\in\mathbb N}$ such that


*

*$a_k<b_k$ for each $k\in\mathbb N$;

*$A\subseteq\bigcup_{k\in\mathbb N}(a_k,b_k)$;

*$m(A)\leq\sum_{k=1}^{\infty}(b_k-a_k)<m(A)+\varepsilon$.


Since $A$ is compact, the open cover $\{(a_k,b_k)\}_{k\in\mathbb N}$ has a finite subcover, so that $$A\subseteq \bigcup_{\ell=1}^{L}(a_{k_{\ell}},b_{k_{\ell}})$$ for some $\{k_1,\ldots,k_L\}\subseteq\mathbb N$ and $L\in\mathbb N$.  Letting $B\equiv\bigcup_{\ell=1}^{L}(a_{k_{\ell}},b_{k_{\ell}})$, it is not difficult to see that $B$ can be represented as a finite union of disjoint open intervals (hint: use induction on the number of intervals). This, together with the Lemma, yields that $$\int_B\cos(n x)\,\mathrm dx=0\quad\text{as $n\to\infty$.}\tag{$\clubsuit$}$$
Observe also that 
\begin{align*} 
m(B\setminus A)=&\,m(B)-m(A)=m\left(\bigcup_{\ell=1}^L(a_{k_{\ell}},b_{k_{\ell}})\right)-m(A)\leq\sum_{\ell=1}^L(b_{k_{\ell}}-a_{k_{\ell}})-m(A)\\
\leq&\,\sum_{k=1}^{\infty}(b_k-a_k)-m(A)< [m(A)+\varepsilon]-m(A)=\varepsilon.
\end{align*}
Next, for a fixed $n\in\mathbb N$, one has that
\begin{align*}
\left|\int_A\cos(nx)\,\mathrm dx\right|=&\left|\int_B\cos(nx)\,\mathrm dx-\int_{B\setminus A}\cos(nx)\,\mathrm dx\right|\leq\left|\int_B\cos(nx)\,\mathrm dx\right|+\left|\int_{B\setminus A}\cos(nx)\,\mathrm dx\right|\\
\leq&\,\left|\int_B\cos(nx)\,\mathrm dx\right|+\int_{B\setminus A}|\cos(n x)|\,\mathrm dx\leq\left|\int_B\cos(nx)\,\mathrm dx\right|+\int_{B\setminus A}\,\mathrm dx\\
=&\,\left|\int_B\cos(nx)\,\mathrm dx\right|+m(B\setminus A)<\left|\int_B\cos(nx)\,\mathrm dx\right|+\varepsilon.
\end{align*}
Given ($\clubsuit$), one has $$\limsup_{n\to\infty}\left|\int_A\cos(nx)\,\mathrm dx\right|\leq\limsup_{n\to\infty}\left\{\left|\int_B\cos(nx)\,\mathrm dx\right|+\varepsilon\right\}=\varepsilon.$$
Since $\varepsilon$ can be made arbitrarily small, it follows that $$\limsup_{n\to\infty}\left|\int_A\cos(nx)\,\mathrm dx\right|=0,$$
which implies the desired result.
A: First consider this attempt:
$$
\lim\limits_{n \to \infty } \int\limits_A \cos (nx) \, dx \overset{\Large\text{ ?}}= \int\limits_A \lim\limits_{n \to \infty } \cos (nx) \, dx  \overset{\Large\text{ ?}} = \int\limits_{nA} \lim\limits_{n \to \infty } \cos (t)\frac{1}{n} \, dt =0.
$$
Notice that the third integral is over $nA$ rather than over $A$.  That is because $x\in A$ if and only if $t = nx\in nA$.
For the first equality to hold, it is necessary that the limit inside the middle integral exists.  But consider a value of $x$ for which $\cos x=-1$.  Then $\cos(2x)=1$ and $\cos(3x)=-1$ and so on: it keeps alternating.
Let's rearrange it a bit:
$$
\lim_{n\to\infty} \int\limits_A \cos(nx)\,dx = \lim_{n\to\infty} \int\limits_{nA} \frac{\cos(t)} n \, dt. $$
We cannot write this as $\displaystyle\int\limits_{nA} \lim\limits_{n\to\infty} \cdots\cdots$ because in "$nA$" we have $n$ outside of "$\lim\limits_{n\to\infty}$".  But we can write
$$
\int\limits_{nA} \frac{\cos(t)} n \, dt = \int\limits_{-\infty}^\infty \mathbf 1_{nA}(t) \frac{\cos t} n \, dt
$$
where $\mathbf 1_{nA}$ is the indicator function of $nA$, equal to $1$ or $0$ according as its argument is or is not in $nA$.  This sequence of functions under the integral does approach $0$ for every value of $t$, so the dominated convergence theorem can be applied provided
$$
\int\limits_{-\infty}^\infty  \sup_n \left| \mathbf 1_{nA}(t) \frac{\cos t} n\right| \, dt <\infty.
$$
A: For $A=[0,1],$ you can just integrate the thing!
For more complicated $A,$ as long as $A$ is bounded, this follows from the Riemann-Lebesgue Lemma: If $f\in L^1(\mathbb R ),$ then $\lim_{x\to \infty}\int_\infty^\infty f(t)e^{ixt}\, dt = 0.$ In this problem you would take $f =\chi_A.$ The cosine integral under discussion is the real part of this integral.
