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)$.
 A: It is actually convenient to set up the integral in cylindrical coordinates as
$$I= \int_0^{2\pi}d\theta \int_0^1 rdr \int_{r^2}^{\sqrt{2-r^2}}
(r^2+z^2-1)dz=\frac{16\sqrt2-19}{60}\pi$$
where the limits for $z$ are just the two given bounding surfaces and the upper limit for $r$ is the intersection between the sphere and paranoid. 
A: 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?
A: We have that $x^2+y^2+z^2=r^2$, thus the integral becomes 
$$
\iiint_{V'} (r^2-1)r^2\sin\theta\,\mathrm d r\,\mathrm d \theta\,\mathrm d \phi\tag1
$$
where
$$
V'=\{(r,\phi,\theta)\in(0,\infty )\times (0,2\pi)\times (0,\pi):r\leqslant \sqrt2\,\land\,r\sin^2\theta\leqslant \cos\theta \}\tag2
$$
and because $\sin \theta>0$ in $(0,\pi)$ we have that
$$
r\sin^2\theta\leqslant \cos\theta\iff r\leqslant \frac1{\sin\theta\tan\theta}\tag3
$$
Therefore
$$
\iiint_{V'} (r^2-1)r^2\sin\theta\,\mathrm d r\,\mathrm d \theta\,\mathrm d \phi
=2\pi\int_0^\pi\int_0^{C(\theta)}r^2(r^2-1)\sin\theta\,\mathrm d r\,\mathrm d \theta\tag4
$$
for
$$
C(\theta):=\max\left\{0,\min\left\{\sqrt2,\frac1{\sin\theta\tan\theta}\right\}\right\}\tag5
$$
Now its easy to check that
$$
\theta\in(0,\pi)\,\land\,  0\leqslant \frac1{\sin\theta\tan\theta}\leqslant \sqrt2\iff \theta\in\left(\frac{\pi}4,\frac{\pi}2\right)\tag6
$$
Hence
$$
C(\theta)=\begin{cases}
\frac1{\sin\theta\tan\theta},&\theta\in(\pi/4,\pi/2)\\
\sqrt2,& \theta\in(0,\pi/4)\\
0,&\text{ otherwise }
\end{cases}\tag7
$$
Substituting the values of $C$ in $\mathrm{(4)} $ gives a messy integral for $\theta\in(\pi/4,\pi/2)$, I will not continue.
