HP49-50G Lambert function
10-17-2020, 08:42 PM
Post: #1
 Gil Senior Member Posts: 325 Joined: Oct 2019
HP49-50G Lambert function
Lamber function for HP49-50G
W.Y=>X

Having the value Y,
find the X value such that (...X) × EXP (...X) = Y.

The program gives almost instantaneous answer,
but do no tamper on previously registered variable.

Here is the program code:

« "Lambert W(Y):
Having result Y,
W(Y) finds / gives X
such that
(X * EXP X) = Y
W(X * EXP X) =X

" DROP => Y
« X X TYPE 'X*EXP(X)-Y' 'X' 1 ROOT UNROT 6 ==
IF
THEN DROP 'X' PURGE
ELSE 'X' STO
END "W(" Y + ")" + =>TAG
»
»

Example of use:

What is the Lambert x value for y=(sqrt 2) /2?
1) 2 SQRT 2 / gives. 707
2) 2 SQRT 2 / W.Y=>X gives 0.4506

Application:

Solve x^2*e^x=2

Take square root of the above expression:
x*e^(x/2) = sqrt 2

Divide by 2:
(x/2)*e^(x/2) = (sqrt 2) / 2

That has a form of:
"(X..X)" * e ^"(X..X) " = (sqrt 2)/2

Then W ["(X..X)" * e ^"(X..X)"] = W [(sqrt 2)/2]
Or "X.. X" = W [(sqrt 2)/2]

In our case we have:
W[(x/2)*e^(x/2)] = W[(sqrt 2) / 2]
Or x/2 = W[(sqrt 2) / 2]
Or x = 2 * W[(sqrt 2) / 2] = 2 * 0.4506 = 0.9012

Remarks welcome.

Regards,
Gil Campart

Attached File(s)
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}