# When can we exchange order of two limits?

My questions are about a sequence or function with several variables.

• I vaguely remember some while ago one of my teachers said taking limits of a sequence or function with respect to different variables is not exchangeable everywhere, i.e. $$\lim_n \lim_m a_{n,m} \neq \lim_m \lim_n a_{n,m}, \quad \lim_x \lim_y f(x,y) \neq \lim_y \lim_x f(x,y).$$ So my question is what are the cases or examples when one can exchange the order of taking limits and when one cannot, to your knowledge? I would like to collect the cases together, and be aware of their difference and avoid making mistakes. If you could provide some general guidelines, that will be even nicer!
• To give you an example of what I am asking about, this is a question that confuses me: Assume $f: [0, \infty) \rightarrow (0, \infty)$ is a function, satisfying $$\int_0^{\infty} x f(x) \, dx < \infty.$$ Determine the convergence of this series $\sum_{n=1}^{\infty} \int_n^{\infty} f(x) dx$.

The answer I saw is to exchange the order of $\sum_{n=1}^{\infty}$ and $\int_n^{\infty}$ as follows: $$\sum_{n=1}^{\infty} \int_n^{\infty} f(x) dx = \int_1^{\infty} \sum_{n=1}^{\lfloor x \rfloor} f(x) dx \leq \int_1^{\infty} \lfloor x \rfloor f(x) dx$$ where $\lfloor x \rfloor$ is the greatest integer less than $x$. In this way, the answer proves the series converges. I was wondering why the two steps are valid? Is there some special meaning of the first equality? Because it looks similar to the tail sum formula for expectation of a random variable $X$ with possible values $\{ 0,1,2,...,n\}$: $$\sum_{i=0}^n i P(X=i) = \sum_{i=0}^n P(X\geq i).$$ The formula is from Page 171 of Probability by Jim Pitman, 1993. Are they really related?

-
Thanks, Greg O.! Could you please post again the equations you wrote before? –  Linda Jan 19 '11 at 2:09
The exchange of the sum and integral in your second question is justified by Fubini's theorem, which typically is used to exchange the order of integration in iterated Lebesgue integrals, but more generally holds for iterated integrals in any (reasonable) measure space. In this case, if we set $g(x,n) = \chi_{[n,\infty)}(x)f(x)$, then $$\sum_{n=1}^\infty \int_n^\infty f(x) dx = \int_\mathbb{N}\int_1^\infty g\ dx \times d\mu$$ where $dx$ is Lebesgue measure on $[1,\infty)$ and $d\mu$ is counting measure on the natural numbers. Now Fubini allows you to exchange the integrals as desired. –  Greg O. Jan 19 '11 at 2:16
Possible repeat of math.stackexchange.com/questions/15240/… –  Arturo Magidin Jan 19 '11 at 3:07

A simple example of a doubly indexed sequence $a_{m,n}$ for which you cannot exchange limits is given in Rudin's "Principles..." Example 7.2 pg. 144:
Let $a_{m,n} = \frac{m}{m+n}$, then $$\lim_{n\rightarrow\infty}\lim_{m\rightarrow\infty}a_{m,n} = 1$$ but $$\lim_{m\rightarrow\infty}\lim_{n\rightarrow\infty}a_{m,n} = 0$$.