How do i solve $x - \log{(\frac{h - x}{x})} = 0$? Im trying to solve this equation for $x$:
$$x - \log{\Big(\frac{h - x}{x}\Big)} = 0$$
where $h$ is a constant.
I've looked for some info, but I've only found on how to solve when the variables inside x and $\log{(x)}$ are the same, I've tried to do this, but of course the $x$ would stay inside the Lambert function:
$$h-x + \log{(h-x)}=h+\log{(x)}$$
 A: As  @Robert Israel commented, there is no  closed-form solution usingthe standard Lambert $W$"* function.
However, if you rewrite the equation as
$$e^{-x}=\frac x{h-x}$$
the solution  would be given in terms of the generalized Lambert function (have a look at equation $(4)$). From a formal point of view, this is nice but not very useful from a practical point of view.
If you let $x= h y$, solving this equation is the same as finding the zero of function
$$f(y)=\frac 1 y \log \left(\frac{1}{y}-1\right)-h$$ in the range $0 < y \leq \frac 12$ (which corresponds to positive values of $h$).
If $h$ is small, you can write (by Taylor)
$$\frac 1 y \log \left(\frac{1}{y}-1\right)=-8 \left(y-\frac{1}{2}\right)+16 \left(y-\frac{1}{2}\right)^2-\frac{128}{3}
   \left(y-\frac{1}{2}\right)^3+O\left(\left(y-\frac{1}{2}\right)^4\right)$$ and use series reversion to obtain, as an estimate,
$$y=\frac{1}{2}-\frac{h}{8}+\frac{h^2}{32}-\frac{h^3}{192}+O\left(h^4\right)$$ For example, for $h=2$, the above expansion would give $y=\frac 13$ while the solution is $y=0.337416$. But this will work for a quite  limited rang of $h$.
As another approximation, you could use a simple empirical  model such
$$\frac 1 y \log \left(\frac{1}{y}-1\right)\sim 1.79 \left(\frac{1-2 y}{y}\right)^{1.21}$$ which is very good $(R^2=0.99999)$.
For example, for $h=45.678$, this would give as estimate $y=0.0604$ while the solution is $y=0.0602$. One iteration of Newton method should be sufficient to polish the root.
