How to solve $x$ in terms of $a$ and $b$ in equation $\frac{1}{2}+\frac{a}{b-a}e^{-bx}-\frac{b}{b-a}e^{-ax}=0$ ($x>0,a>0,b>0, a≠b$)? Suppose $x>0,a>0,b>0,a\neq b$. How to solve $x$ in terms of $a$ and $b$ in equation $\frac{1}{2}+\frac{a}{b-a}e^{-bx}-\frac{b}{b-a}e^{-ax}=0$? If a closed-form solution is not possible, a way to approximately solve for $x$ with an expression for approximation error is also okay. Thanks!
 A: Consider that you look for the zero of function
$$f(x)=\frac{1}{2}+\frac{a}{b-a}e^{-bx}-\frac{b}{b-a}e^{-ax}$$ for which
$$f'(x)=\frac{a b }{b-a}\left(e^{-a x}-e^{-b x}\right)\qquad \text{and} \qquad f''(x)= \frac{a b }{b-a}\left(b e^{-b x}-a e^{-a x}\right)$$
The key points are
$$f(0)=-\frac{1}{2} \qquad \qquad f'(0)=0 \qquad \qquad f''(0)=ab$$
Moreover, if $x\to \infty$, $f(x)\to \frac{1}{2}$; so, there is a root.
For an explicit approximation of the root, the idea is to perform a single iteration of Newton method
$$\color{red}{x_1=x_0-\frac{f(x_0)}{f'(x_0)}}\tag 1$$ but the problem is to find the "best" $x_0$; we have two possibilities.
The first one is based on the Taylor expansion around $x=0$
$$f(x)=-\frac{1}{2}+\frac{1}{2} a b x^2+O\left(x^3\right)\quad\implies\quad \color{blue}{x^{(1)}_0=\frac{1}{\sqrt{ab}}}$$
The second one considers the inflection point
$$f''(x)=0\quad\implies\quad \color{blue}{x^{(2)}_0=\frac {\log \left(\frac{b}{a}\right) }{b-a}}$$
A series of random test reveals that there is not much difference and that, most of the times, $x^{(1)}_0$ is a better choice than $x^{(2)}_0$. So, using it, the approximate formula
$$ \color{red}{x_1=\frac{1}{\sqrt{ab}}+\frac{a \left(2 e^{\sqrt{\frac{a}{b}}}-e^{\frac{a+b}{\sqrt{a b}}}\right)-b \left(2 e^{\sqrt{\frac{b}{a}}}-e^{\frac{a+b}{\sqrt{a b}}}\right) } {2 a b \left(e^{\sqrt{\frac{a}{b}}}-e^{\sqrt{\frac{b}{a}}}\right) }}$$
Just a single test : $a=2$ and $b=5$ lead to  $x_0=0.316228$, $x_1=0.545058$; making one more iteration gives $x_2=0.563470 $ while the solution is $x= 0.563693$.
Edit
If we accept to stay with $(1)$, we can improve $x_0$ expanding $f(x)$ as a Taylor series around $x=0$ and using series reversion.
This would give
$$\color{blue}{x_0=t+\frac{a+b}{6} t^2 +\frac{2 a^2+7 a b+2 b^2}{72} t^3 +\frac{
   4 a^3+39 a^2 b+39 a b^2+4 b^3}{1080}t^4+\frac{ 4 a^4+172 a^3
   b+417 a^2 b^2+172 a b^3+4 b^4}{17280}t^5+O\left(t^6\right)}$$ where $\color{blue}{t=\frac{1}{\sqrt{ab}}}$.
$$\color{blue}{x_1=x_0+\frac{a e^{a x_0} \left(2-e^{b x_0}\right)-b \left(2-e^{a x_0}\right) e^{b x_0}}{2 a b
   \left(e^{a x_0}-e^{b x_0}\right)}}$$
For $a=2$ and $b=5$, this gives $x_0=0.536545$ and $x_1=0.563228$ while the solution is $x= 0.563693$.
Pushing the expansion to $O\left(t^{10}\right)$ would give $x_0=0.559250$.
A: I prefer to write a second answer since the approach is totally different.
Since we know that the function
$$f(x)=\frac{1}{2}+\frac{a}{b-a}e^{-bx}-\frac{b}{b-a}e^{-ax}$$ has a root, let $\color{blue}{x=-\frac{1}{a}\log (y)}$ and $\color{blue}{b=k a}$ $(k>1)$ and now, look for the zero of
$$g(y)=\frac{y^k-k y}{k-1}+\frac{1}{2}$$ which is such that
$$-\frac{1}{2 W_{-1}\left(-\frac{1}{2 e}\right)} \leq y < \frac 12 \qquad\qquad W_{-1}\left(-\frac{1}{2 e}\right)\sim-2.6783470$$
The first iteration of Newton method gives
$$y_0=\frac{k-1}{2 k} \Bigg[1+\frac{2 \left(W_{-1}\left(-\frac{1}{2 e}\right)+1\right)}{\left(-2
   W_{-1}\left(-\frac{1}{2 e}\right)\right){}^k-2}\Bigg]^{-1}=\alpha$$
We have $g(y_0) >0$ as well as $g''(y_0)>0$. So, $y_0$ is an underestimate of the solution and, by Darboux theorem, continuing Newton iterations, the solution would be reached without any overshoot.
Expanding $g(y)$ around $y_0$ as a series and using series reversion
$$\color{blue}{y_1=\alpha +t -\frac{(k-1) \alpha ^{k-1}}{2 \left(\alpha ^k-\alpha \right)}t^2+\frac{(k-1) \alpha ^{k-2} \left((2 k-1) \alpha ^k+\alpha  (k-2)\right)}{6
   \left(\alpha ^k-\alpha \right)^2}t^3+\cdots}$$ where $$\color{blue}{t=\frac{-2 \alpha ^k+(2 \alpha -1) k+1 }{2 k \left(\alpha ^{k-1}-1\right) } }$$ Notice that $t$ is always positive and quite small (its maximum value is $0.007425$ for $k \sim 2.3556$).
Applied to the same case as before $(k=\frac 52)$, this gives
$y_1=0.3238790522$ while the solution is    $y=0.3238790559$.
Back to $x$, $x_1=0.5636925643$  while the solution is $x=0.5636925585$.
A simpler formula is given by the first iterate of Halley mathod. It write
$$\color{blue}{y=\alpha-\frac{2 \alpha  \left(\alpha ^k-\alpha \right) \left(2 \alpha ^k-2 \alpha 
   k+k-1\right)}{2 (k+1) \alpha ^{2 k}+\left(2 \alpha  (k-5) k-(k-1)^2\right)   \alpha ^k+4 \alpha ^2 k}}$$ For the worked example, it gives $y_1=0.3238788400$
Edit
Just for the fun, we would have an explicit solution if we were able to compute the inverse of
$$k=\frac{1}{1-2 y}-\frac{1}{\log( y)} W\left(\frac{2 \log (y)}{1-2 y}y^{\frac{1}{1-2 y}}\right)$$
