Why exactly can you change the order of integration in a double (and triple) integral? I'm currently studying multivariable Calculus doing double and triple integrals, and I'm slightly confused on why one can change the order of integration for a double integral. I have my own explanation, but it could be wrong. Is the following reasoning correct?
Fubini's Theorem states that the double integral over a given 2D region where at least one of the variables has constants as their highest and lowest values (called a horizontally or vertically simple region, depending on which variable has the constants) is equal to the iterated integral where those constants are the outer integral's limits of integration (and the inner integral's limits are functions of the outer variable). My reasoning is: If the 2D region is describable as an equation of your two variables, say x and y, and the equation is separable, then you could simply solve for either x or y to get the inner integral's limits of integration, then see from your separated equation what endpoint values the other variable could take on. The 2D region doesn't necessarily have to have abrupt, flat lines as the endpoints for the outside-integral variable (as is depicted in pictures of these such regions in textbooks), but it does need to have endpoint values in terms of the outside variable that are constants. So, if the region doesn't have these abrupt lines to describe its endpoints for either variable, but either variable's endpoint values could be described as constants, then you could use any order of integration you like as long as your outer iterated integral has constants as the limits of integration.
Is this correct, or does Fubini's Theorem explicitly state that any order of integration is usable (as long as the limits of integration are valid)? Also, in the proof for Fubini's Theorem for Triple Integrals, does the same logic essentially hold or is there another reason you can switch the order of integration? Thank you for taking the time to read this post!
 A: No, the reasoning is not correct.
(A baby version of) Fubini-Tonelli theorem states that, if (measurable) $f$ is absolutely integrable, or $f$ is nonnegative, on a rectangle $R=[a,b]\times[c,d]$, then the double integral does not depend on which order you integrate:
$$
\int_c^d\left(\int_a^b f(x,y)\,\mathrm{d}x\right)\,\mathrm{d}y=\int_a^b\left(\int_c^d f(x,y)\,\mathrm{d}y\right)\,\mathrm{d}x.
$$
and their common value is $\iint_Rf$.
You don't need to mess with limits when you integrate along other shapes because you can always absorb them into $f$ by sticking an indicator function
$$
\iint_S f=\iint_R f1_S
$$
where $R$ is any rectangle such that $S\subseteq R$.
Note: The technical assumption of measurability is needed even in the case $f$ nonnegative --- the usual counterexample is the characteristic function of the graph of a well-ordering of $[0,1]$.  However, any function you can explicitly write down (i.e., without using AC, CH or suchlikes) is measurable.
A: Think of the discrete equivalent of integration.
You have a 2D domain of arbitrary shape and function values available at the intersection of grid lines inside the domain. By commutativity/associativity of addition, you can compute the total sum of these values in any order. In particular row by row and column by column. The summation limits are obtained by intersections with the outline. They can consist of several disjoint intervals.
Fubini does that in the limit, with continuous variables (which raises convergence issues), using sweep-lines. This generalizes to 3D, using sweep-planes, then sweep-lines.
