Fubini’s theorem says that when you have a double integral over two variables, you can compute it by integrating one variable at a time, in either order, and get the same answer. For a continuous function f(x, y) on a rectangle [a, b] × [c, d], the theorem guarantees that integrating first with respect to x then y gives the same result as integrating first with respect to y then x. This turns a potentially difficult two-dimensional problem into two manageable one-dimensional problems.
The Core Idea
Suppose you need to evaluate a double integral over a rectangular region. Fubini’s theorem tells you that you can break it into two nested single integrals, called iterated integrals, and that both possible orderings are equal:
∬ f(x, y) dA = ∫∫ f(x, y) dx dy = ∫∫ f(x, y) dy dx
In each case, you evaluate the inner integral using the fundamental theorem of calculus while treating the other variable as a constant. Then you integrate the result with respect to the remaining variable. The theorem’s power is that it doesn’t matter which variable you tackle first. This flexibility lets you choose whichever order makes the calculation easier, which in practice can be the difference between a straightforward computation and an impossible one.
Conditions That Must Hold
Fubini’s theorem isn’t a blank check to swap integration order on any function. The key requirement is that the function must be integrable over the entire region. For continuous functions on bounded rectangles, this is automatic and you don’t need to worry. But for functions that blow up somewhere or oscillate wildly between positive and negative values, the theorem can fail.
In the more rigorous setting of measure theory (where the theorem is stated precisely), two conditions matter. First, the function must be measurable with respect to the product of the two underlying measure spaces. Second, the measures involved must be sigma-finite, meaning the space can be broken into countably many pieces that each have finite measure. The standard Lebesgue measure on the real line is sigma-finite, so for most applications in calculus and probability, this condition holds automatically.
For functions that can take both positive and negative values, there’s an additional requirement: the integral of the absolute value |f(x, y)| over the full region must be finite. This absolute integrability condition is what separates Fubini’s theorem from a related result called Tonelli’s theorem.
Fubini vs. Tonelli
Tonelli’s theorem covers functions that are nonnegative. When f(x, y) ≥ 0 everywhere, you can swap the order of integration freely as long as the function is measurable and the measures are sigma-finite. You don’t need to check that the overall integral is finite first, because a nonnegative function can’t have cancellations between positive and negative parts that cause trouble. The iterated integrals are guaranteed to be equal (though they might both be infinite).
Fubini’s theorem handles functions that can be positive or negative, but demands the extra condition of absolute integrability. In practice, a common strategy is to first apply Tonelli’s theorem to |f| to check whether the absolute integral is finite, then invoke Fubini’s theorem to swap the order of integration on f itself.
What Goes Wrong Without Integrability
A classic counterexample from Johns Hopkins illustrates exactly how badly things break when Fubini’s conditions aren’t met. Consider the function f(x, y) = xy(x² − y²) / (x² + y²)³ on the rectangle [0, 2] × [0, 1], with f(0, 0) = 0. If you integrate first with respect to y and then x, you get 1/5. If you integrate first with respect to x and then y, you get −1/20. The two answers don’t just differ slightly; they have opposite signs.
Every individual one-variable integral in the computation involves a perfectly continuous function, so nothing looks suspicious along the way. The problem is that f is not integrable over the full rectangle. Near the origin, the function takes arbitrarily large positive values along some directions (for instance, f(2t, t) = 6/(125t²)) and arbitrarily large negative values along others (f(t, 2t) = −6/(125t²)). These positive and negative infinities interact differently depending on which variable you integrate first, producing different answers. Fubini’s theorem explicitly warns you away from this situation by requiring absolute integrability.
Applications in Probability
Fubini’s theorem is fundamental to probability theory. When two random variables X and Y have a joint probability density f(x, y), you recover the marginal density of X alone by integrating out y:
f_X(x) = ∫ f(x, y) dy
This formula depends on Fubini’s theorem to ensure that slicing the joint density along one variable produces a valid density for the other. The same logic applies to computing expected values. For example, E[XY] can be written as a double integral of xy · f(x, y) over the plane, and Fubini’s theorem lets you evaluate this as nested single integrals in whichever order is more convenient.
More broadly, whenever you encounter a sum or integral that you’d like to “pass through” another integral, Fubini’s theorem (or its discrete analogue for sums) is the result that justifies doing so. Swapping the order of summation in a double series, interchanging an integral and a sum, computing moments of random variables: all of these rely on the same underlying principle.
Using the Theorem in Practice
For most problems in a calculus course, applying Fubini’s theorem is straightforward. You’re given a double integral over a rectangle, the function is continuous, and you simply choose which variable to integrate first based on which order yields a cleaner antiderivative. If integrating e^(x²) with respect to x looks hopeless but the y-integration simplifies things, swap the order.
For non-rectangular regions, the idea extends but the limits of integration change. If a region is described as a ≤ x ≤ b with g₁(x) ≤ y ≤ g₂(x), switching the order means re-expressing those bounds in terms of y first. This requires sketching the region and reading off the new limits, which is a geometry problem rather than a theorem problem. Fubini’s theorem guarantees the two iterated integrals agree; figuring out the correct limits is your job.
In analysis or measure theory courses, the practical workflow is: check that your measures are sigma-finite (they almost always are for standard settings), then either confirm the function is nonnegative (use Tonelli) or verify absolute integrability (use Fubini). Once those boxes are checked, swap freely.

