The base of a certain solid is the circle $x^2 + y^2 = a^2$.
Each plane perpendicular to the x-axis intersects the solid in a square cross-section with one side in the base of the solid.
Find its volume.
Here is my try :
$$y = \sqrt{a^2-x^2}$$
$$dV = (a^2-x^2)dx$$
$$V= 8\int_0^a (a^2-x^2)dx = \frac{16}{3}a^3$$
which is the correct answer given by textbook.
I know that solid has eight octants, for the book answer is $16a^3/3$,
Can someone help me understand why it has 8 octants, I integrate one part of the solid and then multiply by eight, why do I have to multiply by eight instead of four?
If the solids live above the z-axis then I have to multiply by four but in this case, how do I know the solid is also above the z-axis then multiply by eight

For the square cross-section at a particular $x$, the side length on the base is $2\sqrt{a^2-x^2}$, so the cross-sectional area should be $4\left(a^2-x^2\right)$ -- $4\times$ what you used for $dV$.
$$dV = 4\left(a^2-x^2\right)dx$$
As the circular base goes from $x=-a$ to $x=a$, the limits of integration may instead be from $-a$ to $a$. This explains $2\times$ out of the scaling factor in your $V$.
These together explain the seemingly arbitrary $8\times$ scaling factor in your $V$.
$$\begin{align*} V &= \int_{-a}^a 4\left(a^2-x^2\right) dx\\ &= \int_{-a}^0 4\left(a^2-x^2\right) dx + \int_0^a 4\left(a^2-x^2\right) dx\\ &= \int_{a}^0 4\left(a^2-(-x)^2\right) d(-x) + \int_0^a 4\left(a^2-x^2\right) dx\\ &= \int_0^a 4\left(a^2-x^2\right) dx + \int_0^a 4\left(a^2-x^2\right) dx\\ &= 8\int_0^a \left(a^2-x^2\right) dx\\ &= 8\left[a^2x - \frac{x^3}{3}\right]_0^a\\ &= \frac{16}{3}a^3 \end{align*}$$
(Also, in an earlier version, you had an incorrect $\pi$ factor that got lost after incorrect integration.)