I'm trying to evaluate this integral
$\displaystyle\int_{-\pi/2}^{\pi/2} d\theta \displaystyle\int_0^{ 2a\cos \theta} r^2 \cos \theta dr $
by reversing the order of integration. Integrating as it stands I can easily get the correct answer $\pi a^3$
However when I try to reverse the order I can't get the same answer
$ \displaystyle \int_{0}^{2a} dr \displaystyle \int_{-\cos ^{-1}(r/(2a))}^{ \cos ^{-1}(r/(2a))} r^2 \cos \theta d \theta = \displaystyle \int_{0}^{2a} r^2 (\frac {2a}{r})(2) dr = 8a^3$ ???
Really banging my head on the wall...anyone care to tell me where I went wrong?