I am trying to use the lambert function to solve the following equation for $x$.

$$ \frac{a}{b} \ln x-x+ c =0 $$

My first step is to rewrite $x$ as $e^{\ln x}$.

$$ \frac a b \ln x - e^{ln x} + c =0$$

I then multiply by $b$ and divide by $a$.

$$ \ln x - \frac b a e^{\ln x} + \frac b a c =0 $$

I have read about the Lambert-W function but am unsure of how to progress!


Write your equation as $$ \ln(x) - \frac{bx}{a} = - \frac{bc}{a} $$ take the exponential of both sides: $$ x e^{-bx/a} = e^{-bc/a}$$ and multiply by $-b/a$. With $u = -bx/a$ we have $$ u e^u = -\frac{b}{a} e^{-bc/a} $$ Thus $u = W\left(-\frac{b}{a} e^{-bc/a}\right)$, and $$ x = -\frac{a}{b} W\left(-\frac{b}{a} e^{-bc/a}\right) $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.