TITLE: When can a sum and integral be interchanged?
QUESTION [191 upvotes]: Let's say I have $\int_{0}^{\infty}\sum_{n = 0}^{\infty} f_{n}(x)\, dx$ with $f_{n}(x)$ being continuous functions. When can we interchange the integral and summation? Is $f_{n}(x) \geq 0$ for all $x$ and for all $n$ sufficient? How about when $\sum f_{n}(x)$ converges absolutely? If so why?

REPLY [35 votes]: While most of the time I would use the Fubini/Tonelli conditions, the dominated convergence theorem is actually strictly stronger in this mixed sum/integral case, because it can take into account the order structure of the integers. An example (that I first worked up back in [2009])(http://artofproblemsolving.com/community/c7h294262p1593291):
Consider the calculation
\begin{align*}\ln 2 &= \int_0^1 \frac1{1+x}\,dx = \int_0^1\sum_{n=0}^{\infty} (-1)^n x^n\,dx\\
?&= \sum_{n=0}^{\infty}\int_0^1(-1)^n x^n\,dx = 1-\frac12+\frac13-\frac14+\cdots\end{align*}
Fubini's theorem isn't strong enough to justify the interchange. If we put absolute values on the terms, it blows up to $\int_0^1 \frac1{1-x}\,dx = 1+\frac12+\frac13+\frac14+\cdots=\infty$.
On the other hand, the dominated convergence theorem cares about the partial sums $\sum_{n=0}^{N}(-1)^n x^n$. By the alternating series estimate,
$$0\le \sum_{n=0}^{N}(-1)^n x^n\le 1$$
for all $x\in [0,1]$. $1$ is integrable on this interval, and the interchange
$$\int_0^1\left(\lim_{N\to\infty}\sum_{n=0}^{N}(-1)^n x^n\right)\,dx = \lim_{N\to\infty}\int_0^1 \sum_{n=0}^{N}(-1)^n x^n\,dx$$
is justified, proving the result $1-\frac12+\frac13-\frac14+\cdots=\ln 2$.
This situation with the dominated convergence theorem being stronger than Fubini's theorem can come up when we've got a reasonable bound on partial sums but not absolute convergence as a whole.
The monotone convergence theorem, on the other hand, is exactly the same as Tonelli's theorem - when everything's positive, either both sides are the same and finite or both sides are infinite.