Find $\iiint (x^2+y^2+z^2)~dV$, above the cone $z=\sqrt{3(x^2+y^2)}$, inside the sphere $x^2+y^2+z^2\leq a^2$. 
Find
  $$\iiint (x^2+y^2+z^2)~dV$$
  above the cone $z=\sqrt{3(x^2+y^2)}$, and inside the sphere $x^2+y^2+z^2\leq a^2$.

I think that the solution for this problem is following:
Use cylindrical coordinates:
$x = r\cdot \cos(\theta)$
$y = r\cdot \sin(\theta)$
$z = z$
and we will get:
$$\int_0^a \int_0^{\pi} \int_0^{a/2} (r^2+z^2)r dr d\theta dz$$
Is this approach correct?
 A: Hint: Alternative approach is using the spherical coordinates for this problem:
$$\int_0^a \int_0^{2\pi} \int_{0}^{\frac{\pi}{3}} r^4\sin\varphi d\varphi d\theta dr=\color{blue}{\dfrac{\pi}{5}a^5}$$
A: The idea is correct, but you need to be more careful with the boundaries of integration. The boundary for $z$ is wrong. The upper surface is the surface of the sphere, so this will give you $z = \sqrt{a^2 - r^2}$ for the upper bound and similarly using the fact that the cone is the lower surface we get: $z= \sqrt{3r^2}$ for the lower bound. Hence the answer is given by:
$$\int_{\sqrt{3r^2}}^{\sqrt{a^2 - r^2}} \int_0^{\pi} \int_0^{a/2} (r^2+z^2)r dr d\theta dz$$
A: $\mathbf{HINT}$: First we have  $\sqrt{3(x^2+y^2)}\leq z \leq \sqrt{a^2-x^2-y^2} $.
Second solve system: $z=\sqrt{3(x^2+y^2)}$, $x^2 + y^2 + z^2 = a^2 $. Solution: $D:x^2+y^2 = \frac{a^2}{4}$.
So, $$\iiint (x^2+y^2+z^2) dV = \iint_{D} \int_{\sqrt{3(x^2+y^2)}}^{\sqrt{a^2-x^2-y^2}} (x^2+y^2+z^2) dz dxdy,$$
then we use cylindrical coordinates: $x=r\cos(\phi), y=r\sin(\phi),z=z$ and we have
$$\int_{0}^{2 \pi} \int_{0}^{a/2} \int_{\sqrt{3r^2}}^{\sqrt{a^2-r^2}} (r^2+z^2)r dz dr d\phi=...=\frac{\pi a^5}{5}$$
