Find $\iiint_R(x^2+y^2+z^2) \,dV$, where $R$ is the region that lies above the cone $z=c\sqrt{x^2+y^2}$ and inside the sphere $x^2+y^2+z^2=a^2$. Find the integral $$\iiint_R(x^2+y^2+z^2) \,dV$$ where $R$ is the region that lies above the cone $z=c\sqrt{x^2+y^2}$ and inside the sphere $x^2+y^2+z^2=a^2$. (Here a and c are positive constants.) Simplify as far as possible.

I think I'm really close to the answer but can't seem to make it the last tiny part.
$$\iiint_R(x^2+y^2+z^2) \,dV = \int_0^adR\int d\phi \int_0^{2\pi}R^4\sin(\phi) d\theta$$
And also, $z = c\sqrt{x^2+y^2} = cR\sin(\phi)$. The only bit I've been stuck at for a long time now is: what should the integral bounds be for the $\int d\phi$?
If something is wrong or not in the right direction, please correct me. Thanks.
 A: $\hskip1.8in$ 
I think it's easier to define $\phi$ as the colatitude, i.e. as the angle from the $z$-axis. This way, the variable $R$ ranges from $0$ to $a$, $\theta$ goes all round from $0$ to $2\pi$, and $\phi$ goes from some angle $0$ to $\phi_0$. Why? Intuitively, because for a fixed $\theta$ the other two variables define a two-dimensional "pizza slice" that has its vertex at the origin, one side lying on the $z$-axis, the other on the "inner" border surface of the cone, and the crust on the "inner" border surface of the sphere; letting $\theta$ vary from $0$ to $2\pi$ means rotating this pizza slice around the $z$-axis, effectively sweeping out the whole region $R$.
But what is this angle $\phi_0$? It encodes the steepness of the cone, which depends on the constant $c$. In the case $c = 1$ the cone makes an angle of $45^\circ$ with the $z$-axis, so $\phi_0 = \pi /4$; for general $c$, you should notice from the picture below that
$$c = \cot \phi_0, $$
and so you can take the arccotangent.
$\hskip1.8in$ 
Now, we may transform our integral as follows:
$$I(a,c)=\iiint_R (x^2+y^2+z^2)\ dV =  \int_0^{2\pi}\int_0^a \int_0^{\cot^{–1} c} R^2 (R^2\sin\phi)\ d\phi\ dR\ d\theta,$$
which solves into
$$I(a,c) = 2\pi \int_0^a R^4\ dR \int_0^{\cot^{–1} c} \sin\phi\ d\phi = 2\pi \frac{a^5}{5} \int_0^{\cot^{–1} c} \sin\phi\ d\phi. $$
The last integral may seem ugly to evaluate, but we can use the fact that (with $\lambda > 0$)
$$\cos(\cot^{–1} \lambda) = \sqrt{\frac{\lambda^2}{\lambda^2 + 1}} = \frac{\lambda}{\sqrt{\lambda^2 + 1}}, $$
which is justified by letting $\lambda = \cot \alpha = \frac{\cos \alpha}{\sin \alpha}$ and by making use of the standard trigonometric identity $1 + \cot^2\alpha = \csc^2\alpha = \frac 1 {\sin^2 \alpha}$. So, all in all,
$$I(a,c) = \frac 2 5 \pi a^2 \left[1 - \frac c {\sqrt{c^2 + 1}} \right]. $$
A: The bounds of $\phi$ are defined by the cone. In particular, the cone $z = c\sqrt{x^2 + y^2}$ forms an angle of $\tan^{-1} (1/c)$ with the positive $z$ axis.
One way to see this is to imagine drawing a finite length slant height of the cone which terminates at $(x,y,z)$, and projecting it onto the $xy$ plane. The line segment's projection is the line segment from the origin to $(x,y,0)$, having length $\sqrt{x^2 + y^2}$. Note that the segment from the origin to $(x,y,0)$, the vertical segment from $(x,y,0)$ to $(x,y,z)$, and the slant height together form a right triangle. The angle at the vertex of the slant height and its projection is the angle of the cone to the $xy$ plane. What we want is the angle $\phi$ to the $z$ axis, which can be solved for via the equation $$\pi/2 - \phi = \tan^{-1} \frac{c\sqrt{x^2 + y^2}}{\sqrt{x^2 + y^2}} = \tan^{-1} c$$ which comes from trigonometry of the right triangle defined earlier.
A: Hint The shape is rotationally symmetric about the $z$-axis, so the bounds on $r, \phi$ are independent of $\theta$, and thus we can just find the bounds for any fixed $\theta$ value. A convenient choice is $\theta = 0$, which corresponds to the half-plane $\{(x, z) : x \geq 0\}$ of the $xz$-plane $\{y = 0\}$.
Substituting $y = 0$ in the equation for the cone gives that its intersection with the half-plane is $z = cx$, $x > 0$, and so $\phi$ varies from $0$ (the vertical direction) to the angle this line makes with the positive $z$-axis. Drawing a suitable right triangle with the hypotenuse contained in this line, e.g., the one with vertices the origin, $(0, c)$, and $(1, c)$ gives $\cot \phi = c$.
