<s>[INST] Volume bounded by sphere $x^2+y^2+z^2=a^2$ and cylinder $x^2+y^2=a|x|$ What is the volume bounded by the sphere $x^2+y^2+z^2=a^2$ and the cylinder $x^2+y^2=a|x|$?
The answer can be in terms of the value $a$ (or $r$). Does someone know how to do this?
Thank you in advance!
 [/INST] The figure is symmetric, with equal volume in each of the eight octants, so we focus on the first octant, and multiply by $8$.  Let's work in cylindrical coordinates.  In that case, our function is $z=\sqrt{a^2-r^2}$, and our region of integration is bounded by
$$0\le\theta\le\frac{\pi}{2}\\0\le r\le a\cos\theta$$
The volume is then:
$$8\int_0^{\frac{\pi}{2}}\int_{0}^{a\cos\theta}\int_{0}^{\sqrt{a^2-r^2}}rdzdrd\theta=8\int_0^{\frac{\pi}{2}}\int_{0}^{a\cos\theta}r\sqrt{a^2-r^2}drd\theta=\frac{2a^3\pi}{3}$$
Recall that the volume element in cylindrical coordinates is $rdzdrd\theta$.  The above integral is then evaluated by the substitution $x=a^2-r^2$.
Notice that our answer is half of the volume of the sphere, so there is an equal volume inside of the cylinder bounded by the sphere as there is outside of the cylinder bounded by the sphere.
</s>