Multivariable calculus

Triple Integral of xy + z^2 over a Box

The triple integral of xy plus z squared, over the box where x runs 0 to 1, y runs 0 to 2 and z runs 0 to 3, equals 21. The xy term contributes 3 and the z squared term contributes 18. The box has volume 6, so the average value of the integrand on it is 3.5.

f(x,y,z)=xy+z2f(x,y,z) = xy + z^2
010203(xy+z2)dzdydx=21\int_0^1 \int_0^2 \int_0^3 \left(xy + z^2\right) \,dz\,dy\,dx = 21

Numerically 21.000000, confirmed by quadrature on every build.

Break the sum into two separable integrals

The integrand is a sum of two terms, and neither term uses all three variables. Split by linearity, then treat each piece as a product with edge lengths supplied by the missing variables.

BxydV=(01xdx)(02ydy)(3)=1223=3\iiint_B xy \,dV = \left(\int_0^1 x \,dx\right)\left(\int_0^2 y \,dy\right)(3) = \frac{1}{2}\cdot 2\cdot 3 = 3
Bz2dV=(1)(2)(03z2dz)=29=18\iiint_B z^2 \,dV = (1)(2)\left(\int_0^3 z^2 \,dz\right) = 2\cdot 9 = 18

Adding gives 3+18=213 + 18 = 21. The z2z^2 term dominates because the zz edge is longest and it is the term being squared there.

The same answer from the iterated form

If you would rather not split, run the nested integrals straight through. The inner one in zz handles both terms at once, with xyxy acting as a constant.

03(xy+z2)dz=3xy+[z33]03=3xy+9\int_0^3 \left(xy + z^2\right) \,dz = 3xy + \left[\frac{z^3}{3}\right]_0^3 = 3xy + 9
02(3xy+9)dy=6x+18,01(6x+18)dx=3+18=21\int_0^2 \left(3xy + 9\right) \,dy = 6x + 18, \qquad \int_0^1 \left(6x + 18\right) \,dx = 3 + 18 = 21

Notice the constant 99 that appears after the zz stage. It is not idle: the later integrations multiply it by the yy and xx edge lengths, turning it into 1818.

The mistake: factoring a sum

The product shortcut only applies to a product. Writing B(xy+z2)dV\iiint_B \left(xy + z^2\right) \,dV as (xdx)(ydy)+(z2dz)\left(\int x \,dx\right)\left(\int y \,dy\right) + \left(\int z^2 \,dz\right) gives 1+9=101 + 9 = 10, which drops the edge factors from both terms.

The rule is that linearity splits sums and separability splits products, and the two steps are applied in that order. Split the sum first, then check each piece separately for separability.

  • xyxy is separable, but it is still missing a zz factor, so it collects the edge length 33.
  • z2z^2 is separable, and it collects the edge lengths 11 and 22.
  • Neither piece can be pulled out of the triple integral without those factors.

Frequently asked questions

How do I check 21 quickly?

Bound the integrand. On this box xyxy tops out at 22 and z2z^2 at 99, so the maximum is 1111 and the volume is 66, giving an upper bound of 6666. The answer 2121 sits comfortably inside, and its average of 3.53.5 matches an integrand that is small over much of the box.

Would the answer be the same over a different shaped box of volume 6?

No. Swap the xx and zz edges so xx runs 00 to 33 and zz runs 00 to 11, and the z2z^2 contribution collapses while the xyxy contribution grows. Volume alone does not determine the integral.