For some reason I always believed that I can generally exchange the order of integration for multiple integrals, i.e.

[tex]\int \int f(x,y) \; dx \; dy = \int \int f(x,y) \; dy \; dx[/tex]

However, I just had to realize that this cannot be true, since (with a a constant):

[tex] \int \int \frac{d a}{dx} \; dx \; dy = \int a \; dy = ay [/tex]

[tex] \int \int \frac{d a}{dx} \; dy \; dx = \int \int 0 \; dy \; dx = 0 [/tex]

So I'm wondering under what conditions I can actually exchange the order of integration. I looked into a couple of Calculus books and they mostly mention in passing that it depends on the shape of the area that I'm integrating over. However, the integrals I'm concerned with are usually not over a real geometric area that I can visualize and reason about...