CoCalc Public FilesBHLectures / sage / Lambert_W0.ipynbOpen with one click!
Author: Eric Gourgoulhon
Compute Environment: Ubuntu 18.04 (Deprecated)

Lambert function W0W_0

In [1]:
%display latex
In [2]:
f(x) = x*exp(x) f
x  xexx \ {\mapsto}\ x e^{x}
In [3]:
graph = plot(f(x), (x,-1, 1), axes_labels=[r'$x$', r'$f(x)$'], thickness=2, gridlines=True) graph
In [4]:
graph.save('max_xex.pdf')
In [5]:
f(-1)
e(1)-e^{\left(-1\right)}
In [6]:
graph = plot(lambert_w(x), (x,-1/e, 2.7), axes_labels=[r'$y$', r'$W_0(y)$'], thickness=2, gridlines=True) graph
In [7]:
graph.save('max_lambert_W0.pdf')
In [8]:
def w(x): return RDF(lambert_w(RDF(x/e)) + 1)
In [9]:
w(0)
1.01.0
In [10]:
w(-1)
4.47151982108×1009-4.47151982108 \times 10^{-09}
In [11]:
w(2)
1.463055513371.46305551337
In [12]:
graph = plot(w, (x, -1, 5), aspect_ratio=1, axes_labels=[r'$x$', r'$\tilde{W}_0(x)$'], thickness=2, gridlines=True) graph
In [13]:
graph.save('max_lambert_rescaled.pdf')