The time it takes an object to go through a hole through the Earth's center Newton's law of attraction is given by the differential equation $$\frac {dv}{dt} = -\frac {gr}{R}$$ where $r$ is the distance from the center of the Earth, $R$ is the radius of the Earth, and $g$ is the acceleration due to gravity. What is the time that it takes for an object dropped through one end of the hole to reach the other end? 
Solving the differential equation for $t$ in terms of $v$ is futile because when the ball reaches the other end the velocity of the ball is $0$. I also tried expressing $v$ as a function of $r$ by $$\frac{dv}{dt} = \left(\frac{dv}{dr}\right)\left(\frac{dr}{dt}\right) = v \frac{dv}{dr}$$ but it did not help because while I can calculate the speed of the object halfway, at this point $r=0$ and thus I cannot calculate the time of one fourth of an oscillation (the period of one oscillation being the time it takes for the object to get back at the end of the hole from which it was dropped).

Write it as $\frac {d^2r}{dt^2}+\frac {gr}R=0$ and you have a harmonic oscillator  The angular frequency is $\sqrt {\frac {g}R}$ and the period is $2 \pi\sqrt{\frac { R}{g}}$
