Finding mass of a sphere whose density is given I want to find the mass of a sphere of radius $a$ whose density at a point is proportional to the distance of a point from a plane passing through a diameter of a sphere
 A: Rotate the sphere so that the plane that determines the density function is the $x$-$y$ plane. We will use spherical coordinates to compute the integral. By symmetry we get the mass $$M=\int_V\rho dV = 8\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{\pi}{2}}\int_{0}^{a}\rho r^2 \sin \theta drd\theta d\phi$$ where $\theta$ is the vertical angle and $\phi$ is the azimuth.
We know that $\rho$ is directly proportional to the distance $z$ in cartesian coordinates so $\rho=kr\cos\theta$ for some constant $k\in \mathbb R$.
Thus, the integral becomes $$M=8\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{\pi}{2}}\int_{0}^{a}kr^3 \sin \theta \cos\theta drd\theta d\phi=4k\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{\pi}{2}}\int_{0}^{a}r^3 \sin 2\theta drd\theta d\phi$$
Integrating with respect to $r$ gives $$M=ka^4\int_{0}^{\frac{\pi}{2}}\int_{0}^{\frac{\pi}{2}}\sin 2\theta d\theta d\phi$$
Integrating with respect to $\theta$ gives $$M=ka^4\int_{0}^{\frac{\pi}{2}}d\phi = \frac{\pi}{2} ka^4$$
A: Set up a coordinate system that has its origin at the center of the sphere and it's $z$-axis perpendicular to the plane you mentioned. Then $\rho(x,y,z) = kz$, where $k$ is some constant. All that's left is the calculation of the integral, and you said you know how to do that.
A: HINT: I think I know where you are stuck. 
Cut the sphere (radius R) into disks of thickness dx, parallel to the plane x=0 (which I assume is the plane from which distances are calculated). So for the disk at x=x you have density = $k|x|$ (The sign of x doesnt matter). Calculate the radius $r$ of this disk (as a function of x) and find its volume and then the mass i.e. $(k|x|)(\pi r^2 dx)$. Now integrate from -R to +R. (or 2 times 0 to R). 
