Triple integral over spherical coordinates I'm looking over this problem.

Let the function $f(x,y,z)=\sqrt{x^2+y^2+z^2}$ describe the density in the region $A=\{x^2+y^2+z^2\leq1,\sqrt{x^2+y^2}\leq z\}$. Use spherical coordinates to compute its mass.

I'm having some trouble understanding how the bounds for integrating the angle of the cone were found to be $0$ to $\pi/4$. Any help would be greatly appreciated.
 A: To see why the bounds on the polar angle $\theta$ are restricted from $[0,\pi]$ to $[0,\frac{\pi}{4}]$ by the inequality $\sqrt{x^2+y^2}\leq z$, rewrite the inequality in spherical coordinates. In spherical coordinates, the RHS of the inequality is $z=r\cos{\theta}$, and the LHS of the inequality is: 
$$\sqrt{x^2+y^2}=\sqrt{\left(r\sin{\theta}\cos{\phi}\right)^2+\left(r\sin{\theta}\sin{\phi}\right)^2}\\
=r|\sin{\theta}|\\
=r\sin{\theta}.$$
Note in the last line above we were able to drop the absolute value bars around $\sin{\theta}$ because the polar angle $\theta$ only ranges from $0$ to $\pi$, and the sine function is non-negative on that interval. Hence, the inequality $\sqrt{x^2+y^2}\leq z$ in spherical coordinates is simply:
$$\sin{\theta}\leq\cos{\theta}.$$
We can rewrite this trigonometric inequality in a way that makes the restriction on the bounds of $\theta$ to $0\leq\theta\leq\frac{\pi}{4}$ much more transparent:
$$\sin{\theta}\leq\cos{\theta}\iff0\leq\cos{\theta}-\sin{\theta}=\sqrt{2}\sin{\left(\frac{\pi}{4}-\theta\right)}\\
\iff0\leq\sin{\left(\frac{\pi}{4}-\theta\right)}.$$
