I wish to derive a formula for the volume of a sphere of radius $R$ using its cross-sectional area $A(r)=\pi (R-|r|)^2$, where $r$ ranges from $-R$ to $R$. The below is my attempt.
\begin{align*} V&=\int_{-R}^R A(r) dr \\ &=\int_{-R}^R \pi (R-|r|)^2 dr \\ &=\pi\int_{-R}^R (R^2-2R|r|+|r|^2) dr \\ &=\pi R^2\int_{-R}^R dr-2\pi R\int_{-R}^R |r|dr+\pi\int_{-R}^R|r|^2dr \\ &=2\pi R^3-4\pi R\int_0^R r dr+2\pi\int_0^R r^2 dr \\ &=2\pi R^3-2\pi R^3+2\pi \cdot \frac{R^3}{3} \\ &=\frac23 \pi R^3 \end{align*}
Why I got the formula for the volume of a hemisphere instead?