Changing the order of integration of a volume integral I'm currently struggling to change the order of integration of following volume integral, where $f(x,y,z)$ is a continuous function:
$$ \int_{-a}^{a}dx \int^{\sqrt{a^2-x^2}}_{-\sqrt{a^2-x^2}}dy \int^{\sqrt{2a^2 - x^2 - y^2}}_{\sqrt{x^2+y^2}} f(x,y,z) dz \qquad (a > 0). $$
I'm supposed to swap the $dy$ and $dz$.
I fail to completely visualise the volume, which isn't illogical I suppose. However, in lower dimensions, I'm able to solve this kind of problems algebraically (rewriting the functions that bound the integral). But, in this case, not only the bounds of $dy$ and $dz$ need to be "transformed", but also the bounds of $dx$ (split the integral in three parts - as stated by the solution (without explanation)). So there are three "changes" simultaneously and I can't find the relations to do so.
Is there a general method to solve this kind of problems? I hope this question is rather clear.
Thanks in advance!
 A: Your "snow cone" solid is obtained by rotating the region in the $xz-$plane defined by $$\{(x,0,z):|x|\leq z\leq\sqrt{2a^2-x^2},|x|\leq a\}$$ about the $z-$axis. This is the shadow of your snow cone onto the $xz-$plane. Let's fix points in this region of the $xz-$plane and study how $y-$varies to obtain the bounds on our inner most integral.
If $|x|\leq z\leq a$ the surface bounding the solid is the cone $z=\sqrt{x^2+y^2}$ and so $$-\sqrt{z^{2}-x^{2}}\leq y \leq \sqrt{z^{2}-x^{2}}$$
If $a\leq z \leq \sqrt{2a^2-x^2}$ the surface bounding the solid is the sphere $x^2+y^2+z^2=2a^2$ and so $$-\sqrt{2a^2-x^2-z^2}\leq y \leq \sqrt{2a^2-x^2-z^2}$$
Your integral splits up as a sum of two integrals:
$$\int_{-a}^{a}\int_{\left|x\right|}^{a}\int_{-\sqrt{z^{2}-x^{2}}}^{\sqrt{z^{2}-x^{2}}}f(x,y,z)dydzdx+\int_{-a}^{a}\int_{a}^{\sqrt{2a^{2}-x^{2}}}\int_{-\sqrt{2a^2-x^2-z^2}}^{\sqrt{{2a^2-x^2-z^2}}}f(x,y,z) dydzdx$$
A: The integration region in the $xy$-plane is the circular area $x^2+y^2=a^2$, which allows the order to be switched as
$$ \int_{-a}^{a}dy \int^{\sqrt{a^2-y^2}}_{-\sqrt{a^2-y^2}}dx \int^{\sqrt{2a^2 - x^2 - y^2}}_{\sqrt{x^2+y^2}} f(x,y,z) dz $$
