Solution (source code)

= Solution

On <sigma-finite measure> spaces, including the real line with <Lebesgue measure>, <Tonelli's theorem> says that a nonnegative measurable function $H$ has equal product and iterated integrals:
$$
\int_{X\times Y}H\,d(\mu\times\nu)
=\int_X\left(\int_YH(x,y)\,d\nu(y)\right)d\mu(x)
=\int_Y\left(\int_XH(x,y)\,d\mu(x)\right)d\nu(y),
$$
with infinity allowed. Finiteness is not a prerequisite.

<Fubini's theorem> says that if a measurable signed or complex $H$ is absolutely integrable on the product, then its sections are integrable for <almost every> value of the other variable, the iterated integral functions are integrable, and the same equalities hold with finite values. For completed Lebesgue measure, exceptional sections need not themselves be measurable; the integrals use the almost-everywhere defined sections. Thus Tonelli can first establish absolute integrability using $|H|$, after which Fubini permits changing the order for $H$.