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!
 A: 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.
A: I seem to disagre with the calculation of the integral in Jared answer, I did the integral by hand and with Mathematica and I get the following.
$$
8\int_0^{\frac{\pi}{2}} \int^{a\cos(\theta)}_0 r\sqrt{a^2-r^2}  dr d\theta = \frac{4}{9} a^3 (3 \pi -4)
$$
I guess the discrepancy has to do with the fact that the integral $\int_0^{a \cos(\theta)} r \sqrt{a^2-r^2} \, dr = -\frac{1}{3}a^3 (-1+ \sin ^2(\theta)^{3/2})$ which is $-\frac{1}{3} a^3(-1+ |\sin(\theta)|^3)$. Sometimes you forget the absolute value...
See Volume of a solid between sphere and cylinder for a similar problem.
