The problem in question is thus: Find the volume cut out of the sphere of a radius $a$ centered at the origin by the polar curve $r = a\cos\theta$. I attempted to solve the problem using this cylindrical triple integral, taking advantage of $x$-axis symmetry. $$ 2\int_0^{\frac{\pi}{2}}\int_0^{a\cos\theta}\int_{-\sqrt{a^2 - r^2}}^{\sqrt{a^2 - r^2}}r\,dz\,dr\,d\theta = \frac{2\pi a^3}{3} - \frac{8a^3}{9} $$ However, when this, similar integral is evaluated (which in my mind should yield the same results as the first one), the answer is different as the last term cancels out. $$ \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \int_0^{a\cos\theta}\int_{-\sqrt{a^2 - r^2}}^{\sqrt{a^2 - r^2}} r \, dz\,dr\,d\theta = \frac{2\pi a^3}{3} $$ Which one of these answers is correct and why is the other one wrong? I understand that it has something to do with the theta integral, but I have no idea where my error is in assuming that these two triple integrals should produce identical results.
Thanks! This is my first time on the Math Stack Exchange so let me know if there is anything else I can do to improve the nature of my question.
THANK YOU ALL!!! Many wonderful explanations below, have a great day everyone!
The working is not shown, so the following is conjecture on how the first and second integrals were worked out.
$$I(\theta)=\int_0^{a\cos\theta}\int_{-\sqrt{a^2-r^2}}^{\sqrt{a^2-r^2}}r\, dz\,dr=\int_0^{a\cos\theta}2r\sqrt{a^2-r^2}\,dr=\frac{4}{3}\Big[(a^2-r^2)^{3/2}\Big]_0^{a\cos\theta}=\frac{4a^3}{3}(\sin^3\theta-1)$$
Then $2\int_0^{\pi/2}\sin^3\theta\,d\theta=\frac{4}{3},\qquad\int_{-\pi/2}^{\pi/2}\sin^3\theta\,d\theta=0$ give out different answers.
The problem occurs because the last expression $\sin^3\theta-1$ is not correct. Substituting $\cos\theta$ into $(1-r^2)^{3/2}$ gives $(\sin^2\theta)^{3/2}=|\sin\theta|^3$ which is always non-negative.