<s>[INST] Double integration in polar coordinates: $\int_{-\pi /4}^{\pi /4} \int_0^{a \sqrt{2 \cos (2 \theta )}} \sqrt{2a^2-r^2} r dr d\theta $ This is exercise 14 in Section 9.3 of Serge Lang's Calculus of Several Variables.
Question statement: The base of a solid is the area of one loop in Exercise 13(b)* and the top is bounded by the function (in terms of polar coordinates) $f^*(r,\theta)=\sqrt{2a^2-r^2}$. Find the volume.
*Note: Question 13(b): Find the area enclosed by $r^2 = 2a^2 \cos(2 \theta)$.
Solution attempt:
Let $V$ be the required volume. Then,
$$V=\displaystyle\int_{-\pi /4}^{\pi /4} \int_0^{a \sqrt{2 \cos (2 \theta )}} \sqrt{2a^2-r^2} r dr d\theta.$$
For the inner integral, substitute $u=2a^2-r^2$. Then $du = -2r dr$. Then the lower limit becomes $u=2a^2$, and the upper limit is $u=2a^2-r^2=2a^2(1-\cos(2\theta)=4a^2\sin^2\theta.$ Using this, I evaluate the inner integral as
$$\int_{4a^2 \sin^2 2 \theta}^{2a^2}\dfrac{\sqrt{u}}{2}du = \dfrac{2a^3}{3}(\sqrt{2}-4\sin^3 \theta).$$
Now, I see that $\sin^3 \theta$ is odd, and so that integral vanishes. This gives me $$V = \dfrac{\pi a^3 \sqrt{2}}{3},$$ as my answer.
However, this does not match the answer given in the book. The answer given is $$\dfrac{2\sqrt{2}\pi a^3}{3} - \dfrac{64}{9}a^3+\dfrac{40 \sqrt{2} a^3}{9}.$$ The book gives this as the integral $$2\displaystyle\int_{-\pi /4}^{\pi /4} \int_0^{a \sqrt{2 \cos (2 \theta )}} \sqrt{2a^2-r^2} r dr d\theta.$$
I am unsure where I went wrong in the evaluation of the integral, and why there is a factor of 2. Please, can someone help me identify where I went wrong? Thank you.
 [/INST] You wrote
$$\int^{2a^2}_{4a^2\sin^22θ}
\frac{\sqrt u}{2}\,du=\color{red}{\frac{2a^3}{3}(\sqrt 2−4\sin^3θ)}
$$ in your arguments.
However, it should be  $$\frac{2a^3}3(\sqrt 2−4\left|\sin^32θ\right|)
.$$
</s>