# Can a limit of an integral be moved inside the integral?

After coming across this question: How to verify this limit, I have the following question:

When taking the limit of an integral, is it valid to move the limit inside the integral, providing the limit does not affect the limits of integration?

For instance in the question, the OP is trying to determine that:

$$\lim_{n\to\infty}\int_{0}^{1}{\frac{dx}{(1+\frac{x}{n})^{n}}}=1-\rm{e}^{-1}$$

The answers to the question involve evaluating the integral and then taking the limit to prove the result; but I was wondering if it would be valid to move the integral inside the limit, that is:

$$\lim_{n\to\infty}{\int_{0}^{1}{\frac{dx}{(1+\frac{x}{n})^{n}}}}=\int_{0}^{1}{\lim_{n\to\infty}\frac{dx}{(1+\frac{x}{n})^{n}}}=\int_{0}^{1}{\frac{dx}{\rm{e}^{x}}}=\rm{e}^{0}-\rm{e}^{-1}=1-\rm{e}^{-1}$$

As required. So is this a valid technique, or is it just coincidental that this works?

-
It depends... e.g. if $f_n\longrightarrow f$ uniform, you are allowed to do so. – user127.0.0.1 Dec 8 '12 at 11:25
If $\: f_n \longrightarrow f \:$ uniformly and the interval is finite, then you are allowed to do so. $\hspace{1.2 in}$ – Ricky Demer Dec 8 '12 at 11:31

The limit can be moved inside the integral if the convergence of the integrand is uniform. In our case if $f_n(x)=(1+\frac{x}{n})^{-n}$, then $$\lim_{n\to +\infty}f_n(x)=e^{-x}=f(x)$$ We need to show that on $[0,1]$, $$\left\|f_n-f \right\|_{\infty}\to 0$$ But $$\left\|f_n-f \right\|_{\infty}=\sup_{x\in [0,1]}\left|f_n(x)-f(x)\right|= \sup_{x\in [0,1]}\left|(1+\frac{x}{n})^{-n}-e^{-x}\right|$$ We need to determine the maximum of $g_n(x)=(1+\frac{x}{n})^{-n}-e^{-x}$ on $[0,1]$ or at least show it converges to $0$.
$g_n(0)=0$, $g_n(1)=(1+\frac1n)^{-n}-e^{-1}$ and $$g_n^{\prime}(x_0)=0\Leftrightarrow (1+\frac{x_0}{n})^{-n-1}=e^{-x_0}$$ Whenever the latter is true, $g_n(x_0)=\frac{x_0}{n}$. Therefore, $$\left\|f_n-f \right\|_{\infty}=\max_{x\in [0,1]}\left|g_n(x)\right|=\max\left\{g_n(0),g_n(1),g_n(x_0)\right\}=\max\left\{0,(1+\frac1n)^{-n}-e^{-1},\frac{x_0}{n}\right\}\to 0$$ as $n\to +\infty$. Uniform convergence on $[0,1]$ is proven and the limit-integral interchange can be done