Integrate $\pi (r^2-x^2)$ We are told to integrate $\pi (r^2-x^2)$ from $-r$ to $r$
$$V=\int_{-r}^{r}\pi(r^2-x^2)dx=2\pi\int_0^r(r^2-x^2)dx=2\pi\left[r^2x-\frac{x^3}{3}\right]_0^r=2\pi\left(r^3-\frac{r^3}{3}\right)=\frac{4}{3}\pi r^3$$
why does the integral of $r^2$ equal $r^2 x$?

We have $$\begin{align}V&=\int_{-r}^r\pi(r^2-x^2)\,dx=\int_{-r}^r(\pi r^2-\pi x^2)\,dx=\int_{-r}^r\pi \color{red}r^2\,d\color{blue}x\end{align}-\int_{-r}^r\pi \color{blue}x^2\,d\color{blue}x$$ and since we are integrating with respect to $x$ (in blue) we treat $r$ (in red) as a constant. 
Hence $$\begin{align}V&=[\pi \color{red}r^2\color{blue}x]_{-r}^r-\left[\frac\pi3x^3\right]_{-r}^r\\&=\pi r^3-\pi r^2(-r)-\left(\frac\pi3r^3-\frac\pi3(-r)^3\right)\\&=2\pi r^3-\frac23\pi r^3=\frac43\pi r^3\end{align}$$ as required
