Lambert W Function Calculator
Compute the Lambert W function with its two real branches W_0 and W_(-1), Halley iterative method, solution of x·e^x = y and applications in physics and CS.
Report a calculation error
Help us improve. Describe what is wrong with the calculation.
Result
| Voce | Valore |
|---|
Show full details
Share result
Disclaimer: this calculation is for informational purposes only. For important decisions, consult a qualified professional.
The Lambert W function
The Lambert W function, also known as the omega function or product log, is a special function defined as the inverse of f(x) = x · ex:
W(x) · eW(x) = x
Studied by Swiss mathematician Johann Heinrich Lambert (1758) in a paper on transcendental equations, then by Euler (1779), it was long considered a theoretical curiosity. Since the 1990s, thanks to work by Corless, Gonnet, Hare, Jeffrey, and Knuth (1996), it has been rediscovered for its many applications in physics, chemistry, combinatorics, algorithmic theory and biology. Today it is implemented in Mathematica (ProductLog), Matlab (lambertw), Python (scipy.special.lambertw), Julia (LambertW.jl).
The two real branches
The equation w · ew = x has different characteristics depending on x:
- For x > 0: single positive real solution. This is the principal branch W0(x).
- For -1/e < x < 0: two real solutions. The larger, in (-1, 0), is W0(x); the smaller, in (-infinity, -1), is W-1(x).
- For x = -1/e: double solution W = -1.
- For x < -1/e: no real solution (complex plane needed).
The constant -1/e ≈ -0.3679 is the limiting value where the two branches meet. The graph of y = x·ex has global minimum at x = -1, y = -1/e; the two solutions of w·ew = y correspond to the two pre-images of y for y > -1/e.
The four modes
- Principal branch W0: computation for x >= -1/e using Halley's method (cubic convergence, 5-10 iterations for 14 digits).
- Branch W-1: computation for -1/e <= x < 0, with values in (-infinity, -1].
- Solve x · ex = y: given y, find x via W(y). Closed-form solution for all transcendental equations involving ex.
- Applications: lists concrete problems (physics, chemistry, combinatorics, algorithms) where Lambert W is the exact solution.
Halley's method
To compute W(x) numerically, the calculator uses Halley's method (1694), faster than Newton. Given f(w) = 0:
wn+1 = wn - f(wn) / (f'(wn) - f(wn) · f''(wn) / (2 · f'(wn)))
For f(w) = w·ew - x: f'(w) = ew(1 + w), f''(w) = ew(2 + w). Cubic convergence: each iteration roughly triples correct digits. With a good initial guess, 5 iterations suffice for IEEE 754 double precision (15-16 digits).
Notable values
- W0(0) = 0: trivial case.
- W0(1) = Omega ≈ 0.5671432904097839: the Omega constant, solution of Omega · eOmega = 1. Unique solution of e-Omega = Omega.
- W0(e) = 1: since 1 · e1 = e.
- W0(-1/e) = W-1(-1/e) = -1: branching point.
- Asymptotic: W0(x) ~ ln(x) - ln(ln(x)) for x → infinity.
Physics applications
- Wien's law: peak emission wavelength of a blackbody satisfies lambdamax · T = hc / (k · (5 + W0(-5 · e-5))) ≈ 2.8977·10-3 m·K. The constant 2.898 comes exactly from W.
- Fluid drag: bodies falling with linear drag satisfy v(t) = vterm(1 - e-t/tau); time to reach a fraction is expressed by W.
- Shockley diode: forward voltage at fixed current: V = VT · W(I · R / (Is · VT)).
- Chaotic orbits: Koopman dynamics with nonlinear operators use W to estimate periodic orbits.
- General relativity: Schwarzschild metric in Kruskal-Szekeres coordinates involves W.
Combinatorics and computer science applications
- Number of labelled trees: Cayley's formula: the number of trees on n labelled vertices is nn-2; the generating function T(x) = ∑ nn-1 xn/n! satisfies T(x) = x · eT(x), so T(x) = -W(-x).
- Rooted trees: the number of rooted trees on n labelled vertices is nn-1; relation via W.
- Algorithmic complexity: randomised sorting times, hash tables with chaining, B-trees involve log x / log log x, quantities related to W.
- Poisson branching processes: count-ray distributions satisfy transcendental equations solvable via W.
- M/M/1 queueing theory: asymptotic waiting times involve W for explicit resolution.
The Omega constant
The value W0(1) = Omega ≈ 0.5671432904097839 is the Omega constant, one of the most elegant yet least-known mathematical constants. It is the unique real number satisfying Omega · eOmega = 1, equivalently Omega = e-Omega. Like π and e, Omega is transcendental (Mahler 1953): not a root of any polynomial with rational coefficients.
Updated July 2026
Comments (0)
Login to leave a comment.
No comments yet. Be the first!