Riemann sums define a double integral, but nobody computes one that way. Instead, integrate one variable at a time, the way you found volumes by slicing in Calculus 2.
Key idea
Why it works
When the integrand is a product $g(x)h(y)$ over a rectangle, the iterated integral splits into two single integrals: $$\int_a^b \int_c^d g(x)h(y)\,dy\,dx = \left(\int_a^b g(x)\,dx\right)\left(\int_c^d h(y)\,dy\right),$$ because in the inner integral $g(x)$ is a constant that can come outside. For example, $\int_0^1 \int_0^\pi x\sin y\,dy\,dx = \frac{1}{2} \cdot 2 = 1$. Fubini's theorem also allows switching the order, which matters when one order leads to an antiderivative you cannot find; the third example below shows this.
Worked examples
Worked example: Inside out
- Inner, in $y$ ($x$ is a constant): $\int_1^3 x^2y\,dy = x^2\left[\frac{y^2}{2}\right]_1^3 = x^2 \cdot 4 = 4x^2$.
- Outer: $\int_0^2 4x^2\,dx = \frac{32}{3}$.
Answer: $\frac{32}{3}$
Worked example: The other order
- Inner, in $x$: $\int_0^2 x^2y\,dx = \frac{8}{3}y$.
- Outer: $\int_1^3 \frac{8}{3}y\,dy = \frac{8}{3} \cdot 4 = \frac{32}{3}$, the same, as Fubini promises.
Answer: $\frac{32}{3}$
Worked example: Choosing the easy order
- Inner in $y$: $\int_0^2 xe^{xy}\,dy = \left[e^{xy}\right]_{y=0}^{y=2} = e^{2x} - 1$ (the $x$ in front is exactly the inner derivative).
- Outer: $$\int_0^1 (e^{2x} - 1)\,dx = \left[\frac{e^{2x}}{2} - x\right]_0^1 = \frac{e^2}{2} - 1 - \frac{1}{2} = \frac{e^2 - 3}{2}.$$
- Integrating $x$ first would need integration by parts: both orders are correct, but one is much easier.
Answer: $\frac{e^2 - 3}{2}$
Common mistake