[Math] Volume of a ‘cylinder with rounded sides’

solid-geometryvolume

I need to find the volume of a torus-shaped object, but it which doesn't have space between the ring.
We can find the volume of the ring, but what about the inner part?

PS: What is that shape called?

EDIT:
I've edited the title. What I mean, is a Cylinder, with rounded sides.

Best Answer

Let $S$ be our shape. The picture below (made with Pov-Ray) illustrates $S$. It is the intersection of a torus (red) with a cylinder (blue, half-transparent).

Torus-cylinder-intesection

Furthermore, let $h$ be its height and $r$ be the radius at the top (so the radius at the middle is $r+h$) (see image below, made with Paint :$).

Graph $R(x)$

Now we call the radius at a given height $x$ the function $R(x)$ (where $x$ goes from $x=-\frac12h$, bottom, to $x=\frac12h$, top. See the graph above. $x$ is on the x-axis). Luckily the shape of a circle is easy, so we can compute $R(x)$ by $$R(x)=r+\sqrt{\tfrac14h^2-x^2}$$ So now we can calculate the volume by rotating $R(x)$ around the x-axis (see this wikipedia article for more information about revolving an area between a curve and the x-axis):

\begin{align}\pi\int_{-h/2}^{h/2}R(x)^2 &=\pi\int_{-h/2}^{h/2}\left(r+\sqrt{\tfrac14h^2-x^2}\right)^2dx\\ &=\pi\int_{-h/2}^{h/2}\left(r^2+2r\sqrt{\tfrac14h^2-x^2}+\sqrt{\tfrac14h^2-x^2}^2\right)dx\\ &=\pi\left(\int_{-h/2}^{h/2}r^2dx+2r\int_{-h/2}^{h/2}\sqrt{\tfrac14h^2-x^2}dx+\int_{-h/2}^{h/2}|\tfrac14h^2-x^2|dx\right)\\ &=\pi\left(hr^2+2r(\tfrac12\pi\cdot \tfrac14h^2)+\int_{-h/2}^{h/2}\tfrac14h^2dx-\int_{-h/2}^{h/2}x^2dx\right)\\ &=\pi\left(hr^2+\tfrac14r\pi h^2+\tfrac14h^3-[\tfrac13x^3]_{-h/2}^{h/2}\right)\\ &=\pi\left(hr^2+\tfrac14r\pi h^2+\tfrac14h^3-\tfrac1{12}h^3\right)\\ &=h\pi\left(r^2+\tfrac14r\pi h+\tfrac16h^2\right)\\ \end{align}

Related Question