TITLE: Volume of a sphere with two cylindrical holes.
QUESTION [5 upvotes]: Consider a sphere of radius $a$ with 2 cylindrical holes of radius $b<a$ drilled such that both pass through the center of the sphere and are orthogonal to one another. What is the volume of the remaining solid?
Can someone help me at least setting up the integral?   I know that there is a similar problem but it was a sphere with one hole.

REPLY [5 votes]: This answer combines the ideas of the two previous answers:  
It implements Christian Blatter's suggestion, and makes extensive use of Achille Hui's techniques.

Let $V$ be the volume of the sphere with 2 holes, let $V_{H}$ be the volume of each of the cylindrical holes, and let $V_{I}$ be the volume of the intersection of the sphere and the two cylindrical holes.
Let $c=\sqrt{a^2-b^2}$, and let $d=\sqrt{2b^2-a^2}$ when $a\le\sqrt{2}b$, so $c^2=b^2-d^2$ in this case.
Then $V_{H}=\displaystyle2\int_0^{b}2\pi x\sqrt{a^2-x^2}dx=2\pi\int_{c^2}^{a^2}\sqrt{u}du=\frac{4}{3}\pi(a^3-c^3)$ using the shell method,
so $\hspace{.9 in}\displaystyle \color{red}{V=\frac{4}{3}\pi a^3-2V_{H}+V_{I}=\frac{8}{3}\pi c^3-\frac{4}{3}\pi a^3+V_{I}}.$

$\textbf{I)}$ If $a\ge\sqrt{2}b$, the cross-sections of the intersection perpendicular to the z-axis are the squares defined by 
$\;\;\;\;|x|\le\sqrt{b^2-z^2},\;\; |y|\le\sqrt{b^2-z^2}\;\;$; so in this case
$\displaystyle V_{I}=\int_{-b}^{b}\left(2\sqrt{b^2-z^2}\right)^2dz=8\int_0^{b}(b^2-z^2)dz=\frac{16}{3}b^3$ and
$\hspace{1 in}\displaystyle \color{blue}{V=\frac{8}{3}\pi c^3-\frac{4}{3}\pi a^3+\frac{16}{3}b^3=\frac{4}{3}\left(2\pi c^3-\pi a^3+4b^3\right)}.$

$\textbf{II)}$ If $b<a\le\sqrt{2}b$, the cross-sections of the intersection perpendicular to the z-axis are
the squares defined by $\;\;\;|x|\le\sqrt{b^2-z^2},\;\; |y|\le\sqrt{b^2-z^2}\;\;\;\;$ if $|z|\ge d$,
and the portions of these squares inside the circle $x^2+y^2=a^2-z^2\;\;\;\;$if $|z|<d$.
Dividing these squares into 8 equal pieces by drawing the diagonals, we get
$V_{I}=\displaystyle 16\int_0^{d}\left(\frac{1}{2}(a^2-z^2)\left[\frac{\pi}{4}-\cot^{-1}\frac{\sqrt{b^2-z^2}}{c}\right]+\frac{1}{2}c\sqrt{b^2-z^2}\right)dz+8\int_{d}^{b}(b^2-z^2)dz$
$\displaystyle\;\;\;\;=8\int_0^{d}\frac{1}{2}\left(a^2-z^2\right)\left[\frac{\pi}{4}-\cot^{-1}\frac{\sqrt{b^2-z^2}}{c}\right]dz+8c\int_0^{d}\sqrt{b^2-z^2}dz+8\int_d^{b}(b^2-z^2)dz$
(where the first integral corresponds to a circular sector and the second corresponds to a triangle).
$\textbf{A)}$  $\;\;\displaystyle8\int_d^{b}(b^2-z^2)dz=8\left[b^{2}z-\frac{z^3}{3}\right]_d^{b}=8\left(\frac{2}{3}b^3-b^{2}d+\frac{1}{3}d^3\right)=\frac{8}{3}(2b^3-3b^{2}d+d^3)$
$\textbf{B)}\;\;\;$  Using $z=b\sin\theta, \;\;dz=b\cos\theta d\theta$ and $\gamma=\sin^{-1}\frac{d}{b}$,
$\displaystyle8c\int_0^{d}\sqrt{b^2-z^2}dz=8c\int_0^{\gamma}b^2\cos^{2}\theta d \theta=8b^2c\int_0^{\gamma}\frac{1}{2}(1+\cos2\theta)d\theta=4b^2c\left[\theta+\sin\theta\cos\theta\right]_0^{\gamma}$
$\displaystyle\hspace{1.4 in}=4b^{2}c\left(\sin^{-1}\frac{d}{b}+\frac{cd}{b^2}\right)=4b^{2}c\sin^{-1}\frac{d}{b}+4c^{2}d$.
$\textbf{C)}\;\;\;$Using integration by parts with $\displaystyle u=\frac{\pi}{4}-\cot^{-1}\frac{\sqrt{b^2-z^2}}{c}, \;\;dv=(a^2-z^2)dz$,
$\displaystyle\;\;\;8\int_0^{d}\frac{1}{2}\left(a^2-z^2\right)\left[\frac{\pi}{4}-\cot^{-1}\frac{\sqrt{b^2-z^2}}{c}\right]dz=$
$\displaystyle8\left[\left(\frac{\pi}{4}-\cot^{-1}\frac{\sqrt{b^2-z^2}}{c}\right)\left(a^2z-\frac{z^3}{3}\right)\right]_0^d+8\int_0^d\left(a^2z-\frac{z^3}{3}\right)\left(\frac{cz}{a^2-z^2}\frac{1}{\sqrt{b^2-z^2}}\right)dz$
$\displaystyle=\frac{8c}{3}\int_0^d\frac{3a^{2}z^2-z^4}{a^2-z^2}\frac{1}{\sqrt{b^2-z^2}}dz=\frac{8c}{3}\int_0^d\left(z^2-2a^2+\frac{2a^4}{a^2-z^2}\right)\frac{1}{\sqrt{b^2-z^2}}dz$.
Using $z=b\sin\theta, \;\;dz=b\cos\theta d\theta$ and $\gamma=\sin^{-1}\frac{d}{b}$, we obtain
$\displaystyle\frac{8c}{3}\int_0^{\gamma}\left(b^2\sin^2\theta-2a^2+\frac{2a^4}{a^2-b^2\sin^2\theta}\right)d\theta$
$=\displaystyle\frac{8c}{3}\left[\frac{b^2}{2}(\theta-\sin\theta\cos\theta)-2a^2\theta\right]_0^{\gamma}+\frac{16a^4c}{3}\int_0^{\gamma}\frac{\sec^2\theta}{c^2\tan^2\theta+a^2}d\theta$
$=\displaystyle\frac{4}{3}b^2c\sin^{-1}\frac{d}{b}-\frac{4}{3}c^2d-\frac{16}{3}a^2c\sin^{-1}\frac{d}{b}+\frac{16}{3}a^4c\left[\frac{1}{ac}\tan^{-1}\left(\frac{c\tan\theta}{a}\right)\right]_0^{\gamma}$
$\displaystyle=\frac{4}{3}b^2c\sin^{-1}\frac{d}{b}-\frac{4}{3}c^2d-\frac{16}{3}a^2c\sin^{-1}\frac{d}{b}+\frac{16}{3}a^3\tan^{-1}\frac{d}{a}$.
Then $\displaystyle V_I=\left[\left(\frac{4}{3}b^2c-\frac{16}{3}a^2c\right)\sin^{-1}\frac{d}{b}-\frac{4}{3}c^2d+\frac{16}{3}a^3\tan^{-1}\frac{d}{a}\right]+\left[4c^2d+4b^2c\sin^{-1}\frac{d}{b}\right]+\;\;\;\;\;\;\left[\frac{8}{3}(2b^3-3b^2d+d^3)\right]=-\frac{16}{3}c^3\sin^{-1}\frac{d}{b}+\frac{16}{3}a^3\tan^{-1}\frac{d}{a}+\frac{8}{3}(c^2d+2b^3-3b^2d+d^3),$

so $V=\displaystyle\frac{8}{3}\pi c^3-\frac{4}{3}\pi a^3-\frac{16}{3}c^3\left(\frac{\pi}{2}-\cos^{-1}\frac{d}{b}\right)+\frac{16}{3}a^3\tan^{-1}\frac{d}{a}+\frac{8}{3}\left(2b^2(b-d)\right)$
$\hspace{1 in}=\displaystyle\color{blue}{-\frac{4}{3}\pi a^3+\frac{16}{3}c^3\cos^{-1}\frac{d}{b}+\frac{16}{3}a^3\tan^{-1}\frac{d}{a}+\frac{16}{3}b^2(b-d)}.$
$\hspace{1 in}=\displaystyle\color{blue}{\frac{16}{3}\left(c^3\cos^{-1}\frac{d}{b}+a^3\tan^{-1}\frac{d}{a}-\frac{\pi}{4}a^3+b^2(b-d)\right)}.$