I was asked to evaluate the following double integral, using polar coordinates: $$\int_0^{2a} \int_0^{\sqrt{2ax - x^2}} x^2 + y^2 dydx$$ We know that $dA = rdrd\theta$ and $r^2 = x^2 + y^2$. Also, I found the upper bound to be $2acos\theta$, by squaring both sides of $y = \sqrt{2ax - x^2}$ and substituting $x^2 + y^2 = r^2$ and $x = rcos\theta$. So the integral becomes $$\int_{-\pi/2}^{\pi/2} \int_0^{2acos\theta} r^3 drd\theta$$ Integrating the inside integral with respect to $dr$ $$\int_0^{2acos\theta} r^3 dr = \frac{r^4}{4}\Bigg\vert_0^{2acos\theta}$$ $$ = \frac{(2acos\theta)^4}4 $$ $$ = 4a^4cos^4\theta $$ If we place back $4a^4cos^4$ on the double integral, we get $4a^4\int_{-\pi/2}^{\pi/2} cos^4 d\theta$; for this one, I used wolphram|alpha and it returned me $\frac{3\pi a^4}{2}$, which is weird, since the textbook answer for this particular exercise is $\frac{3\pi a^4}4$.
It's just a factor of one half, but still; I wonder if there is something wrong with my process, I'm guessing I could be using a wrong domain when transforming from cartesian coordinates to polar, but I can't spot the error.
Thanks a lot!