The problem is to find $$\iiint_{R}z \ \mathrm{d}V$$ Where $R$ is the region $x^2+y^2\leq z \leq \sqrt{2-x^2-y^2}.$
Using cylindrical coordinates this problem becomes relatively easy:
\begin{align} x &= r\cos(\theta)\\ y &= r\sin(\theta)\\ z &= z\\ \mathrm{d}V&=r \ \mathrm{d}z\mathrm{d}r\mathrm{d}\theta \end{align} with boundaries $$ r^2\leq z\leq \sqrt{2-r^2}, \ 0\leq\theta< 2\pi, \ 0\leq r\leq1 $$ which gives $$\iiint_{R}z \ \mathrm{d}V = \int_{0}^{2\pi}\int_{0}^{1}\int_{r^{2}}^{\sqrt{2-r^2}}zr \ \mathrm{d}z \mathrm{d}r\mathrm{d}\theta=\pi\int_{0}^{1}2r-r^{3}-r^{5} \ \mathrm{d}r = \frac{7\pi}{12}.$$
While this is correct i'd like to know if it is possible to do this with spherical coordinates. My problem is that for the substitution \begin{align}x&=R\sin(\phi) \cos(\theta)\\ y &=R\sin (\phi) \sin (\theta)\\ z&= R\cos(\phi)\\ \mathrm{d}V&= R^{2}\sin(\phi) \ \mathrm{d}R\mathrm{d}\phi\mathrm{d}\theta\end{align} I get $$0\leq R\leq \sqrt{2}\ ,0\leq \theta < 2\pi$$ but how do I get $\phi$? The problem is that I cannot find $$\tan(\phi)=\frac{r}{z}=\frac{\sqrt{x^2+y^2}}{z}$$
This problem is easy in spherical coordinates if you know the trick. The upper bound gives us $R = \sqrt{2}$. Solving the lower bound gets
$$R\sin^2\phi = \cos\phi \implies R\cos^2\phi + \cos \phi -R = 0 $$
then by the quadratic equation we have that
$$\phi = \cos^{-1}\left(\frac{-1+\sqrt{1+4R^2}}{2R}\right)$$
where we took the positive root since we are above the $xy$ plane where $\cos\phi > 0$. Next we set up the integral with the $\phi$ integral first:
$$I = \int_0^{2\pi} \int_0^{\sqrt{2}} \int_0^{\cos^{-1}\left(\frac{-1+\sqrt{1+4R^2}}{2R}\right)}R^3\cos\phi\sin\phi \:d\phi \: dR \:d\theta$$
$$ = \frac{\pi}{2} \int_0^{\sqrt{2}}R\sqrt{1+4R^2}-R\:dR = \frac{\pi}{2}\left[\frac{1}{12}(1+4R^2)^{\frac{3}{2}}-\frac{1}{2}R^2\right]_0^{\sqrt{2}} = \frac{7\pi}{12}$$
Although not as clean as the polynomial that appears in the cylindrical coordinates version, this trick is useful to remember for similar integrals, since the integrand will determine whether this method or cylindrical coordinates is the optimal route to take. For other integrals, such as $\iiint_R dV$, this version will be easier than cylindrical coordinates.