Gravitational collapse and free fall time (spherical, pressure-free) 
A very large number of small particles forms a spherical cloud. Initially they are at rest, have uniform mass density per unit volume $\rho_0$, and occupy a region of radius $r_0$. The cloud collapses due to gravitation; the particles do not
  interact with each other in any other way.

How much time passes until the cloud collapses fully?
(This was originally from a multiple-choice exam - I solved the problem via dimensional analysis on the options then. I'm wondering how it might be solved directly now).
The answer is $$t = \sqrt{\frac{3\pi}{32G\rho_0}}. $$
 A: For a spherically symmetric distribution of mass, the acceleration felt by a test particle at radius $r$ is $-G M /r^2$ (negative because pointing in toward the center), regardless of the radial distribution of mass. This is a key part of the question, make sure you are comfortable with it. It is a concept that is  related to Gauss' law of electromagnetism, if you've encountered that.
The total mass of the collapsing cloud is given by the initial uniform density times the volume, or $M = (4 \pi /3) r_0^3 \rho_0$
From Newton's second law, the equation of motion for a test particle at the edge of the cloud is then
$$ \frac{d^2r}{dt^2} = - \frac{4 \pi G r_0^3 \rho_0}{3r^2}$$
Now for some chain rule trickery (this is a nice trick, so it's good to remember it for similar differential equations): 
$$ \frac{d}{dt} = \frac{dr}{dt} \frac{d}{dr}$$
Keeping in mind that $v \equiv \frac{dr}{dt}$, and using the chain rule subustitution just mentioned, the equation of motion is now
$$  v  \frac{dv}{dr} = - \frac{4 \pi G r_0^3 \rho_0}{3r^2}$$
The point of doing all this is that the differential equaiton is now more clearly separable. You can solve it by integrating as follows
$$ \int v \, dv = - \frac{4 \pi G r_0^3 \rho_0}{3}\int\frac{dr}{r^2}$$
$$\frac{1}{2} v^2 = \frac{4 \pi G r_0^3 \rho_0}{3r} + C$$
(You also could have gotten to this point by relating gravitational potential energy to kinetic energy, and being careful about where you set the zero of the gravitational potential).
When $r = r_0$, $v = 0$, so $C =  - \frac{4 \pi G r_0^2 \rho_0}{3}$ and 
$$\frac{1}{2} v^2 = \frac{4 \pi G r_0^2 \rho_0}{3}\left(\frac{r_0}{r} - 1 \right)$$
$$ |v| = \sqrt{\frac{8 \pi G r_0^2 \rho_0}{3}\left(\frac{r_0}{r} - 1 \right)}$$
The total time can be found by integrating
$$t_{\rm collapse} = \int dt = \int \frac{dr}{|v|} = \sqrt{\frac{3}{8 \pi G r_0^2 \rho_0}}\int_0^{r_0}{\frac{dr}{\sqrt{\left(\frac{r_0}{r} - 1 \right)}}}$$
This is going to be a tricky integral, so let's non-dimensionalize  it. Make a change of variable $u \equiv r/r_0$. Then we have
$$ t_{\rm collapse} = \sqrt{\frac{3}{8 \pi G \rho_0}}\int_0^{1}{\frac{du}{\sqrt{\frac{1}{u} - 1}}}$$
If you are really adept at trigonometric substitutions in integrals, here's your chance to shine. Otherwise, just use Wolfram Alpha or something similar to tell you that the integral evaulates to $\pi/2$. That gives, finally,
$$ t_{\rm collapse} =  \sqrt{\frac{3 \pi}{32  G \rho_0}}$$
A: A partial answer only.
Given a spherical collapse, and ignoring relativistic effects, the time is the same as the time taken for a particle at the edge of the cloud to fall to the centre.
As all the mass is inside the edge, we can determine the mass pulling that edge in as the volume of the sphere of radius $$r_0$$ times the density.
I.e., the key idea is that the cloud is not important, just the total mass.
So the falling particle behaves as it if is falling to a point mass. 
But this is just a special kind of orbit, very ellipsoidal. The period of the orbit:
http://en.wikipedia.org/wiki/Orbital_period#Small_body_orbiting_a_central_body
depends on the cube of the radius. 
$$t = 2\pi\sqrt{\frac{a^3}{GM}}$$
As Wikipedia shows, this actually means that the period is independent of the radius:
$$t = \sqrt{\frac{3\pi}{G\rho_0}}$$
http://en.wikipedia.org/wiki/Orbital_period#Orbital_period_as_a_function_of_central_body.27s_density
The in-fall time is only the same as a quarter of an orbit. So the total time should be:
$$t = \sqrt{\frac{3\pi}{16G\rho_0}}$$
So I'm missing a factor of $$\sqrt{\frac{1}{2}}$$ here - hence the 'partial answer'.
What have I missed?
A: There is a well-known solution for this problem which is as follows : Gravitationally the outer layer of the cloud is influenced by the rest just as the rest were compressed into a point mass. Therefore we have Keplerian motion: the fall of any part of the outer layer consists in a halfperiod of an ultra-elliptical orbit ; one focus is at the center of the cloud (by Kepler’s 1st law) and the other one is at $r_0$,
The period of the orbit is determined by the longer semiaxis of the ellipse (by Kepler’s 3rd law). The longer semiaxis is $\frac{r_0}{2}$. and we are interested in half a period. Thus, the answer is equal to the halfperiod of a circular orbit of radius $\frac{r_0}{2}$.
$$(\frac{2\pi}{2T})^2~\frac{r_0}{2}=\frac{Gm}{(\frac{r_0}{2})^2}$$
Hence $$T=\pi\sqrt\frac{r_0^3}{8Gm}$$
Or,$$T_{collapse}=\sqrt\frac{3\pi}{32G{{\rho}_0}}$$,independent of $r_0$.
