The Time That 2 Masses Will Collide Due To Newtonian Gravity My friend and I have been wracking our heads with this one for the past 3 hours...
We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r.  Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as:
$$F_g ~=~ G\frac{Mm}{r^2}$$
How do we find out at what time they will collide?  What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$.  I've tried taking a number of integrals, which haven't really yielded anything useful.  Any guidance?  No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :)
 A: Similar task: 
A body is thrown straight up with an escape velocity $v_e$ from a height $R$. 
How long it takes for  the body to attain a height $h$?
As well known $\large v=\frac{dr}{dt}$,  so  $\large dt= \frac{1}{v}dr$
$\large{ v_e^2=  \frac{2GM}{r}}$, so  $\large \frac{1}{v_e} = \sqrt{\frac{r}{2GM}}$
$\large T=\int\limits_R^h  \sqrt{\frac{r}{2GM}}dr=\frac{2}{3}(h^{3/2}-R^{3/2})\frac{1}{\sqrt{2GM}}=\large \frac{2}{3}\Big(\frac{h}{v_{eh}}-\frac{R}{v_{eR}}\Big)$
where $\large{ v_{eh}=  \sqrt{\frac{2GM}{h}}}$ and $\large{ v_{eR}=  \sqrt{\frac{2GM}{R}}}$ - escape velocities at $h$ and $R$
Escape velocity  can be derived from the conservation of energy:
$\large -\frac{GMm}{r} + \frac{mv_e^2}{2}=0$
A: You should be able to use energy conservation to write down the velocities of the bodies as a function of time.
$$
\textrm{Energy conservation (KE = PE): } \frac{p^2}{2}\left( \frac{1}{m} + \frac{1}{M} \right) = GMm\left(\frac{1}{r} - \frac{1}{r_0}\right)
$$
And 
$$
 \frac{dr}{dt} = -(v + V) = -p\left( \frac{1}{m} + \frac{1}{M} \right)
$$
Momentum conservation ensures that the magnitude of the momenta of both masses is the same.
Does this help?
Substituting into the second equation from the first you should be able to solve for:
$$
\int_0^T dt = -\int_{r_0}^0 dr \sqrt{\frac{rr_0}{2G(M+m)(r_0-r)}} = \frac{\pi}{2\sqrt{2}}\frac{r_0^{3/2}}{\sqrt{G(M+m)}}
$$
A: Since this old question got bumped I might as well add my own answer. In classical mechanics, two masses that interact gravitationally define a two-body problem, which follows Kepler's laws: they will orbit each other in an ellipse, and Kepler's Third Law states that
$$
n^2a^3 =\mu,
$$
where $a$ is the semi-major axis, $\mu=G(M+m)$ and $n=2\pi/T$, with $T$ the orbital period, i.e. the time taken to go from the apocentre (the point of greatest distance) to the pericentre (the point of smallest distance) and back.
Now, the case of two colliding masses is a special case: here, the ellipse becomes a line, so the semi-minor axis $b$ is zero, the apocentre is the initial distance $r_0$ and the pericentre is zero. Also, $r_0=2a$. So the masses only complete half an orbit (from apocentre to pericentre), which takes a time
$$
t = T/2 = \frac{\pi a^{3/2}}{\sqrt{\mu}} = \pi\sqrt{\frac{r_0^3}{8G(M+m)}}.
$$
A: For completeness, here's an another solution (though not so elegant as Shanth's solution). 
The equations of motion (from the 2nd Newton's Law) of the two point masses $m_1$ and $m_2$, respectively, are: 
$$G\frac{m_1 m_2}{(r_2-r_1)^2}=m_1 \ddot{r_1}\Leftrightarrow \ddot{r_1}=G\frac{m_2}{(r_2-r_1)^2}$$
$$-G\frac{m_1 m_2}{(r_2-r_1)^2}=m_2 \ddot{r_2}\Leftrightarrow \ddot{r_2}=-G\frac{m_1}{(r_2-r_1)^2}$$
Subtracting these two equations we get:
$$\ddot{r_2}-\ddot{r_1}=\frac{\mathbb{d}^2}{\mathbb{d}t}(r_2-r_1)=-G\frac{m_1+m_2}{(r_2-r_1)^2}$$
And setting $r=r_2-r_1$ we finally get the following second-order non-linear differential equation:
$$\ddot{r}r^2+G(m_1+m_2)=0$$
Here (link) you can find how to solve this ODE.
A: I think the answer is simpler: 
$$F = m.a $$   but  $$ F= G.  \frac{Mm}{r^2} $$ then: $$ ma =G.  \frac{Mm}{r^2} $$ then:
$$ a = \frac{GM}{r^2} $$ on the other hand: $$V_f= V_i +at  $$ but as the objects start from rest: $$ V_0 =0  => V_f = a.t $$  then: $$t = \frac{V_f}{a} $$ then, clearing the time we obtain: $$ t = \frac{V_f.r^2}{G.M} $$ Now, $$V_f^2 = 2.a.r $$ then: $$ V_f = \sqrt{2r} . \sqrt{\frac{GM}{r}}  $$ then: $$ t = \frac{r^2}{GM} . \sqrt{2r}. \sqrt{\frac{GM}{r}}$$ ending: $$ t = \sqrt{\frac{2.r^3}{GM}}$$
