Calculate the volume bounded by surface Calculate the volume bounded by the surface
$$(x^2+y^2+z^2)^2 = a^2(x^2+y^2-z^2)$$
Using the spherical coordinates
$$\begin{cases} x = rcos\varphi cos\theta & \\ y = rsin\varphi cos\theta \\z = rsin\theta \end{cases}$$
and substituting those into the original equation we get
$$r^2 = a^2(cos^2\theta - sin^2\theta) = a^2cos2\theta$$
and from that
$$0 \leq r \leq a\sqrt{cos2\theta}$$
Calculating Jacobian gives us
$$ J = r^2cos\theta$$
Given all that the target volume could be calculated as
$$V = \int_{0}^{2\pi}\,d\varphi \int_{0}^{\pi}\,d\theta \int_{0}^{a\sqrt{cos2\theta}}\,r^2cos\theta dr$$
But this yields incorrect result, moreover the supposed answer should be calculated given the following integral
$$V = 8\int_{0}^{\frac{\pi}{2}}\,d\varphi \int_{0}^{\frac{\pi}{4}}\,d\theta \int_{0}^{a\sqrt{cos2\theta}}\,r^2cos\theta dr $$
But I have trouble understanding where do the integrating boundaries for $\varphi$ and $\theta$ come from.
I undesrtand that given the fact that the surface and therefore target solid are symmetrical, we can integrate over a certain part of the solid and then multiply the result by a proper constant,
but if we use the following bounds for $\varphi$ and $\theta$
$$0 \leq \varphi \leq \pi/2 \\ 0 \leq \theta \leq \pi/4$$
how come we multiply by 8 and not by 16?
Any tips on what I'm doing wrong ?
 A: Note the plot of $r=a\sqrt{\cos2\theta}$ below

with range $\theta \in [-\frac\pi4, \frac\pi4]$. Thus, the volume integral is set up as
$$V = \int_{0}^{2\pi}\,d\varphi \int_{-\frac\pi4}^{\frac\pi4}\,d\theta \int_{0}^{a\sqrt{cos2\theta}}\,r^2\cos\theta dr\\
=8 \int_{0}^{\frac\pi2}\,d\varphi \int_{0}^{\frac\pi4}\,d\theta \int_{0}^{a\sqrt{cos2\theta}}\,r^2\cos\theta dr
$$
A: If you multiply by $16$, you would get all possible values of $\theta$, from $0$ to $\pi$. What is the limit of integration for $r$ when $\theta=\pi/2$? You get $\cos(2\theta)=-1$, so the square root is not defined (in real numbers). In fact for $\theta\in(\pi/4,\pi/2)$ your upper limit is not defined.
A: The reason is that $$\int_{0}^{\frac{\pi}{2}}d\varphi\int_{0}^{\frac{\pi}{4}} d\theta\int_{0}^{a\sqrt{\cos (2\theta)}} r^2\cos\theta dr$$
Is only in the first octant. We multiply by 8 to cover all 8 octants. The screenshot of the graph will make it obvious that your $\theta$ bounds run from $0$ to $\frac{\pi}{4}$ if you run through the first octant, and the bounds you specify are all 8 octants.
https://gyazo.com/fb0003801540888e101442e4cc56a320
