I need to compute: $\int \int \int z dxdydz$
over the domain: $\{x^2+y^2+z^2\leqslant 16,z\geqslant 0\}$
Im trying to use spherical coords as:
$\int_{0}^{2\pi} \int_{0}^{\frac{\pi}{2}} \int_{0}^{4} r cos(\theta )r^2sin(\varphi ) drd\theta d\varphi $$$\int_{0}^{2\pi} \int_{0}^{\frac{\pi}{2}} \int_{0}^{4} r \cos(\theta )r^2\sin(\varphi ) \;dr\,d\theta \,d\varphi $$
I try this on Mathematica:
Integrate[Integrate[Integrate[r *Cos[theta]*r^2*Sin[phi], {r, 0, 4}], {theta, 0, Pi/2}], {phi, 0, 2 Pi}]
But re result is 0. What is wrong here?