I am asked to solve the following problem:
Evaluate the volume of the solid defined by $x^2+y^2+z^2 \leq 9$ and $x^2+y^2 \leq 3y$.
I thought about using spherical coordinates:
$$ 0 \leq \rho \leq 3\\ 0 \leq \theta \leq 2\pi\\ 0 \leq \phi \leq \frac{\pi}{2} $$
with $\rho^2sin(\phi)$ on the integral, but that didn't work.
$$ \int_{0}^{\pi/2} \int_{0}^{2\pi} \int_{0}^{3} \rho^2sin(\phi) \ d\rho d\theta d\phi $$
Where did I go wrong?
TEXTBOOK ANSWER: $18 \pi$
Your integral did not consider the cylinder $x^2+y^2\leq 3y$ at all. Although it gives you the correct answer. It is a coincidence.
This is a volume of the cylinder inside a bigger sphere. So it is capped by the sphere on top and bottom. It's better to use cylindrical coordinate. It is then $$2\int_{0}^{\pi} \int_{0}^{3\sin\theta} \int_{0}^{\sqrt{9-x^2-y^2}} r \ dzdr d\theta. $$
The $3\sin\theta$ comes from the cylinder $$x^2+y^2\leq 3y\implies r^2\leq 3r\sin\theta\implies r\leq 3\sin\theta.$$