Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Lambert W Function

  1. Jan 14, 2007 #1
    I hv this problem in Quantum physics, i tried to solve and eventually got this kind of a equation
    [tex]5e^x-5=xe^x[/tex] I thought of solving it via Lambert Function and got

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

    How to go aboutt next?How can I evaluate this
     
  2. jcsd
  3. Jan 14, 2007 #2
    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
  4. Jan 14, 2007 #3
    I dont have a numeric value for Z
     
  5. Jan 14, 2007 #4
    Last edited: Jan 14, 2007
  6. Jan 14, 2007 #5

    uart

    User Avatar
    Science Advisor

    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
  7. Jan 15, 2007 #6
    this was trivial, sorry i wasnt in my full concentration,
    one can do it this way
    [tex] -5=(x-5)e^{(x-5)+5} [/tex]
    which eventually gives
    x = 5 + W(-5 exp(-5))
     
  8. Jan 15, 2007 #7

    Gib Z

    User Avatar
    Homework Helper

    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.
     
  9. Jan 15, 2007 #8

    Gib Z

    User Avatar
    Homework Helper

    In fact, I graphed it and the only root is zero...
     
  10. Jan 15, 2007 #9

    uart

    User Avatar
    Science Advisor

    No there's definitely two solutions. One is x=0 and the other is x ~= 4.9651.
     
  11. Jan 16, 2007 #10

    Chris Hillman

    User Avatar
    Science Advisor

    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 [itex]y = x \, \exp(x)[/itex] (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.
     
  12. Jan 16, 2007 #11

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    I think Keither Briggs has some nice code for that. Google w lambert and his name and you'll probably get it.
     
  13. Jan 16, 2007 #12

    uart

    User Avatar
    Science Advisor

    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) )
     
  14. Feb 23, 2007 #13
    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
     
  15. Feb 23, 2007 #14

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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.

    [itex]5e^x- 5= xe^x[/itex] so [itex]5e^x- xe^x= 5[/itex], [itex](5- x)e^x= 5[/itex] or [itex](x-5)e^x= -5[/itex]

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

    Since y= x- 5, [itex]x- 5= W(-5e^5)[/itex] so [itex]x= 5+ W(-5e^5)[/itex].
     
  16. Feb 23, 2007 #15

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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

Have something to add?



Similar Discussions: Lambert W Function
  1. Lambert W function (Replies: 2)

Loading...