Overlapping spheres Say you have two spheres that are partially overlapping. How would I find the volume of the portion of one of the spheres that is not overlapping with the other based on how far apart the two spheres are and the spheres' individual radii?
 A: You can see this at Mathworld or $V^{(2)}$ under Application in Wikipedia

If $d<r_1+r_2$ is the distance between the two sphere centers ... of two intersecting spheres of radii $r_1$ and $r_2$, ...
  $$V^{(2)} = \frac{\pi}{12d}(r_1+r_2-d)^2\left(d^2+2d(r_1+r_2)-3(r_1-r_2)^2\right)$$
  is the sum of the two spherical caps of the intersection.

A: Assume that the 2 spheres have equal radii.  The volume of the intersection is given by
$$V_I = 2 \pi \int_{-a}^{-d/2} dx \: (a^2-x^2)=\frac{4 \pi}{3} a^3-\pi d \left (a^2-\frac{d^2}{12}\right)$$
where $a$ is the radius of each sphere and $d$ is the separation between the centers of the spheres.  So the volume in a sphere outside of the intersection is
$$\pi d \left (a^2-\frac{d^2}{12}\right)$$
For the general case, assume that the spheres have radii $a$ and $b>a$.  The geometry of the intersection is a lens of thickness $d$, the thickness of the lens surface of radius $a$ being
$$t_a = \frac{a^2-(b-d)^2}{2 d}$$
and that of the lens surface of radius $b$ is
$$t_b = \frac{b^2-(a-d)^2}{2 d}$$
The volume of the lens is then
$$\begin{align}V_I &= \pi \int_{a-t_a}^a dx \: (a^2-x^2) + \pi \int_{-b}^{-b+t_b} dx \: (b^2-x^2)\\ &=\frac{\pi}{12 d}(a+b-d)^2 \left(2 d (a+b)+9 (b-a)^2+d^2\right) \end{align}$$
To get the volume outside of this lens in either sphere, subtract $V_I$ from either $\frac{4 \pi}{3} a^3$ or $\frac{4 \pi}{3} b^3$.
