1
$\begingroup$

Can anyone help me solve this for y in terms of x?

$$x=a(1-y)-b\log(1-y)$$

where $a,b>0$. I've been trying to achieve this using the Lambert W function, but am struggling!

EDIT: Here are my workings:

\begin{align} -\frac{a}{b}(1-y)+\log{(1-y)}&=-\frac{x}{b}\\ %% \Rightarrow\quad %% -\frac{a}{b}(1-y)+\log{(1-y)}+\log{\left(-\frac{a}{b}\right)}&=-\frac{x}{b}+\log{\left(-\frac{a}{b}\right)}\\ %% \Rightarrow\quad %% -\frac{a}{b}(1-y)+\log{\left(-\frac{a}{b}(1-y)\right)}&=-\frac{x}{b}+\log{\left(-\frac{a}{b}\right)}\\ %% \Rightarrow\quad %% -\frac{a}{b}(1-y)e^{-\frac{a}{b}(1-y)}&=-\frac{a}{b}e^{-\frac{x}{b}}\\ %% \Rightarrow\quad %% -\frac{a}{b}(1-y)&=W\left(-\frac{a}{b}e^{-\frac{x}{b}}\right)\\ %% \Rightarrow\quad %% y&=1+\frac{b}{a}W\left(-\frac{a}{b}e^{-\frac{x}{b}}\right)\\ \end{align}

I believe this to be incorrect however, I'm pretty sure the answer shouldn't have a negative inside the lambert function. As can be deduced from this WA calculations:

ODE

Separation of variables

As you see this problem arises from a non-linear ODE, where I have let $a=d/c$ and $b=(d+c)/c$.

2 Answers 2

1

I think it is $y(x)=\frac{1+bW{(-\frac{a\exp{(-\frac{x}{b})}}{b})}}{a}$. But I might be wrong.

1

We have $$a (y-1) = -b\log (1-y) - x $$ $$a(y-1) = -b [\log (1-y) +\frac {x}{b}] = -bW (\frac{ae^{\frac {x}{b}}}{b}) $$ $$\Rightarrow y = \frac {a - bW (\frac{ae^{\frac {x}{b}}}{b})}{b} $$ Hope it helps.

  • 0
    Could you explain the second line a little more? This is great though!2017-01-31
  • 0
    I believe there is a mistake in your first line, a sign error.2017-01-31