# Help in finding $z$ coordinate of centroid by triple integration

We are given a cone $z^2 = x^2 +y^2$ and between the spheres $x^2 + y^2 + z^2 = 1$ and $x^2 + y^2 + z^2 = 4$

Also the mass density is equal to $z$ and we are asked z coordinate of centroid of volume inside the cone and above the xy plane.

Now for z coordinate of centroid $$I = \iiint \rho z\,dx\,dy\,dz$$ divided by mass $M$.

So now translating to spherical coordinates we get $$I=\iiint \rho zr^2\sin\theta\, dr\, d\theta\, d\phi$$

As volume inside the cone is asked then z lies between $\sqrt{x^2 + y^2}$ and the plane $z = 2$. Evaluating that after putting the value of x and y in spherical coordinate and $r$ between 2 and 1, $\rho$ = z I am getting the wrong answer. Have I made a mistake somewhere?

• Where is the plane $z=2$ coming from ? – Yves Daoust Jul 8 '17 at 16:08
• @YvesDaoust if we consider the sphere r = 2 then for $x^2 + y^2 = 4$ z =2. So the cone is capped by the plane z =2. – user127 Jul 8 '17 at 16:13
• First, the intersection of the cone and the sphere is given by $x^2+y^2+z^2=z^2+z^2=4$ hence $z=\sqrt2$. Second, it is nowhere said that the cone has planar bases. – Yves Daoust Jul 8 '17 at 17:27

Considering the following image, projection on the $yz$ plane  • Can you please explain why the limit is from 0 to $\pi / 4$ ? Also shouldn't it be $rcos \theta$ squared as $\rho = z$? – user127 Jul 8 '17 at 16:52
• In spherical coordinates $z$ is exactly $r\cos\theta$, and the cone has its generating lines $\pi/4$ away from the vertical axis. – enzotib Jul 8 '17 at 16:59
• Okay I get it but why isn't there a $z^2$ ? The mass density is also z . – user127 Jul 8 '17 at 17:27
• @user127: this is indeed the calculation for the mass, as you noticed, you need an extra $z$ for the $z$ coordinate of the centroid. – enzotib Jul 8 '17 at 17:43