Integration over a cube the correct way?

130 Views Asked by At

Suppose we have a cube, and I want to integrate the function $f(x,y,z)$ over it where $x,y,z$ are the variable in given three dimensions. Assuming cube's center is at a distance of $d$ from the point of reference, and the side of cube as $2r$, I want to know how should I perform the integration this way: $$\int_{d-r}^{d+r}\int_{-r}^{r}\int_{-r}^{r} f(x,y,z) dx ~dy ~dz$$ or this way: $$\int_{d-r}^{d+r}\int_{-r}^{r}\int_{-\sqrt{2}r}^{\sqrt{2}r} f(x,y,z) dx ~dy ~dz$$

Which way is correct and why?