[Math] Find the Volume lying inside both the sphere $x^2+y^2+z^2=a^2$ and the cylinder $x^2+y^2=ax$

calculusmultivariable-calculuspolar coordinates

Taking the equation for the cylinder I completed the square to find $(x-\frac{a}{2})^2+y^2=\frac{a^2}{4}$ and the sphere clearly has radius $a$ and is centered at the origin. Now to solve this question we express the radius in terms of theta using the equation for the cylinder (giving $r=a\cos\theta$) and then we solve for $z$ in the sphere's equation giving $z=\sqrt{a^2-x^2-y^2}=\sqrt{a^2-r^2}$ and setup the integral as follows (multiplying by 4 since we only consider the first octant but the total area is in 4 octants): $$
4\int_0^{\frac{\pi}{2}}\int_0^{a\cos\theta}\sqrt{a^2-r^2}rdrd\theta
$$

This is the part I don't understand, why exactly do we express the radius in terms of the cylinder and then why do we solve for $z$ in terms of the sphere and integrate that? Clearly it gives the volume contained but I can't fathom how.

Best Answer

Conceptually, what this integral is doing is this: Start at the origin, then move out until you reach $a\cos \theta$. This draws a line segment, and is what the inner integral does. Then the outer integral, takes that line segment, and sweeps out the semi-circular arc which goes from the point (in rectangular coordinates) $(a,0,0)$ to the point $(0,0,0)$ (also in rectangular coordinates). This gives the area of the semicircle. Finally, the integrand itself gives the height above this semicircular region to the sphere, thereby filling in the desired volume. Note that this is only $\frac{1}{4}$ of the total desired volume, hence we multiply by $4$ to get the entire volume. Does that make sense? All iterated integrals can be thought of in this way (This fact is captured most generally by the generalized Stokes' Theorem).