Question: Say that I have $f\_{XYZ} = C$ that is defined within a 3-D sphere and that it's constant. If I want to obtain $f\_X$, I have to integrate over $Y$ and $Z$ dimensions. What is the easiest way to do this, and how do I determine the limits of integration?

For within a sphere, I know we have to satisfy
$$
X^2 + Y^2 + Z^2 < R^2 
$$

with $R$ being radius of sphere.

So my attempt looks something like this:
$$
f\_X(x) = \int\_?^? \int\_{-\sqrt{R^2 - x^2 - z^2}}^{\sqrt{R^2 - x^2 - z^2}} f\_{XYZ}dydz
$$

But I am confused what the limits should be for $Z$. Is it simply from $0$ to $R$, or does it depend on $x$?

Answer: 
If you interset the plane $\{X=x\}\cap\mathbb{R}^3$ with the ball $\{X^2+Y^2+Z^2 \leq R^2\}\cap\mathbb{R}^3$ for fixed $x\in[-R,R]$ and project onto the $yz-$plane you're looking at the disc $$\{Y^2+Z^2\leq R^2-x^2\}\cap\mathbb{R}^2$$ That being said,
$$f\_X(x)=\int\_{-\sqrt{R^2-x^2}}^{\sqrt{R^2-x^2}}\int\_{-\sqrt{R^2-x^2-y^2}}^{\sqrt{R^2-x^2-y^2}}f\_{XYZ}(x,y,z)dzdy$$ whenever $x\in[-R,R]$ and $f\_X(x)=0$ otherwise. You can evaluate this integral by converting to polar coordinates: $$\int\_{0}^{2\pi}\int\_{0}^{\sqrt{R^2-x^2}}rf\_{XYZ}(x,r\cos(\theta),r\sin(\theta))drd\theta$$
Moreover, $C$ must equal $\frac{3}{4\pi R^3}$ to ensure $\int\_{\{x^2+y^2+z^2\leq R^2\}}f\_{XYZ}dV=1$.
Easiest way is to see that when you solve your result for $z$, you get
$$
z = \pm \sqrt{R^2-x^2-y^2},
$$
which will be the bounds on the inner integral. Now when you collapse the sphere to the $xy$-plane, you end up with $x^2+y^2 < R^2$ and so $y = \pm \sqrt{R^2-x^2}$, so you have
$$
f\_X(x)
 = \int\_{y=-\sqrt{R^2-x^2}}^{y=\sqrt{R^2-x^2}}
 \left[ \int\_{z=-\sqrt{R^2-x^2-y^2}}^{z=\sqrt{R^2-x^2-y^2}} f\_{XYZ}(x,y,z) dz \right] dy
$$

**UPDATE**

To integrate, since $f\_{XYZ} \equiv C$ is constant, the inner integral is just $2C\sqrt{R^2-x^2-y^2}$ and you can use a trig substitution or a standard tabled integral, say #30 in [this list](http://integral-table.com/)