How to integrate ${dx}/{\sqrt{\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{R}\right)}}$ 
If
  $\displaystyle\frac{dx}{dt}=-\sqrt{\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{R}\right)}$
  and $x(0)=R$, find $t$ when $x=0$.

I have no idea how to integrate $\displaystyle\frac{dx}{\sqrt{\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{R}\right)}}$. Any suggestions?
 A: Starting with
$$\int\frac{dx}{\sqrt{\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{R}\right)}}$$
We will replace all the constant with simpler ones. We let $\frac{2K}{m} = a^2$ and we let $R=b^2$
$$\int\frac{dx}{a\sqrt{\left(\frac{1}{x}-\frac{1}{b^2}\right)}}$$
The obvious thing now is to let $x \to b^2 x$
$$\frac{b}{a}\int\frac{dx}{\sqrt{\left(\frac{1}{x}-1\right)}}$$
And now we let $u = 1/x \implies dx= -du/u^2 $
$$\frac{-b}{a}\int\frac{du}{u^2\sqrt{u-1}}$$
A standard trig substitution will suffice now
A: $\sqrt{2K/m}$ is just a constant, so the real difficulty is
$$ \int \frac{dx}{\sqrt{1/x-1/R}}. $$
Basically, the rule is always to try a trigonometric or hyperbolic substitution when there's a square root: the problem in this case is that we need to use the square of a trigonometric function, so that we can do the usual trick with cancelling. Trying all the usual suspects (sin, tan, sec, csc, sinh, cosh, tanh, ...), we get lucky fairly early, and putting $x=R\sin^2{y}$, we have $dx = 2R\sin{y}\cos{y}$ and
$$ \frac{1}{x}-\frac{1}{R} = \frac{1}{R}(\csc^2{y}-1) = \frac{1}{R}\cot^2{y}. $$
Assuming that $0<y<\pi/2$, we can take the positive square root, and end up having
$$ \int \frac{2R\sin{y}\cos{y}}{\cot{y}/\sqrt{R}} \, dy = R^{3/2} \int 2\sin^2{y} \, dy. $$
This is easy, of course: $2\sin^2{y} = 1-\cos{2y}$, and integrating gives $y-\frac{1}{2}\sin{2y}$. Untransforming, $y=\arcsin{\sqrt{x/R}}$, but it's much easier to transform the limits: $x=0$ when $y=0$, and $x=R$ when $y=\pi/2$, so we find that
$$ \int_0^R \frac{dx}{\sqrt{1/x-1/R}} = R^{3/2} \int_0^{\pi/2} 2\sin^2{y} \, dy = R^{3/2} \left[ y-\frac{1}{2}\sin{2y} \right]_0^{\pi/2} = R^{3/2}\pi/2. $$
A: $$\displaystyle\frac{dx}{dt}=-\sqrt{\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{R}\right)}$$
$$ \int \frac{1}{\sqrt{\frac{2K}{m}\left( \frac{1}{x}-\frac{1}{R}\right)}}dx= \int -  dt $$
$$ \frac{1}{\sqrt{\frac{2K}{m}}} \int \frac{1}{\sqrt{\frac{1}{x}-\frac{1}{R}}} dx=\int - dt$$
$$ \frac{1}{\sqrt{\frac{2K}{m}}} \int \frac{1}{\frac{1}{\sqrt{R}}\sqrt{\frac{R}{x}-1}} dx=\int - dt$$
$$ \frac{1}{\frac{1}{\sqrt{R}} \sqrt{\frac{2K}{m}}} \int  \frac{1}{\sqrt{\frac{R}{x}-1}}=\int-dt$$
$$  u=\frac{R}{x}-1 \implies du=-\frac{R}{x^2}dx \implies x^2=\frac{R^2}{(u+1)^2}$$
$$ \frac{-R}{\frac{1}{\sqrt{R}} \sqrt{\frac{2K}{m}}}  \int  \frac{1}{\sqrt{u}(u+1)^2} du=\int-dt$$
Are you able to continue? 
A hint would be to use the substiution $t=\sqrt{u}$ and then you will get a nice looking integral :)
