$x^2 + y^2 = r^2$
$y = \sqrt{r^2-x^2}$
If we assume that $y$ is the radius of a circle, or "disc", inside the sphere, the area of it would be $\pi(\sqrt{r^2-x^2})^2=\pi(r^2-x^2)$
If we made this into a function and accumulated the area of each one these circles, or "discs", inside the sphere we would get the volume of the sphere.
$f(x)=\pi r^2-\pi x^2$
$2\int_0^r{f(x)}dx=\frac{4\pi r^3}{3}$
This works as predicted. However when I replaced $x$ and $y$, with $r\cdot cos(\theta)$ and $r\cdot sin(\theta)$ respectively (because $sin(\theta)=\frac{y}{r}$ and $cos(\theta)=\frac{x}{r}$), it didn't work.
The function $f$ became $f(\theta)=\pi r^2-\pi r^2cos^2(\theta)$
According to Symbolab or Photomath the prime function $F$ became $F(\theta)= r^2\pi \theta-\frac{\pi }{2}r^2\left(\theta+\frac{1}{2}\sin \left(2\theta\right)\right)$
Taking $F$ over the interval $[0^o, 180^o]$, or $[0^o, 90^o]$ then multiplying by $2$, gives completely unexpected results. Even when using radians to define the interval $[0, \pi]$.
Since radians are defined for the unit circle, which has a radius of $1$, and I'm trying to prove this for any sphere, I thought this might have been the issue. But even when using more general terms for the interval such as $[0, \pi r]$ still doesn't give the correct answer. Why?
The problem is that you went from $f(x)$, by replacing $x$ with $r\cos\theta$, and, even though you did not write it, it seems that you replaced $dx$ with $d\theta$. Just by looking at the units, this seems wrong. One is units of length, the other has units of angle (dimensionless). You forgot the Jacobian transformation. For this case: $$\left|\frac{dx}{d\theta}\right|=r\sin\theta$$ So you need to replace $dx$ with $r\sin\theta d\theta$. Then, if you use radians for $\theta$ you will get the right answer.