<s>[INST] Integration using spherical coordinates I'm trying to evaluate this triple integral:
$$\iiint_{V}(x^2+y^2+z^2-1)\,dx\,dy\,dz$$ where $V=\{(x,y,z)\in\mathbb{R}^3,\ x^2+y^2+z^2\le2,\ x^2+y^2\le z\}$.
After applying the spherical coordinates, I find that $V'=\begin{cases} 0\le \rho\le \sqrt2 \\ \cfrac{5\pi}{4}\le \theta\le \cfrac{7\pi}{4} \\ 0\le \varphi\le 2\pi \end{cases}$
I have to calculate the integral $$\iiint_{V'}(\rho^4\sin\theta-\rho^2\sin\theta)\,d\rho\,d\theta\,d\varphi$$ and, after splitting it up into 2 integrals, the result I get is $-8\pi/15$. According to my textbook, the result should be  $\pi\left({\frac{4}{15}\sqrt2-\frac{19}{60}}\right)$.
 [/INST] We have $x = \rho \sin(\theta)\cos(\phi) , y = \rho \sin(\theta)\sin(\phi) , z = \rho \cos(\theta)$, thus the first limit translates into $0\le \rho \le \sqrt{2}$ and the second one turns to $\rho^2\sin^2(\theta)\le\rho\cos(\theta)$ which means $\rho \le \frac{\cos(\theta)}{\sin^2(\theta)}$ and the $\phi$ is unconditional thus $0\le \phi \le 2\pi$. Also the paraboloid and sphere intersect at $\theta = \frac{\pi}{4}$ and $\theta = \frac{3\pi}{4}$ which gives us two slices of sphere and one whole large slice of paraboloid. Now we have 
$$\iiint_{V}(x^2+y^2+z^2-1)\,dx\,dy\,dz = \int_{0}^{2\pi}d\phi\int_{\frac{\pi}{4}}^{\frac{3\pi}{4}}\sin(\theta)d\theta\int_{0}^{\frac{\cos(\theta)}{\sin^2(\theta)}}(\rho^2-1)\rho^2 d\rho +2\int_{0}^{2\pi}d\phi\int_{0}^{\frac{\pi}{4}}\sin(\theta)d\theta\int_{0}^{\sqrt{2}}(\rho^2-1)\rho^2 d\rho = \int_{0}^{2\pi}d\phi\int_{\frac{\pi}{4}}^{\frac{3\pi}{4}}(\frac{\cos^5(\theta)}{\sin^{10}(\theta)}-\frac{\cos^3(\theta)}{\sin^6(\theta)})\sin(\theta)d\theta + \frac{4\pi\sqrt{2}}{15}\times\left(1-\frac{\sqrt{2}}{2}\right)$$
I can't go further, are you sure the question is correct?
</s>