I need to find the volume enclosed by $\displaystyle x^2+y^2+z^2=a^2$ and $\displaystyle x^2+y^2=ax$ where $\displaystyle a>0.$
How do I find the bounds? Do I apply spherical coordinates as written?
Assuming the cylinder extends indefinitely up and down the z dimension, we have Viviani's Curve. Doing just the top half, we have z going from 0 (where it 'starts', on the (x,y) plane) up to $\displaystyle \sqrt{a^2 - r^2}$ (where it hits the hemisphere). And we have r going from 0 at the centre (z axis), up to a cos theta i.e. everywhere inside the cylinder. And theta is turning through the x-positive half of the space, i.e. from minus pi/2 to pi/2. So...
$\displaystyle \displaystyle{V = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\ \int_{0}^{a \cos \theta} \int_{0}^{\sqrt{a^2 - r^2}} r\ dz\ dr\ d\theta}$
Just in case a picture helps to follow through from the inside out, we can start bottom left here, integrating r with respect to z...
... where (key in spoiler) ...
Spoiler:
Which leaves a couple of blanks to fill. Hope this helps.
_________________________________________
Don't integrate - balloontegrate!
Balloon Calculus; standard integrals, derivatives and methods
Balloon Calculus Drawing with LaTeX and Asymptote!