Multivariable calculus
Triple Integral of x^2 + y^2 + z^2 over a Box
The triple integral of x squared plus y squared plus z squared, over the box where x runs 0 to 1, y runs 0 to 2 and z runs 0 to 1, equals 4. The three terms contribute 2/3, 8/3 and 2/3. The box has volume 2, so the average squared distance from the origin over the solid is 2.
Numerically 4.000000, confirmed by quadrature on every build.
Three separable pieces, each with its own edge factors
The integrand is , the squared distance from the origin. Split it by linearity. Each term is separable, so it becomes one real integral times the two edge lengths belonging to the other variables.
The total is . The term dominates because that edge is twice as long, and cubing in magnifies the difference.
Why this integral keeps appearing
Moment of inertia about an axis uses the squared distance to that axis, so the axis version integrates and the polar version integrates all three terms. Once you can evaluate one term over a box you can evaluate any of them.
- About the axis: .
- About the axis: .
- About the origin, all three terms: .
With a variable density the terms stop being separable and the full iterated integral has to be worked, but the splitting by linearity still holds.
The mistake: attaching the wrong edges to a term
The frequent error is pairing with the term, or reusing the same pair of edge lengths for all three pieces. Each term keeps its own variable live and borrows the lengths of the other two.
A second error is claiming is separable as a product. It is a sum, not a product, so the whole integral is not . That product would give , nowhere near .
Bound the answer to be safe. On this box the largest value of is at the far corner and the smallest is , so with volume the integral has to sit between and .
Frequently asked questions
What is the average squared distance from the origin here?
Divide by the volume: . So the typical point of the box sits at squared distance from the origin, meaning a distance of about .
Can I integrate the terms in different orders?
Yes. Each term is handled independently and the box has constant limits, so any of the six orders works and no term interacts with another. Linearity and Fubini's theorem are doing the work together.