On a book called Astrophysics in a nutshell the author writes:
$$ \frac{1}{2} \left(\frac{dr}{dt}\right) ^ 2 = GM(r_0)\left (\frac{1}{r} - \frac{1}{r_0} \right) \Rightarrow$$ $$ dt = -\left (2 GM(r_0)\left (\frac{1}{r} - \frac{1}{r_0} \right) \right)^{-\frac{1}{2}} dr $$
and then he integrates both sides to find some total time. $$ t_{eff}=\int_{0}^{t_{eff}} dt=-\int_{r_0}^{0}h(r)dr$$ where $ h(r) $ is the function we are integrating on the left side. Also note that if $ r=r(t) $ then $ r(0)=r_0 $ and $ r(t_{eff}) = 0 $ and $ \frac {dr}{dt} <0 \ \forall t \ge0$. Obviously, the author treated the derivative of the position function as a ratio. However, this is not "mathematically satisfying" to me. It's more like symbolic calculus than actual math. How can I find the total time with more solid and correct calculus methods? I already tried some things but they didn't work.
Let's instead try to solve this more rigorously. First, moving the $1/2$ to the otehr side and taking the square root of everything gives
$$\frac{dr}{dt}=-\left(2GM(r_0)\left(\frac{1}{r}-\frac{1}{r_0}\right)\right)^{1/2}$$
where we have added a negative sign since $\frac{dr}{dt}<0$. We will make a silly substitution by letting $r(t)=\bar{r}(t)$ and divide the right side over to the left. This means that
$$-\left(2GM(r_0)\left(\frac{1}{\bar{r}}-\frac{1}{r_0}\right)\right)^{-1/2}\frac{d\bar{r}}{dt}=1$$
Now, we integrate both sides with respect to $t$ from $0$ to $t_{eff}$ to get
$$t_{eff}=\int_0^{t_{eff}}dt=\int_0^{t_{eff}}-\left(2GM(r_0)\left(\frac{1}{\bar{r}}-\frac{1}{r_0}\right)\right)^{-1/2}\frac{d\bar{r}}{dt}dt$$
We will now do the change of variables $r=\bar{r}(t)$. This means that $dr=\frac{d\bar{r}}{dt}dt$ by our change of variables. Also, our bounds change, since $r=r_0$ for $t=0$ and $r=0$ for $t=t_{eff}$. As such, we have
$$t_{eff}=\int_{r_0}^0-\left(2GM(r_0)\left(\frac{1}{r}-\frac{1}{r_0}\right)\right)^{-1/2}dr$$
That's how we get there. In fact, this trick always works, regardless of the differential equation in question. It is a consequence of the substitution rule for integrals. The only catch is that this only works for ordinary differential equations, not partial differential equations.
I hope this helps!