Find volume of the cap of a sphere of radius R with thickness h

To set up the integral in sphericals, just draw a picture. The limit in $\theta$ is determined by

$$\cos{\theta} = \frac{R-h}{R}$$

Therefore, the volume of the cap is the integral

$$2 \pi \, \int_0^{\arccos{[(R-h)/R]}} d\theta \, \sin{\theta} \, \int_{(R-h)/\cos{\theta}}^R dr \, r^2 $$


$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{}$ \begin{align} V_{\rm cap}&=\int_{\rm cap}\dd V\ =\ \overbrace{\int_{\rm cap}{1 \over 3}\,\nabla\cdot\vec{r} \,\dd V ={1 \over 3}\int_{ \mbox{cap surface}}\vec{r}\cdot\dd\vec{S}} ^{\color{#c00000}{\ds{\mbox{Gauss Divergence Theorem}}}} \\[3mm]&={1 \over 3}\braces{% \int_{\rm bottom}\bracks{-\pars{R - h}\,\verts{\dd S_{z}}} +\int_{\rm top}R\,\hat{r}\cdot\dd\vec{S}} \\[3mm]&={1 \over 3}\braces{-\pars{R - h}\pi\bracks{R^{2} - \pars{R - h}^{2}} +R^{3}\int_{0}^{2\pi}\dd\phi\int_{0}^{\arccos\pars{\bracks{R - h}/R}} \dd\theta\,\sin\pars{\theta}} \\[3mm]&={1 \over 3}\,\pi\braces{% -\pars{R - h}\pars{2Rh - h^{2}} - 2R^{3}\bracks{{R - h \over R} - 1}} \\[3mm]&={1 \over 3}\,\pi\pars{-2R^{2}h + Rh^{2} + 2Rh^{2} - h^{3} + 2R^{2}h} ={1 \over 3}\,\pi\pars{3Rh^{2} - h^{3}} \end{align}

$$\color{#44f}{\large% V_{\rm cap} = \bracks{% {3 \over 4}\,\pars{h \over R}^{2} - {1 \over 4}\,\pars{h \over R}^{3}}\color{#c00000}{{4 \over 3}\,\pi R^{3}}}\,,\qquad\qquad 0 \leq h \leq 2R $$


You can solve this problem using solids of revolution.

Define a circle as $x^2+y^2=R^2$

$\Rightarrow x=\sqrt{R^2-y^2}$

By constructing wide circular cylinders on top of one another, decreasing in size as you move towards the top, one gets

$V=\int\limits_{R-h}^R\pi(R^2-y^2)dy\\=\left.\pi R^2y-\pi\frac{1}{3}y^3\right]_{R-h}^R=\pi Rh^2-\frac{1}{3}\pi h^3$