# Reversing the Order of Integration and Summation

I am trying to understand when we can interchange the order of Integration and Summation. I am increasingly encountering Integrals; some of which are being solved by interchanging the order of Summation and Integration, and some which cannot (for no given reason) be solved using this. Despite looking at a variety of sites, I was unable to understand when we can do so.  I came up with the following two requirements here on MSE: If$$f_n(x)\ge 0$$ for all $$x,n$$ $$\sum \int f_n(x) \, dx = \int \sum f_n(x) \,dx$$ Also if $$\sum \int |f_n| < \infty$$ or $$\int \sum |f_n| < \infty$$, then $$\int \sum f_n = \sum \int f_n$$

I would be grateful if somebody could please explain this to me. Thanks very much in advance.

• If I recall correctly, then if the sum of the integral converges, then the integral of the sum converges to the same value and vice versa. This is an application of Fubini's theorem. – kbau Jun 22 '15 at 13:21
• You are presumably integrating over $x$ and summing over $n$ – Henry Jun 22 '15 at 13:28
• Regarding the notation $f_n(x)$, I imagine $n$ is a summation index. Not sure about swapping the sum and integral in $\int g(x) \sum f(x) dx$. Better wait for someone more knowledgeable to answer. Although, if you use the $f_n(x)$ notation properly, then swapping the sum and the integral shouldn't be a problem assuming it can be done without $g(x)$ in the expression. – kbau Jun 22 '15 at 13:30
• If you don't like $f_n(x)$, you can write $f(n,x)$. It means the same thing. We tend to separate $n$ and $x$ for various reasons (mainly so that we can conveniently isolate the function $g(x)=f(n,x)$ for a fixed $n$, by simply writing $f_n$). – Ian Jun 22 '15 at 13:33
• If you don't understand what $f_n(x)$ means, then could you give us an example of an expression involving $\sum\int$ or $\int\sum$ about which you have questions? I'm having trouble understanding what you could be asking about if you don't understand what $f_n(x)$ means. If you have $\int$ there's a "$dx$" in there somewhere -- a variable with respect to which you're integrating. And if you have $\sum$ the you must have $\sum_{n=1}^\infty$ or the like, with the index called $n$. There's an $x$ and there's an $n$; otherwise you haven't got an integral and a sum. ${}\qquad{}$ – Michael Hardy Jun 22 '15 at 13:34

The more general question is about interchanging limits and integration. With infinite sums, this is a special case, because by definition $$\sum_{n=1}^\infty f_n(x) = \lim_{N \to \infty} \sum_{n=1}^N f_n(x)$$. So because one can always interchange finite sums and integration, the only question is about interchanging the limit and the integration.

Writing what I just said in symbols, we want conditions such that

$$\sum_{n=1}^\infty \int_X f_n(x) dx = \int_X \sum_{n=1}^\infty f_n(x) dx.$$

Expanding the definition:

$$\lim_{N \to \infty} \sum_{n=1}^N \int_X f_n(x) dx = \int_X \lim_{N \to \infty} \sum_{n=1}^N f_n(x) dx.$$

Now one interchange is free:

$$\lim_{N \to \infty} \sum_{n=1}^N \int_X f_n(x) dx = \lim_{N \to \infty} \int_X \sum_{n=1}^N f_n(x) dx.$$

The issue is with the last interchange, which is what most of the rest of this answer is about.

The most general result of this type is the Vitali convergence theorem. It says that if $$f_n$$ is a sequence of measurable functions, $$f_n \to f$$ pointwise, $$f_n$$ is uniformly integrable, and $$f_n$$ is tight, then $$\int_X f_n(x) dx \to \int_X f(x) dx.$$ (Here $$X$$ is the set over which we integrate.) You can look up the formal definitions of "uniformly integrable" and "tight" yourself. Roughly speaking they mean that you cannot "compress mass into a point" and that you can't "move mass to infinity". These intuitions are illustrated by the failure of the conclusion of the theorem for the sequences $$f_n(x)=\begin{cases} n & x \in [0,1/n] \\ 0 & \text{otherwise} \end{cases}$$ on $$[0,1]$$ and $$g_n(x)=\begin{cases} 1 & x \in [n,n+1] \\ 0 & \text{otherwise} \end{cases}$$ on the whole line.

The Vitali convergence theorem is general but it is not convenient. The result with perhaps the best balance between generality and convenience to check is the dominated convergence theorem. This says that if $$f_n \to f$$ pointwise and there is a fixed integrable function $$g$$ such that $$|f_n(x)| \leq g(x)$$ for all $$n$$ and $$x$$, then $$\int_X f_n(x) dx \to \int_X f(x) dx.$$

One relatively basic result is the monotone convergence theorem, which says that if $$f_n$$ is an increasing sequence of nonnegative functions and $$f_n \to f$$ pointwise, then $$\int_X f_n(x) dx \to \int_X f(x) dx$$. In particular this holds whether or not $$f$$ is actually integrable (if it isn't, then the limit of the integrals is $$+\infty$$). This is also applicable to the case when $$f_n$$ are nonpositive and decrease to $$f$$ (this is easy to prove, since $$\int_X -g(x) dx = -\int_X g(x) dx$$). This is useful for summation, because if $$f_n(x) \geq 0$$ then $$g_N(x)=\sum_{n=1}^N f_n(x)$$ is an increasing sequence of nonnegative functions.

Finally in the special case of interchanging summation and integration, one can apply the abstract version of the Fubini-Tonelli theorem. This is because summation can be identified as integration with respect to the counting measure. As a result, if either

$$\sum_{n=1}^\infty \int_X |f_n(x)| dx < \infty$$

or

$$\int_X \sum_{n=1}^\infty |f_n(x)| dx < \infty$$

then one may interchange summation and integration. (This requires a hypothesis about $$X$$; because this holds for the case of $$\mathbb{R}^n$$, I won't state it, since this is already a more advanced writeup than you wanted.)

• @BetterWorld $X$ can be $\mathbb{R}$; usually we write $\int_{-\infty}^\infty$ instead of $\int_{\mathbb{R}}$. – Ian Jun 23 '15 at 10:14
• @BetterWorld The limits being infinite doesn't matter. (Again, there is a condition in the last result, which is that the space $X$ has to be "$\sigma$-finite", but $\mathbb{R}$ and $\mathbb{R}^n$ are $\sigma$-finite, so that's not an obstacle for your purposes). As for your second question, everything works out if you use different indices. You can even sum over the whole set of integers $\mathbb{Z}$ and it works out the same. – Ian Jun 23 '15 at 10:39
• I am afraid that you have wasted a lot of your time writeing down this nice answers: as you can see, the OP wasn't asking about the subtle problem of switching limits with integrals, he was asking about what $f_n (x)$ means... – Alex M. Jun 23 '15 at 10:39
• @BetterWorld Sure, that's just a special case. – Ian Jun 23 '15 at 11:30
• @Ian, Could you address the cases the integral is $\int_{-\infty}^{\infty}$ and the case of indefinite integral? Namely not only in the contxt of measures. Thank You. – Royi Sep 26 '17 at 13:53