I am actually familiar with the Corless et al, paper. I do see their point
but... I think they present a one-sided view of computer algebra systems'
handling of W. Using the form Maple uses, W'=W/(x(1+W)), may appear
"cavalier", but it lends itself MUCH better to algebraic simplification than
the form that contains W as an exponent. From the perspective of a real-life
user of Maxima, I'd think that being able to simplify expressions
effectively is a very important practical requirement. After all, Maxima is
a _tool_.
In the specific example in which I ran across Lambert's W, I had a metric
and the associated Ricci tensor. The metric was expressed in terms of
Lambert's W. Using W'=W/(x(1+W)), the Ricci tensor can be simplified with
trivial ease, demonstrating that it is in fact a null tensor of a vacuum
metric. Using the exponential form of the derivative of W, the Ricci tensor
is a mess; its elements are expressions with hundreds of terms, with W
appearing both in and outside exponents, and one can gain no insight
whatsoever as to how it could be simplified.
It so happens that I knew what to do in this case (redefine W') because I've
already had my private implementation of Lambert's W before I attempted to
use the new built-in version. But, had I been aware of the built-in version
and had I attempted to use it, I may never have realized why it is
impossible to simplify my Ricci tensor to a null tensor.
It's these kinds of practical difficulties that, in my mind, weigh heavily
in favor of the "cavalier" version of W', exceptional point notwithstanding.
(That said, I appreciate the argument about Taylor-expansion around 0.
However, I believe that that is an issue much less likely to be encountered
by the Maxima user than the issue of algebraic simplification, especially
if, in the future, we have integrals and DE solutions expressed in terms of
W.)
By the way, the numerical evaluation of lambert_w produces weird results
when the argument is between -1 and -1/%e, a division by zero if the
argument is -1, and an error message if the argument is less than -1.
Viktor
-----Original Message-----
From: Barton Willis [mailto:willisb at unk.edu]
Sent: Tuesday, May 20, 2008 11:45 PM
To: Viktor T. Toth
Cc: 'Robert Dodier'; maxima at math.utexas.edu
Subject: RE: [Maxima] Lambert W function?
My understanding of defule and friends is poor, but I think something
like the following would be better than yet another flag:
(%i1) matchdeclare(x, true);
(%o1) done
(%i2) defrule(lambert_crunch, exp(-lambert_w(x)), lambert_w(x) / x);
(%o2) lambert_crunch:%e^(-lambert_w(x))->lambert_w(x)/x
(%i3) diff(lambert_w(x),x);
(%o3) %e^(-lambert_w(x))/(lambert_w(x)+1)
(%i4) apply1(diff(lambert_w(x),x), lambert_crunch);
(%o4) lambert_w(x)/(x*(lambert_w(x)+1))
(%i5) apply1(diff(lambert_w(x^2),x), lambert_crunch);
(%o5) (2*lambert_w(x^2))/(x*(lambert_w(x^2)+1))
Put the rule in your maxima.init file if you often need it.
Taylor will not work on lambert_w for expansions about zero
if you change the gradef to the spurious pole form. I think
there is no easy way around that.
I changed the gradef for lambert_w after reading
http://www.cs.uwaterloo.ca/research/tr/1993/03/W.pdf
look at pages 11 and 12.
Barton