Calculate $\int \int \int_D (x^2+y^2+z^2) \; dx dy dz$, where $D = \{(x,y,z) \in \mathbb{R}^3 \,|\, x^2+y^2+z^2 \leq 1, \, x^2+y^2 > \leq z^2, \, z \geq 0 \}$
I did it this way. I just want to make sure it is correct. Because while I was solving it, I had some doubts about $\rho$ limits when chaging to spherical coordinates.
$\int \int \int_D (x^2+y^2+z^2) \; dx dy dz = \int_0^{2 \pi} \int_0^{\frac{\pi}{4}} \int_0^1 \rho^4 \cdot \sin(\varphi) \; d \theta d \varphi d \rho = 2 \pi \cdot \frac{\left( 1-\frac{1}{\sqrt{2}}\right)}{5}$
Everything is correct. Everything should be clear from this picture
This picture represents the region over which we are integrating. It is now clear that the limits for r coordinates are (0,1), limits for $\phi$ coordinates are $(0,\frac{\pi}{4})$, while the integral is completely independent of $\theta$. So:
$$ \int \int \int_D (x^2+y^2+z^2) \; dx dy dz =2\pi \int_0^1 \left( \int_0^{\pi/4} \sin(\theta) d\theta \right) r^4 dr = \frac{2\pi}{5} \left(1-\frac{1}{\sqrt{2}} \right) $$ as the OP already obtained.