Sum of infinitely many integrals I know that $\int_0^\infty \frac{1}{x^2+1} \, dx=\dfrac{\pi}{2}$. What if I integrate $f(x)=\dfrac{1}{x^2+1}$ in infinite disjoint integrals not of the same length, like
$$\int_{x_{1}}^{x_{2}} f(x)\,dx+\int_{x_3}^{x_4} f(x)\,dx+\cdots +\int_{x_{2k+1}}^{x_{2k+2}} f(x)\,dx+\cdots$$ Is the sum of these integrals finite?

This amounts to show that $\int_{\Bbb{R}} g_{n} $ converges as $n \to \infty$, where
$$ g_{n}(x) = f(x) \sum_{k=1}^{n} \mathbf{1}_{[x_{2k-1}, x_{2k}]}(x). $$
The condition shows that $0 \leq g_n \leq f$, thus the dominated convergence theorem guarantees the convergence.
