= Solution
<Uniform convergence> means that for every $\varepsilon>0$ there is $N$ such that $|s_n(x)-s(x)|<\varepsilon$ for every $x\in\mathbb R$ and every $n\geq N$. Equivalently, $\sup_x|s_n(x)-s(x)|\to0$. The nonzero constant functions $s_n=1/n$ converge uniformly to zero. In contrast, the continuous moving bumps $s_n(x)=\max(0,1-|x-n|)$ converge pointwise to zero but have supremum one for every $n$.
On the compact interval,
$$
\left|\int_{-1}^1s_n(x)\,dx-\int_{-1}^1s(x)\,dx\right|
\leq2\sup_{x\in\mathbb R}|s_n(x)-s(x)|\longrightarrow0.
$$
Thus <uniform convergence> permits the stated interchange with integration.
Choose $\boxed{s(x)=1/(1+|x|)}$. It is continuous, nonnegative and tends to zero at infinity, but its improper integral diverges logarithmically. This even choice also makes the prescribed cutoff continuous at both $n$ and $-n$: beyond either endpoint it remains at $s(n)$ for another unit of distance and then decreases as $s(n)/(|x|-n)^2$.
Inside $[-n,n]$, $s_n=s$. Outside, both functions lie between zero and $1/(n+1)$, so $\sup_x|s_n-s|\leq1/(n+1)\to0$. Nevertheless each cutoff has finite integral:
$$
\boxed{\int_{\mathbb R}s_n(x)\,dx
=2\log(n+1)+\frac{2}{n+1}\int_0^\infty\min(1,t^{-2})\,dt
=2\log(n+1)+\frac4{n+1}.}
$$
Here the value of the minimum at $t=0$ is its continuous limiting value one. This example shows that <uniform convergence> on an unbounded domain does not by itself ensure convergence of the integrals over that domain.
Back to article page