Solving an equation with LambertW function I have function $f(x)$ which has a maximum at $x^*$ ($\frac{d^2f(x)}{dx^2}<0$ can be shown):
$$f(x)=\frac{1}{2} (1-x) \log \left(\frac{2 d g x}{1-x}+1\right)$$
In the research article, the solution for $x^*$ is given as 
$$x^*=\frac{(2 d g-1)-Q(2)}{(2 d g-1) \left(Q(2)+1\right)};~\text{where}~Q(t)=W\left(\frac{d g t-1}{\exp (1)}\right)$$
where $W$ is the LambertW function. 
When I get the first derivative, and make it to zero, I have
$$\frac{d g}{2 d g x-x+1}-\frac{1}{2} \log \left(1-\frac{2 d g x}{x-1}\right)=0\rightarrow exp\left(\frac{2 d g}{2 d g x-x+1}\right)= \left(\frac{2 d g x-x+1}{1-x}\right)$$
But I am not sure how I can reduce this to get $x^*$. 

Start with 
$$\exp\left(\frac{2 d g}{2 d g x-x+1}\right)= \left(\frac{2 d g x-x+1}{1-x}\right)$$
Next, divide both sides by $e$ to obtain
$$\exp\left(\frac{(2 d g-1)(1-x)}{2 d g x-x+1}\right)= e^{-1}\left(\frac{2 d g x-x+1}{1-x}\right)$$
Then, multiply both sides by $2dg-1$ to reveal
$$ze^z=(2dg-1)/e$$
where $z=\frac{(2 d g-1)(1-x)}{2 d g x-x+1}$.  Thus, 
$$z=W\left(\frac{2dg-1}{e}\right)$$
whereupon solving for $x$ yields
$$x=\frac{(2dg-1)-W\left(\frac{2dg-1}{e}\right)}{(2dg-1)\left(1+W\left(\frac{2dg-1}{e}\right)\right)}$$
