I'm trying to get a displacement-time function from this velocity equation where $x$ represents time.
$ v(x) = \sqrt{2G(M+m)(\frac{1}{x} - \frac{1}{d})} $
Since $v = \frac{dx}{dt}$, we can determine $s(t)$
$ s(x) = \int{\frac{dx}{\sqrt{2G(M+m)(\frac{1}{x} - \frac{1}{d})}} }$
This is more of a comment, but it's a start.
The constants don't matter, so you need to do $s(t) = \int{\frac{dx}{\sqrt{(\frac{1}{x} - \frac{1}{d})}} } = \int{\frac{dx}{\sqrt{\frac{d-x}{xd}}} } = \int{dx\sqrt{\frac{xd}{d-x}} } = \sqrt{d}\int{dx\sqrt{\frac{x}{d-x}} } $.
The rest is up to you.