<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] I show below how you do this calculation as a difference of two volumes:
The volume is given by $I(a)-I(b)$ where (for $0<s<R$), $I(s)$ is defined to be the volume of the ball $x^2+y^2+z^2\leq R^2$ such that $z>s$. Let us calculate $I(s)$ (you complete the details):
The domain is bounded from below by the plane $z=s$ and from above by the surface $z=\sqrt{R^2-x^2-y^2}$. The domain projected onto the $xy$-plane is a disc $D:x^2+y^2\leq R^2-s^2$. Thus,
$$
I(s)=\iint_D\Bigl(\sqrt{R^2-x^2-y^2}-s\Bigr)\, dx\,dy
$$
Changing to polar coordinates $(r,\phi)$, this becomes
\begin{align}
I(s)&=\int_0^{2\pi}\, d\phi\int_0^{\sqrt{R^2-s^2}}\Bigl(\sqrt{R^2-r^2}-s\Bigr)r\,dr\\
&=2\pi\Bigl[-\frac{1}{3}(R^2-r^2)^{3/2}-\frac{1}{2}sr^2\Bigr]_0^{\sqrt{R^2-s^2}}\\
&=2\pi\Bigl(-\frac{1}{3}s^3-\frac{1}{2}s(R^2-s^2)+\frac{1}{3}R^3\Bigr).
\end{align}
Thus (collect and simplify), the volume you look for is:
$$
I(a)-I(b) = \pi R^2(b-a) -\frac{\pi}{3}(b^3-a^3).
$$
Just as a side-note we see that the expression above is non-negative:
Since $a$ and $b$ are bounded by $R$,
$$
\frac{\pi}{3}(b^3-a^3)=\frac{\pi}{3}(b-a)(b^2+ab+a^2)\leq \frac{\pi}{3}(b-a)(R^2+R^2+R^2)=\pi R^2(b-a).
$$
OK!
</s>