What is the Lambert W function?
The Lambert W function is the inverse of the expression f(w) = w ew.
That means if w ew = z, then w = W(z). It appears whenever the variable you want to solve for is both
inside and outside an exponential.
In practical terms, Lambert W is a powerful transcendental equation solver. It helps with equations that do not rearrange cleanly with basic algebra, logarithms, or roots alone.
How to use this Lambert W calculator
- Enter your value for z in the input box.
- Select the branch: W₀ (principal) or W₋₁ (lower real branch).
- Click Calculate W(z).
- Read the computed value and the residual error check.
The residual check displays how closely the computed result satisfies w ew = z. Smaller residuals indicate higher numerical accuracy.
Real branches and domain rules
Principal branch W₀
The principal real branch exists for all z ≥ -1/e. This is the branch most people use by default, and it gives values
from -1 upward.
Lower branch W₋₁
The lower real branch exists only on -1/e ≤ z < 0. It returns values less than or equal to -1.
This branch is essential for problems with multiple real solutions.
Examples
- W₀(1) ≈ 0.5671432904 (the omega constant).
- W₀(0) = 0.
- W₀(-0.1) and W₋₁(-0.1) are both real but different.
- At z = -1/e, both real branches meet at w = -1.
Common equation forms solved with Lambert W
You can rewrite many problems into Lambert W form:
x ex = agivesx = W(a).a x + b ln(x) = coften transforms into a W expression.x = p eq xcan be converted to a Lambert W equation.
Applications in science, engineering, and finance
- Population and growth models with delayed effects.
- Circuit analysis with exponential current-voltage relationships.
- Combinatorics and asymptotic formulas.
- Chemical kinetics and reaction-time equations.
- Certain continuous-compounding and optimization problems in finance.
Numerical method used in this calculator
This page computes the Lambert W function using an iterative root-finding method (Halley/Newton style updates) on
f(w)=w ew-z. Good initial guesses and branch-aware logic are used for stable convergence across the real domain.
Near the branch point z = -1/e, special approximations improve reliability where numerical sensitivity is highest.
FAQ
Why do I get a domain error?
For real outputs, each branch has strict input limits. If your input is outside those limits, no real Lambert W value exists on that branch.
Can this calculator return complex values?
This version is focused on real branches only. Complex branches exist, but they require complex arithmetic and are not shown here.
What is a good way to verify results?
Plug the output back into w ew and compare with your original z. The displayed residual already does this for you.