Lambert W Function

1. Jan 14, 2007

himanshu121

I hv this problem in Quantum physics, i tried to solve and eventually got this kind of a equation
$$5e^x-5=xe^x$$ I thought of solving it via Lambert Function and got

$$x=W[5(e^x-1)]$$

How to go aboutt next?How can I evaluate this

2. Jan 14, 2007

Swapnil

Usually, to evaluate 'special' function like these, I use the following Wolfram website (unless you have Mathematica or some other advanced math software at home):
http://functions.wolfram.com/

Once there, just go to 'Function Plotting.' Then choose 'Product Log' (this is what Mathematica calls the Lambert W function) from the list of elementary functions and hit 'Go.' Then click on 'Function Evaluation' on the bottom to go the page where you can evaluate the Lambert function to any precision!

In case you can't find it, here is a direct link:
http://functions.wolfram.com/webMathematica/FunctionEvaluation.jsp?name=ProductLog

Last edited: Jan 14, 2007
3. Jan 14, 2007

himanshu121

I dont have a numeric value for Z

4. Jan 14, 2007

Swapnil

Last edited: Jan 14, 2007
5. Jan 14, 2007

uart

First thing is that using the lambertW function is not much help if you're still going to end up with x on both sides of the equation as you did above. If using W() doesn't give up a closed form solution then you are just as well off leaving it in the original exponential or log form and solving numerically.

Anyway in this case you can solve your original equation and get it in closed form with W. I dont have time to post the details right now but the solution is :

x = 5 + W(-5 exp(-5))

Note that there is also a second trivial solution of x=0. This second solution obviously can be found by inspection but it also comes from the above lambert function solution by using the fact that for arguments between -1/e and zero that W(.) has two real solutions.

Last edited: Jan 14, 2007
6. Jan 15, 2007

himanshu121

this was trivial, sorry i wasnt in my full concentration,
one can do it this way
$$-5=(x-5)e^{(x-5)+5}$$
which eventually gives
x = 5 + W(-5 exp(-5))

7. Jan 15, 2007

Gib Z

Does that mean its solved? Im not that familiar with the function, other than it helps, or is the inverse....something with power towers...if you wanted you could have set y= ln(5/5-x) -x and used Newtons method to find the root.

8. Jan 15, 2007

Gib Z

In fact, I graphed it and the only root is zero...

9. Jan 15, 2007

uart

No there's definitely two solutions. One is x=0 and the other is x ~= 4.9651.

10. Jan 16, 2007

Chris Hillman

The most useful special function hardly anyone knows...

Someone was asking about mathematical anecdotes. I first encountered this one when I was an undergraduate. A graduate student studying wondrous creatures known as roller birds asked me for help in solving an equation from some problem in data analysis, which amounted to using the LambertW, which is by definition is "the" inverse function of $y = x \, \exp(x)$ (technically, at the level of real functions, this involves staying within a particular region of a Riemann surface). LambertW also is just what you need for the Kruskal-Szekeres chart for the Schwarzschild vacuum solution, and for many other things, e.g. in analysis of algorithms. Books on special functions do discuss this.

For the OP: do you have Maple or Mathematica? LambertW is a defined function in these symbolic computation systems. Maple help offers a lot of information about LambertW. If you can't find this there or elsewhere, I can tell you a power series expansion. With a little effort, I am sure you find a FORTRAN program (or C program) you can use to compute numerical values.

11. Jan 16, 2007

CRGreathouse

I think Keither Briggs has some nice code for that. Google w lambert and his name and you'll probably get it.

12. Jan 16, 2007

uart

Guys I'm pretty sure that the OP's problem wasn't the lack of lack means to evalute W, it was just that at first he couldn't get the problem into a suitable form to give him a numerical value for the required argument for the funtion. And now he's got it.

Just to elaborate a bit on what was said above, and give a simple example.

The Lambert function is defined as the inverse of the function y = x exp(x). So W(const1) is automatically the solution of any equation of the form x exp(x) = const1.

Other forms of transcendental equation involving log and exp can often be rearraged (using change of variables and whatever tricks) into the above form to give a Lambert Function solution. Take a log-linear (linear combo of log(x), x and 1) type transcendental as a very easy example.

Say you wanted to solve : log(x) + ax = b

Just add log(a) to both sides to give : log(ax) + ax = b+log(a)

Then exponentiate each side : ax exp(ax) = a exp(b)

So ax = W(a exp(b)) and x = 1/a W( a exp(b) )

13. Feb 23, 2007

giorgos

hallo

can one please inform me if it is possible to use the lambert function method to solve systems of exponential equations (and not simply one equation in one uknown)?

thanks

14. Feb 23, 2007

HallsofIvy

Staff Emeritus
Well, you haven't solved that equation at all! First get x on one side of the equation only THEN apply what special functions you have. Here, since the W function is the inverse of xex you are going to want to isolate that first.

$5e^x- 5= xe^x$ so $5e^x- xe^x= 5$, $(5- x)e^x= 5$ or $(x-5)e^x= -5$

Let y= x-5 so x= y- 5. Then the equation become $ye^{y-5}= -5$ or $ye^y(e^{-5})= -5$. Finally, we have $ye^y= -5e^5$ and can apply the W function to that: $y= W(-5e^5)$.

Since y= x- 5, $x- 5= W(-5e^5)$ so $x= 5+ W(-5e^5)$.

15. Feb 23, 2007

HallsofIvy

Staff Emeritus
Please do not "hijack" other people's threads to ask a new question- even if it is related to the topic- start your own thread.

To answer your question- yes, you can, pretty much the same way you solve any system of equations- try to reduce to one equation in one unknown, then use the W function is appropriate. How you reduce, of course, depends on the equations themselves.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook