<s>[INST] Calculate a triple integral I want to draw the space $D=\{x,y,z)\mid z\geq 0, x^2+y^2\leq 1, x^2+y^2+z^2\leq 4\}$ and calculate the integral $\iiint_D x^2\,dx\,dy\,dz$. 
How can we draw that space? 
About the integral I have done the following: 
We have that $x^2+y^2+z^2\leq 4\Rightarrow z^2\leq 4-x^2-y^2 \Rightarrow -\sqrt{4-x^2-y^2}\leq z\leq \sqrt{4-x^2-y^2}$. Since $z\geq 0$ we get that $0\leq z \leq \sqrt{4-x^2-y^2}$. 
It holds that $4-x^2-y^2\geq 0$, i.e. $x^2+y^2\leq 4$ since $x^2+y^2\leq 1$. 
We have that $x^2+y^2\leq 1 \Rightarrow y^2\leq 1-x^2 \Rightarrow -\sqrt{1-x^2}\leq y \leq \sqrt{1-x^2}$. 
It must hold that $1-x^2\geq 0 \Rightarrow x^2\leq 1 \Rightarrow -1\leq x\leq 1$. 
Therefore $D$ can be written also in the following form: $$D=\{(x,y,z)\mid -1\leq x\leq 1, -\sqrt{1-x^2}\leq y \leq \sqrt{1-x^2}, 0\leq z\leq \sqrt{4-x^2-y^2}\}$$ 
Therefore, we get \begin{align*}\iiint_D x^2 \,dx\,dy\,dz&=\int_{-1}^1 \left (\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}\left (\int_0^{\sqrt{4-x^2-y^2}}x^2 \ dz\right ) \ dy\right ) \ dx \\ & =\int_{-1}^1 \left (\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}x^2\sqrt{4-x^2-y^2} \ dy\right ) \ dx \\ & =\int_{-1}^1 x^2\left (\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}\sqrt{4-x^2-y^2} \ dy\right ) \ dx \end{align*} 
Is everything correct so far? How could we continue? How could we calculate the inner integral? 
$$$$ 
EDIT: 
So to calculate the inner integral $\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}\sqrt{4-x^2-y^2}dy$ we do the following: 
We set $y=\sqrt{4-x^2}\cdot \sin t$, then $dy=\sqrt{4-x^2}\cdot \cos t \ dt$. 
If $y=-\sqrt{1-x^2}$ then $t=\arcsin \left (-\sqrt{\frac{1-x^2}{4-x^2}}\right )$ and if $y=\sqrt{1-x^2}$ then $t=\arcsin \left (\sqrt{\frac{1-x^2}{4-x^2}}\right )$. 
Therefore we get the following: 
\begin{align*}\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}\sqrt{4-x^2-y^2}dy&=\int_{\arcsin \left (-\sqrt{\frac{1-x^2}{4-x^2}}\right )}^{\arcsin \left (\sqrt{\frac{1-x^2}{4-x^2}}\right )}(4-x^2)\cdot \cos^2t \ dt \\ & = (4-x^2)\cdot\int_{\arcsin \left (-\sqrt{\frac{1-x^2}{4-x^2}}\right )}^{\arcsin \left (\sqrt{\frac{1-x^2}{4-x^2}}\right )} \frac{1+\cos (2t)}{2} \ dt  \\ & = \frac{4-x^2}{2}\cdot\left [ t+\frac{\sin (2t)}{2} \right ]_{\arcsin \left (-\sqrt{\frac{1-x^2}{4-x^2}}\right )}^{\arcsin \left (\sqrt{\frac{1-x^2}{4-x^2}}\right )} \\ & = \frac{4-x^2}{2}\cdot\left [ \arcsin \left (\sqrt{\frac{1-x^2}{4-x^2}}\right )-\arcsin \left (-\sqrt{\frac{1-x^2}{4-x^2}}\right ) \\  +\frac{1}{2}\sin \left (2\arcsin \left (\sqrt{\frac{1-x^2}{4-x^2}}\right )\right )-\frac{1}{2}\sin \left (\arcsin \left (-\sqrt{\frac{1-x^2}{4-x^2}}\right )\right )\right ]\end{align*}
Is everything correct so far? How could we continue?
 [/INST] $D$ is a cylinder inside a hemisphere. Or, a cylinder with a spherical cap. 
Your set-up for the integral is correct. 
You could proceed with a trig substitution $y = \sqrt {4-x^2} \sin \theta$
$\int \int x^2 (4-x^2) \cos^2 \theta \ d\theta\ dx$
Or you could convert to polar coordinates (which is also a trig substitution of sorts, but it would be to both x and y simultaneously.)
$\int_0^{2\pi} \int_0^1 r^2\cos^2\theta \sqrt {4-r^2} (r\ dr)\ d\theta$
Update:
It looks to me like the path in polar coordinates will be the easier one to take.
$\int_0^{2\pi} \cos^2 \theta \ d\theta\int_0^1 r^3 \sqrt {4-r^2} \ dr\\
u = 4-r^2; du = -2r \ dr\\
\int_0^{2\pi} \cos^2 \theta \ d\theta\int_3^4 \frac 12 (4u-u^3) \ du\\
(\frac 12 \theta + \frac 12\sin\theta\cos\theta)|_0^{2\pi}\frac {\pi}{2} (2u^2-\frac 14 u^4)|_3^4\\
\frac {\pi}{2}(\frac {81}{4} - 18)\\
\frac {9\pi}{8}\\
$
Suppose we don't translate into polar
$\int_{-1}^1 \int_{-\sqrt{1-x^2}}^{\sqrt {1-x^2}} x^2 \sqrt {4-x^2-y^2}\ dy\ dx\\
y = \sqrt {4-x^2} \sin\theta\\
dy = \sqrt {4-x^2} \cos \theta\\
\displaystyle\int_{-1}^1 \int_{-\arcsin \sqrt{\frac {1-x^2}{4-x^2}}}^{\arcsin \sqrt{\frac {1-x^2}{4-x^2}}} x^2 (4-x^2)\cos^2\theta \ d\theta\ dx\\
\displaystyle\int_{-1}^1 x^2 (4-x^2)\frac 12(\theta+\sin\theta\cos\theta)|_{-\arcsin \sqrt{\frac {1-x^2}{4-x^2}}}^{\arcsin \sqrt{\frac {1-x^2}{4-x^2}}} dx\\
\displaystyle\int_{-1}^1 x^2 (4-x^2)(\arcsin \sqrt{\frac {1-x^2}{4-x^2}}+\frac {\sqrt {1-x^2}}{\sqrt{4-x^2}}\frac {\sqrt 3}{\sqrt {4-x^2}})\ dx\\
\displaystyle\int_{-1}^1 x^2 (4-x^2)\arcsin \sqrt{\frac {1-x^2}{4-x^2}}+x^2\sqrt {3(1-x^2)} dx\\
$
Now it looks like I need to so some integration by parts.
</s>