I'm having some troubles when I have to find the integral bounds in triple integrals. I'll take this example and write my attempt:
$$\iiint_\Omega{dxdydz}$$
Where $\Omega=\{(x,y,z)\in\mathbb{R}^3 : x^2+y^2+z^2\leq1, x^2-x+y^2\leq0\}$
Using cylindrical coordinates we have that
$$\iiint_\Omega{dxdydz}=\iiint_Drdrd\theta dz$$
Where $D=\{(r\cos\theta,r\sin\theta,z)\in\mathbb{R}^3 : r^2+z^2\leq1, r^2-r\cos\theta\leq0,r\geq0,\theta\in[0,2\pi)\}$
From $r^2-r\cos\theta\leq0$ we found that $\theta\in\left[-\frac{\pi}{2},\frac{\pi}{2}\right]$ and that $r\in\left[0,\cos\theta\right]$;
From $r^2+z^2\leq1$ we found that $z\in\left[-\sqrt{1-r^2},\sqrt{1-r^2}\right]$
Here comes the doubt: why is incorrect to find $r$ from $r^2+z^2\leq1$ writing $0\leq r\leq\sqrt{1-z^2}$ and then, from $\sqrt{1-z^2}$, say that $z\in\left[-1,1\right]$? I've tried and I got another result.
Can someone please explain me how the choose of variables gives the right integration bounds? Thanks to you all.