Calculate volume between two geometric figures I have a figure C that is defined as the intersection between the sphere $x^2+y^2+z^2 \le 1 $ and the cyllinder $x^2+y^2 \le \frac{1}{4}$.
How should i calculate the volume of this figure?

Here is a sketch of the sphere and part of the infinite length cylinder:

(Large version)
It suggests to split the intersection volume into three volumes: 


*

*the fully enclosed cylinder part $V_m$ in the middle and 

*the two spherical caps, one on top $V_t$, one at the bottom $V_t$, where by symmetry $V_t = V_b$


At the cap base circles we have both
$$
x^2 + y^2 + z^2 = 1 \\
x^2 + y^2 = 1/4
$$
Subtracting gives
$$
z^2 = 3/4 \iff \\
z = \pm \sqrt{3}/2
$$
This gives 
$$
V_m= \pi r^2 h = \pi (1/2)^2 \cdot 2 \cdot \sqrt{3}/2 = \pi \sqrt{3}/4
$$
For the top cap we stack up disc shaped volume elements
$$
dV = A(z) \, dz
$$
where $A(z)$ is the area of a disc at height $z$ and get
\begin{align}
V_t 
&= \int\limits_{\sqrt{3}/2}^1 A(z) \, dz \\
&= \int\limits_{\sqrt{3}/2}^1 \pi r(z)^2 \, dz \\
&= \int\limits_{\sqrt{3}/2}^1 \pi (1-z^2) \, dz \\
&= \pi \, \left[z - z^3/3 \right]_{\sqrt{3}/2}^1 \\
&= \pi \left( 1-1/3 - (\sqrt{3}/2 - (\sqrt{3}/2)^3/3)  \right) \\
&= \pi \left( 2/3 - \sqrt{3}/2 + \sqrt{3}/8 \right) \\
&= \pi \left( 2/3 - 3\sqrt{3}/8 \right) \\
\end{align}
This gives
\begin{align}
V &= V_t + V_m + V_b \\ 
&= \pi \sqrt{3}/4 + 2 \pi \left( 2/3 - 3 \sqrt{3} / 8 \right) \\
&= \pi \left( 4/3 - 2 \sqrt{3}/4 \right) \\
&= \pi \left( 4/3 - \sqrt{3}/2 \right)
\end{align}
