Derivation in paper - calculus - How?

Hi all

the paper is Pybus(2000) An integrated framework for the inference of viral population history from reconstructed genealogies

wanted some help with this

$\displaystyle U = exp(-\int^{gi+ti}_{x=ti} \frac{{i \choose 2}}{Ne(x)} dx $

In the paper they solve U for gi and get

$\displaystyle g_i {i \choose 2} = -ln(U) \cdot ~ (\int^{gi+ti}_{x=ti} \frac{1}{Ne(x)}\frac{dx}{gi})^{-1}$

i dont know how he has done the re arranging. Im not even sure it is correct

can someone please show me how? or if its too much effort tell me what method he used

***********

for those interested U is a uniform unit random variable. Solving for gi will generate a variate sample from an equation.

Thank you guys so much for the help