<s>[INST] 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?
 [/INST] 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
</s>