TITLE: Applications of Switching Sums and Integrals
QUESTION [16 upvotes]: Under some nice conditions, we can perform the following 'trick' of switching sums and integrals: $$\sum \int f_n(x) dx = \int \sum f_n(x) dx.$$
(We will ignore issues of convergence.) This trick can be used to prove a lot of interesting limits such as 
$$\sum_{n = 1}^{\infty} \frac{1}{\binom{2n}n} = \frac{1}3 + \frac{2\sqrt{3} \pi}{27}$$ or 
$$\sum_{n = 0}^{\infty} \frac{1}{C_n} = 1 + \frac{4 \pi}{9 \sqrt{3}}$$ where $C_n$ is the $n$th Catalan numbers. 
Are there any other interesting or surprising examples that this community is aware of?

REPLY [2 votes]: Here is a neat identity that appeared in this year's Putnam competition that also employs this trick.

Show that $$\sum_{k=1}^{\infty} \frac{(-1)^{k-1}}k \sum_{n = 0}^{\infty} \frac{1}{k2^n+1} = 1.$$

The sum is absolutely convergent by comparing it to $\sum_{n=1}^{\infty} \frac{1}{n^2}.$  Thus, we have $$\begin{align*}
\sum_{k=1}^{\infty} \frac{(-1)^{k-1}}k \sum_{n = 0}^{\infty} \frac{1}{k2^n+1} &= \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}k \sum_{n=0}^{\infty}\int_0^1 x^{k2^n} \ dx \\
&= \sum_{n=0}^{\infty} \int_0^1 \sum_{k=1}^{\infty} \frac{(-1)^{k-1}x^{k2^n}}{k} \ dx \\
&= \sum_{n=0}^{\infty}  \int_0^1 \log(1 + x^{2^n}) \ dx \\
&= \int_0^1 \sum_{n=0}^{\infty} \log(1+x^{2^n}) \ dx \\
&= \int_0^1 \log\left( \sum_{n=0}^{\infty} x^n \right) \ dx \\
&= - \int_0^1 \log(1-x) \ dx \\
&= 1.
\end{align*}$$
The fifth equality follows from the fact that every positive integer has a unique binary representation.