# Calculus Question - change order of integration

Can We always change the order of integration in double integrals ?

-
Not without changing the value of the integral! –  The Chaz 2.0 Nov 25 '12 at 4:21
If we change the order and value of lower and upper bond bond as well then is it the case that we always can change the order of integral ? How about indefinite double integrals ? –  Hooman Nov 25 '12 at 4:25
You can always change the order of integration, but that does not mean values will coincide! If the hypothesis of Fubini's theorem is satisfied the values will coincide. –  glebovg Nov 25 '12 at 4:31

Here is a counterexample that shows the value might not coincide.

Consider the function $$\frac{x^2-y^2}{(x^2+y^2)^2}$$ A $y$-primitive for this on $[1,\infty)$ is $$\frac{y}{x^2+y^2}$$ which simplifies to $$-\frac{1}{1+x^2},$$ when evaluated from $1$ to $\infty$.

Knowing this, and the fact that $$\int \frac{1}{1+x^2}=\arctan(x)+C,$$ we get $$\int_1^\infty \int_1^\infty \frac{x^2-y^2}{(x^2+y^2)^2} dydx=\int_1^\infty -\frac{1}{1+x^2}=-\frac{\pi}{4}.$$

Now changing the order, we get $$\int_1^\infty \int_1^\infty \frac{x^2-y^2}{(x^2+y^2)^2} dxdy=-\int_1^\infty \int_1^\infty \frac{-x^2+y^2}{(x^2+y^2)^2} dxdy=\int_1^\infty \frac{1}{1+y^2}=\frac{\pi}{4}.$$

There are theorem that can garantee the change will provide the same answer, namely Fubini's. As Glebovg pointed out, you can find this example and some other theorems here.

-
Thanks Man, Very good answer ,thanks –  Hooman Nov 25 '12 at 4:30
You're welcome! –  Jean-Sébastien Nov 25 '12 at 4:31
@Jean-Sébastien Nice copy and paste, but you could have simply shared this link to wiki article. –  glebovg Nov 25 '12 at 4:39
Your comment, @glebovg, is rude, patronizing and uncalled for. You seem to believe, for some reason, that answers given here must, should, ought be original self work of the answerer ...and in a way they are, as she/he took the trouble either to think the answer out or to look for it in a book/the net. Since many (must?) of the questions here are basic mathematics, many of us remember from here or from there answers/tricks/methods to solve them and nothing wrong with copying them. I invite you to erase your derising comment and, of course, I shall do the same afterwards with this one. –  DonAntonio Nov 25 '12 at 12:07
@glebovg Classics are what they are sometimes. That's the first example I remember seeing of a situation where changing the order of integration leads to a different answers. At the time, I was a bit awed, and wonder how one could come up with an example like that. Then my teacher told me that the goal was to keep it simple, try to get something as "insignifiant" as a change of sign. Now what do you do to get that, you look for a fonction with some kind of symmetry that has f(x,y)=-f(y,x). Then you want to make sure the first integral gives the same result. All of this to say, I remembered –  Jean-Sébastien Nov 25 '12 at 14:38