I am studying the brachistochrone problem and I have found in many books the following chain of implications for calculating the time to travel from one point $A$ to another point $B$: $$v = \frac{dr}{dt} \implies dt = \frac{dr}{v} \implies t = \int_A^B \frac{1}{v}dr$$ As a math student, I always try to avoid treating differentials as mere numbers, but as simple as it seems I cannot find a more mathematically correct way of obtaining this expression.
I would be grateful if someone could provide a derivation or a reference.