# Applications of Switching Sums and Integrals

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?

• Do you have a reference for the second identity? Seems very cool! Dec 27, 2016 at 2:50
• @ThomasGrubb: The main ideas are in this post: artofproblemsolving.com/community/c7h1116430 Dec 27, 2016 at 3:11
• Ultimately, both formulas boil down to proving that $$\sum_{n=1}^\infty\frac{(2x)^{2n}}{n^2\displaystyle{2n\choose n}} ~=~ 2\arcsin^2x.$$ Dec 27, 2016 at 4:33
• Something cute. Dec 27, 2016 at 4:55
• Dec 27, 2016 at 15:30

The standard integral representation of the Riemann zeta function,

$$\zeta(s+1)=\frac1{\Gamma(s+1)}\int_0^\infty\frac{x^s}{e^x-1}\:dx, \qquad s>0, \tag1$$

is obtained this way, using a uniform convergence, one has \begin{align} \int_0^\infty\frac{x^s}{e^x-1}\:dx&=\int_0^\infty x^s \cdot \frac{e^{-x}}{1-e^{-x}}\:dx \\\\&=\int_0^\infty x^s\cdot\sum_{n=0}^\infty e^{-(n+1)x}\:dx \\\\&=\sum_{n=0}^\infty\int_0^\infty x^s e^{-(n+1)x}\:dx \\\\&=\sum_{n=0}^\infty\frac1{(n+1)^{s+1}}\int_0^\infty u^s e^{-u}\:du \\\\&=\sum_{n=1}^\infty\frac1{n^{s+1}}\cdot\Gamma(s+1) \\\\&=\Gamma(s+1)\cdot \zeta(s+1). \end{align} This integral representation yields many consequences concerning the Riemann zeta function, one of them being the functional equation $$\zeta(s) = 2^s\pi^{s-1}\ \sin\left(\frac{\pi s}{2}\right)\ \Gamma(1-s)\ \zeta(1-s), \qquad s \in \mathbb{C}, \,s \neq 1. \tag2$$

• Curious to know how you get the functional equation from $\int_0^\infty \frac{x^{s-1} }{e^x-1}dx$ Dec 27, 2016 at 21:28
• Tom Apostol, Introduction to Analytic Theory, theorem 12.6, pp. 257-259. We have even more since this is Hurwitz's formula. The proof starts with $$I_N(s,a)=-\frac1{2\pi i}\int_{C(N)}\frac{z^{s-1}e^{az}}{e^z-1}\:dz$$ where the contour is shown on p. 258. The functional equation is directly deduced since $\zeta(s)=\zeta(s,a)$ with $a=1$, (theorem 12.7, p. 259). Dec 27, 2016 at 22:23
• The Op should accept this answer. The best example to explain that property. Pretty standard. Dec 29, 2016 at 21:30

Another example is \begin{align*} \int_{0}^1\frac{dx}{x^x}=\sum_{n=1}^\infty \frac{1}{n^n} \end{align*}

We obtain \begin{align*} \int_{0}^1\frac{dx}{x^x}&=\int_{0}^1e^{-x\log x}dx\\ &=\int_{0}^1\sum_{n=0}^\infty\frac{(-x \log x)^n}{n!}dx\tag{1}\\ &=\sum_{n=0}^\infty\int_{0}^1\frac{(-x \log x)^n}{n!}dx\tag{2}\\ &=\sum_{n=0}^\infty\frac{(-1)^n}{n!}\cdot\frac{(-1)^n n!}{(n+1)^{n+1}}\tag{3}\\ &=\sum_{n=1}^\infty \frac{1}{n^n} \end{align*} and the claim follows.

Comment:

• In (1) we use the power series representation for $e^x$

• In (2) we use the fact that we integrate power series term by term

• In (3) we use the following identity for $k\geq 0, j>0$ \begin{align*} \int_{0}^1x^j(\log x)^k\,dx=\frac{(-1)^k k!}{(j+1)^{k+1}} \end{align*} This can be shown for $j>0$ by induction on $k$. For $k=0$ it can be seen quite easily and for the inductive step, we use integration by parts \begin{align*} \int_{0}^1x^j(\log x)^k\,dx&=\frac{1}{j+1}\left.x^j(\log x)^k\right|_0^{1}-\frac{k}{j+1}\int_{0}^1x^j(\log x)^k\,dx\\ &=-\frac{k}{j+1}\int_{0}^1x^j(\log x)^k\,dx\tag{4}\\ &=\frac{-k}{j+1}\cdot\frac{(-1)^{k-1}(k-1)!}{(j+1)^k}\tag{5}\\ &=\frac{(-1)^k k!}{(j+1)^{k+1}} \end{align*}

• In (4) we use $\lim_{x\rightarrow 0^+}x^j(\log x)^k=0$ for $j>0$ and $k\geq 0$.

• In (5) we apply the inductive hypothesis

Hint: This example is stated as Gem 30 in Real Infinite Series by D.D. Bonar and M.J. Khoury. See also this related answer.

• Just curious, what other 'gems' are stated in this book? Dec 28, 2016 at 3:48
• @SandeepSilwal: There are $107$ different gems stated. Gem $50$: The series $\sum_{n=1}^\infty\frac{1}{(n!)^2}$ converges to an irrational number. Two more of them are mentioned in the referred answer. Dec 28, 2016 at 7:27
• Wow, this seems like a really neat book! I will try to see if my school's library has it.For Gem $50$, does the following contradiction approach work ? Suppose the sum is rational and equal $a/b$. Suppose $c_n = 1/(n!)^2$. Then consider the equation $a/b - \sum_{n \le b} c_n = \sum_{n > b} c_n$. Multiply through by $(b!)^2$. Then the LHS is an integer and the RHS is positive so the RHS is a positive integer. But we can bound the RHS by the geometric series $1/(b+1)^2 + 1/(b+1)^4 + \cdots$ which is $<1$. This is a contradiction. Dec 28, 2016 at 16:53
• @SandeepSilwal: Nice argument, looks good! :-) One aspect is missing. First of all you have to prove, the series is convergent, since otherwise the argumentation is not admissible. But convergence can be shown easily. Dec 29, 2016 at 0:23

First example

For $|a|<1$

$$\int^{2\pi}_0 \frac{1- a \cos(x)}{1+a^2-2a \cos(x)}dx = \sum_{k=0}^{\infty} a^{k} \int^{2\pi}_0 \cos(kx)\,dx = 2\pi$$

Where we used that

$$\sum_{k=0}^{\infty} a^{k} \cos(kx) = \frac{1- a \cos x}{1-2a \cos x + a^{2}} , \ \ |a|<1$$

Second example

$$\int_{0}^{\infty}\frac{e^{-t}\cosh(a\sqrt{t})}{\sqrt{t}}dt$$

We know that we can expand $\cosh$ using power series

$$\cosh(a\sqrt{t}) = \sum_{n=0}^{\infty}\frac{a^{2n}\cdot t^n}{(2n)!}$$

Substituting back in the integral we have

$$\int_{0}^{\infty}e^{-t}\sum_{n=0}^{\infty}\frac{a^{2n}\cdot t^n}{(2n)!\, \sqrt{t}}dt$$

Now since the series is always positive we can swap the integral and the series

$$\sum_{n=0}^{\infty}\frac{a^{2n}}{(2n)!}\left[ \int_{0}^{\infty}e^{-t} t^{n-\frac{1}{2}}dt\right]$$

Hence we have by using the gamma function

$$\sum^{\infty}_{n=0} \frac{a^{2n}\,\Gamma\left(\frac{1}{2}+n\right)}{(2n!)}$$

Using LDF (Legendre Duplication Formula) we get

$$\sum^{\infty}_{n=0}\frac{a^{2n}}{(2n!)}\left({(2n)! \over 4^n n!} \sqrt{\pi}\right)$$

By further simplification

$$\sqrt{\pi}\,\sum^{\infty}_{n=0} \frac{a^{2n} }{4^n\,n!}$$

Using the expansion of the exponential we get

$$\int_{0}^{\infty}\frac{e^{-t}\cosh(a\sqrt{t})}{\sqrt{t}}dt\,=\,\sqrt{\pi}e^{{a^2 \over 4}}$$

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.