Calculate the integral $\iiint\limits_{D}dxdydz$ over domain D Let $a\in (-1,1)$ and domain $D=\{(x,y,z)\in \Bbb R:x^2+y^2+z^2<1,z>a\}$.
I try to calculate the integral $$\iiint\limits_{D}dxdydz$$ with the use of cylindrical coordinates, but I couldn't find the limits of the integration. Do you have any idea about the limits of the integral ?
 A: As in our region $D$ we have
$$ x^2+y^2+z^2 < 1 $$
and
$$
z > a,
$$
so we can take $r$, $\theta$, and $z$ as follows:
$$
0 \leq r <  1,
$$
$$
0 \leq \theta \leq 2 \pi,
$$
and
$$
a < z < 1.
$$
Moreover, we note that, since
\begin{align}
x &= r \cos \theta, \\
y &= r \sin \theta, \\
z &= z, 
\end{align}
therefore we find that
\begin{align}
\frac{\partial(x, y, z) }{\partial(r, \theta, z)} &= \left| \begin{matrix} \frac{\partial x}{\partial r } & \frac{\partial x}{\partial \theta } & \frac{\partial x}{\partial z } \\
\frac{\partial y}{\partial r } & \frac{\partial y}{\partial \theta } & \frac{\partial y}{\partial z } \\
 \frac{\partial z}{\partial r } & \frac{\partial z}{\partial \theta } & \frac{\partial z}{\partial z } 
  \end{matrix} \right| \\
&= \left| \begin{matrix} \cos \theta & - r\sin \theta & 0 \\
\sin \theta & r \cos \theta & 0 \\ 
0 & 0 & 1  \end{matrix} \right| \\
&= \left| \begin{matrix} \cos \theta & -r \sin \theta \\ \sin \theta & r \cos \theta  \end{matrix} \right| \\
&= r \cos^2 \theta - \left(-r \sin^2 \theta \right) \\
&= r,
\end{align}
and so
\begin{align}
\int\int\int_{D}\, dx \, dy\, dz &= \int_{z = a}^{z = 1} \int_{\theta = 0}^{\theta = 2 \pi} \int_{r = 0 }^{r = 1}   r d r\, d \theta \,  dz \\
&= \int_{z = a}^{z = 1} \int_{\theta = 0}^{\theta = 2 \pi} \frac{1}{2} d \theta \,  dz \\
&= \int_{z = a}^{z = 1} \frac{1}{2} (2 \pi ) dz \\
&= \int_{z = a}^{z = 1} \pi dz \\
&= \pi (1 - a).
\end{align}
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{D \equiv \braces{\pars{x,y,z} \in
\mathbb{R}: x^{2} + y^{2} + z^{2} < 1,\ z > a\ \mbox{where}\ a \in \pars{-1,1}}}$.

\begin{align}
&\bbox[5px,#ffd]{\iiint_{D}\dd x\,\dd y\,\dd z}
\\[5mm] = &\
\left.\iiint_{\large\mathbb{R}^{3}}\bracks{x^{2} + y^{2} + z^{2} < 1}
\bracks{z > a}\dd x\,\dd y\,\dd z
\,\right\vert_{\ a\ \in\ \pars{-1,1}}
\\[5mm] = &\
\int_{0}^{2\pi}\int_{0}^{\pi}\int_{0}^{1}
\bracks{r\cos\pars{\theta} > a}r^{2}\sin\pars{\theta}
\,\dd r\,\dd\theta\,\dd\phi
\\[5mm] = &\
2\pi\int_{0}^{1}r^{2}\int_{-1}^{1}\bracks{r\xi > a}\,\dd\xi\,\dd r =
2\pi\int_{0}^{1}r^{2}\int_{-1}^{1}\bracks{\xi > {a \over r}}
\,\dd\xi\,\dd r
\\[5mm] = &\
2\pi\int_{0}^{1}r^{2}\braces{%
\bracks{{a \over r} < -1} \int_{-1}^{1}\,\dd\xi +
\bracks{-1 < {a \over r} < 1} \int_{a/r}^{1}\,\dd\xi}\,\dd r
\\[5mm] = &\
2\pi\int_{0}^{1}r^{2}\braces{%
\bracks{r < -a}2 +
\bracks{r > \verts{a}}\pars{1 - {a \over r}}}\,\dd r
\\[5mm] = &\
2\pi\verts{a < 0}\int_{0}^{-a}2r^{2} +
2\pi\int_{\verts{a}}^{1}\pars{r^{2} - ar}\,\dd r
\\[5mm] = &\
2\pi\braces{-\bracks{a < 0}{2 \over 3}\,a^{3} +
{1 \over 3} - {a \over 2} + {1 \over 2}a^{3} - {1 \over 3}\,\verts{a}^{3}}
\\[5mm] = &\
{1 \over 3}\braces{-\bracks{a < 0}4a^{3} +
2 - 3a + 3a^{3} - 2\verts{a}^{3}}\pi
\\[5mm] = &\
\bbx{{1 \over 3}\,\pars{a^{3} - 3a + 2}\pi} \\ &
\end{align}
A: This should be your set-up in spherical:
$\int_0^{2\pi}\int_a^1\int_0^{\sqrt{1-z^2}} r\ dr\ dz\ d\theta$
Which integarates as follows:
$\int_0^{2\pi}\int_a^1 \frac 12  (1-z^2)  dz\ d\theta\\
\int_0^{2\pi} \frac 12 - \frac 12 a - \frac 16 + \frac 16 a^3\ d\theta\\
\frac {\pi}{3} (2 - 3a + a^3)$
Which can be factored
$\frac {\pi}{3} (1-a)^2(a + 2)$
If we consider $h = 1-a$ as the height of the spherical cap...
$\frac {\pi}{3} (h)^2(3 - h)$
Which matches with the formula.
https://en.wikipedia.org/wiki/Spherical_cap
