<s>[INST] Find the volume of the region of a sphere bounded by two planes Calculate the volume of a sphere $x^2+y^2+z^2=R^2$ which is bounded by $z=a$ and $z=b$, where $0\leq a<b<R$ using double integral. I can imagine the picture but I don't know how to set it up.
 [/INST] The projection of the solid in the xy-plane is the region bounded by the circle $x^2+y^2=R^2-a^2$, 
and the height of the solid is constant inside the circle $x^2+y^2=R^2-b^2$.
Using a double integral in polar coordinates, we get
$V=\displaystyle\int_0^{2\pi}\int_0^{\sqrt{R^2-b^2}}(b-a)r\;dr d\theta+\int_0^{2\pi}\int_{\sqrt{R^2-b^2}}^{\sqrt{R^2-a^2}}\left(\sqrt{R^2-r^2}-a\right)r\;dr d\theta$
$\;\;\;\;\displaystyle=2\pi(b-a)\left(\frac{R^2-b^2}{2}\right)+2\pi\left[\frac{1}{2}\cdot\frac{2}{3}(b^3-a^3)-\frac{a}{2}(b^2-a^2)\right]$
$\;\;\;=\displaystyle\pi(b-a)(R^2-b^2)+\frac{\pi}{3}\left[2(b^3-a^3)-3a(b^2-a^2)\right]$
$\;\;\;=\displaystyle\frac{\pi}{3}(b-a)\left[3R^2-b^2-ab-a^2\right]$.

As pointed out in the comments, it is easier to calculate this volume as a solid of revolution, which gives
$\displaystyle V=\int_a^b \pi(R^2-z^2)\;dz=\pi\left[R^{2}z-\frac{z^3}{3}\right]_a^b=\pi\left(R^2 b-\frac{b^3}{3}-R^2 a+\frac{a^3}{3}\right)$.
</s>