How to find the volume of the part of a sphere that protrudes from a square prism?

51 Views Asked by At

I have a square prism with width $W$ and height $H$. So it's $W \times W \times H$, where in this case $W$ is less than $H$. The center of mass of the prism is at the origin and the center of a sphere of radius $R$ is also at the origin (see the picture created in Sketchup). I'm trying to find the volume of the Sphere that protrudes out of the Square prism. I can find the volume of the spherical cap that comes out the top. But I'm having trouble finding the volume around the sides, which are not just spherical caps.

I'm trying to set up an integral using spherical coordinates to find the part that extends out from the face at $y=W/2$. Then I plan to multiply this by 4 to get the total side volume. This is the integral I have now.

$$\int_{\pi/2}^{3\pi/2}\int_?^?\int_{W/(2\sin\phi\sin\theta)}^{R}\rho^2 \sin\phi d\rho d\theta $$

So as you can see, I don't know what limits to put on $\phi$. Are there some reasonable limits I could put on $\phi$ that will allow me to compute this integral? Or is there a better way to set this up? Perhaps a change of variables?

Sphere protruding out from a square prism