Compute $$I=\iiint_D\sqrt{x^2+y^2+z^2} \ dxdydx,$$
where $D=\{(x,y,z):x^2+y^2+z^2\leq 1, \quad \sqrt{x^2+y^2}\leq z\}.$
It's quite clear that space-polar coordinates will do the trick here. The intersection between the sphere with radius 1 and the cone is the circle $x^2+y^2=1/2,$ so
$$\left\{ \begin{array}{rcr} x & = & r\sin{\theta}\cos{\varphi} \\ y & = & r\sin{\theta}\sin{\varphi} \\ z & = & r\cos{\theta} \end{array} \right. \implies E:\left\{ \begin{array}{rcr} 0\leq r \leq \frac{1}{\sqrt{2}} \\ 0\leq \theta \leq \pi \\ 0\leq \varphi \leq 2\pi \end{array} \right.\implies J(r,\theta,\varphi)=r^2\sin{\theta}.$$
which transforms my integral to
\begin{array}{lcl} I & = & \iiint_E \sqrt{r^2(\sin^2{\theta}\cos^2{\varphi} + \sin^2{\theta}\sin^2{\varphi} +\cos^2{\theta})}\cdot J(r,\theta,\varphi) \ dr \ d\theta \ d\varphi =\\ & = & \iiint_E|r|r^2\sin\theta \ dr \ d\theta \ d\varphi = (\text{since} \ r\geq0)\\ & = & \iiint_E r^3\sin\theta \ dr \ d\theta \ d\varphi =\\ & = & 2\pi\left(\int_0^{1/\sqrt{2}}r^3 \ dr\right)\left(\int_0^{\pi}\sin{\theta} \ d\theta\right) = 2\pi\cdot\frac{1}{16}\cdot 2 = \frac{\pi}{4} \end{array}
Correct answer is $$\frac{\pi}{2}\left(1-\frac{1}{\sqrt{2}}\right).$$
Does anyone see where my mistake is?
Make sure you draw a picture for any of these types of questions! This would help you spot errors like $0 \leq \theta \leq \pi$. The ranges you've given would be the whole upper hemisphere for a ball radius $\frac{1}{\sqrt{2}}$, but you only want the region above the cone. So, restricting to $0 \leq \theta \leq \frac{\pi}{4}$ is the region you're looking for.
In addition, notice $(1,0,0) \in D$ and more generally there should not be a restriction to $0 \leq r \leq \frac{1}{\sqrt{2}}$. You should instead have $0 \leq r \leq 1$.
Then, you'll see that $\int_0^{\frac{\pi}{4}} \sin \theta \, d\theta = 1 - \frac{1}{\sqrt{2}}$ and $\int_0^1 r^3 \, dr = \frac{1}{4}$.