I'm trying to calculate the following integral:
$\int\int\int y·dxdydz $
Over the following domain:
D= {(x,y,z)| $x^2+y^2+z^2\le R^2, y\ge 0$}
So according to the following coordinate system: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/3D_Spherical.svg/558px-3D_Spherical.svg.png
Where y= $rsin(\theta)sin(\phi)$.
According to the above graph both $\theta$ and $\phi$ should be between 0 and $\pi$.
So the integral I end up with is:
$\int_0^{\pi} \int_0^{\pi} \int_0^{R} r^3sin^2(\theta)cos(\phi) drd\theta\ d\phi $
But this integral clearly equals zero as $\int_0^{\pi}cos(\phi)d\phi$=0.
Where did I go wrong?
Your $\sin\phi$ became a $\cos\phi$ after the coordinate change. Fix that and you should get $$ \int_0^\pi \int_0^\pi \int_0^R r^3 \sin^2\theta\sin\phi \, dr \, d\theta \, d\phi = \frac\pi4R^4 $$
Also, just FYI, for triple integrals you can use
\iiintand for sines and cosines you can use\sinand\cos.\iiintproduces $\iiint$, which looks cleaner than $\int\int\int$