Lambert W function: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Fredrik Johansson
No edit summary
imported>Fredrik Johansson
Line 14: Line 14:
The single-valued function corresponding to the blue graph for <math>\scriptstyle -1/e\, \le \, x \,< \,\infty</math> is called the ''principal branch'' of the Lambert ''W'' function and is denoted by <math>W_0</math>. The single-valued function corresponding to the dashed red graph for <math>\scriptstyle -1/e \, \le \, x \, < \, 0</math> is called the ''negative branch'', denoted by <math>W_{-1}</math>. The negative branch goes to <math>\scriptstyle -\infty</math> as <math>\scriptstyle x \to 0</math> ([[asymptote|asymptotically]] like <math>\scriptstyle \ln(-x)</math>) while the principal branch grows slowly but unboundedly (asymptotically like <math>\scriptstyle \ln x</math>) as <math>\scriptstyle x \to \infty</math>.
The single-valued function corresponding to the blue graph for <math>\scriptstyle -1/e\, \le \, x \,< \,\infty</math> is called the ''principal branch'' of the Lambert ''W'' function and is denoted by <math>W_0</math>. The single-valued function corresponding to the dashed red graph for <math>\scriptstyle -1/e \, \le \, x \, < \, 0</math> is called the ''negative branch'', denoted by <math>W_{-1}</math>. The negative branch goes to <math>\scriptstyle -\infty</math> as <math>\scriptstyle x \to 0</math> ([[asymptote|asymptotically]] like <math>\scriptstyle \ln(-x)</math>) while the principal branch grows slowly but unboundedly (asymptotically like <math>\scriptstyle \ln x</math>) as <math>\scriptstyle x \to \infty</math>.


The behavior of the Lambert ''W'' function can be understood by comparing it to the natural logarithm, the inverse of <math>e^w</math>. For large negative or positive <math>w</math>, <math>e^w</math> and <math>we^w</math> grow similarly, so their respective inverse functions have similar asymptotes as well (except for the sign when <math>w</math> is negative). Multiplying the exponential by <math>w</math> deforms its graph around zero so that it is no longer [[monotone function|monotone]], and that is why the Lambert ''W'' function has two real branches. The following two graphs show the relation between the two exponential functions (left graph) and their inverse functions (right graph):
The behavior of the Lambert ''W'' function can be understood by comparing it to the natural logarithm, the inverse of <math>e^w</math>. For large negative or positive <math>w</math>, <math>e^w</math> and <math>we^w</math> grow similarly, so their respective inverse functions have similar asymptotes as well (except for the sign when <math>w</math> is negative). Multiplying the exponential by <math>w</math> deforms its graph around zero so that it is no longer [[monotone function|monotone]], and that is why the Lambert ''W'' function has two real branches. The following pair of graphs shows the relation between the two exponential functions (left graph) and their inverse functions (right graph):


[[Image:Lambert and log.png|550px|center|]]
[[Image:Lambert and log.png|550px|center|]]

Revision as of 18:26, 28 April 2007

The Lambert W function is used in mathematics to solve equations in which the unknown appears both outside and inside an exponential function or a logarithm, such as Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 3x+2=e^x} or Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x=\ln(4x)} . Such equations cannot otherwise, except in special cases, be solved explicitly in terms of algebraic operations, exponentials and logarithms.

Definition

The Lambert W function is defined as the multivalued function that satisfies

for any complex number . Equivalently, it may be defined as the inverse function of . Thus, the equation is by definition solved by . The multivaluedness of the Lambert W function means that there is generally more than one solution. The graph of the Lambert W function in the real numbers looks as follows:

Lambertw.png

The function has two real branches in the interval which join at . Concretely, this means that the equation has two real solutions if . For example, if (which is about half way between and 0), there is one solution that lies on the blue graph and another solution that lies on the dashed red graph.

The single-valued function corresponding to the blue graph for is called the principal branch of the Lambert W function and is denoted by . The single-valued function corresponding to the dashed red graph for is called the negative branch, denoted by . The negative branch goes to as (asymptotically like ) while the principal branch grows slowly but unboundedly (asymptotically like ) as .

The behavior of the Lambert W function can be understood by comparing it to the natural logarithm, the inverse of . For large negative or positive , and grow similarly, so their respective inverse functions have similar asymptotes as well (except for the sign when is negative). Multiplying the exponential by deforms its graph around zero so that it is no longer monotone, and that is why the Lambert W function has two real branches. The following pair of graphs shows the relation between the two exponential functions (left graph) and their inverse functions (right graph):

Lambert and log.png

Like the complex logarithm, the Lambert W function has infinitely many complex branches; they are conventionally labeled where runs over all the integers. The details are discussed for instance in Corless et al.[1]

Besides , the Lambert W function has the special values Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle W_0(0) = 0} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle W_0(e) = 1} . The value Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \scriptstyle W_0(1) = 0.567143\ldots} is called the omega constant.

Examples of use

The Lambert W function solves any equation of the form Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle C = x e^x} — we may call this the canonical form. Many other types of equations can be solved in terms of the Lambert W function as well, by using the rules of exponentials and logarithms to rewrite them in the canonical form. For example, the equation Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle xb^x=a} is solved by Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \scriptstyle x=W(a\ln b)/\ln b} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle a^x=x+b} is solved by

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x = \frac{-b-W(-a^{-b} \ln a)}{\ln a}.} [1]

Valluri et al. give the following example of an equation from physics that can be solved with the Lambert W function.[2] Planck's law states that the radiation intensity Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle I} at wavelength Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \lambda} from a black body at temperature Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle T} is given by

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle I(\lambda, T) = \frac{8\pi h c/\lambda^5}{\exp(hc/\lambda k T)-1},}

where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle h} is Planck's constant, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle k} is Boltzmann's constant and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle c} is the speed of light. Note that Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \lambda} appears both inside and outside an exponential. Next, Wien's displacement law states that the maximum intensity is attained at the wavelength where is a quantity called Wien's displacement constant. Using the Lambert W function, we can give an explicit formula for .

To derive Wien's displacement law, we wish to solve . If we calculate the partial derivative, simplify, and perform the substitution , we obtain the equation . To write this in canonical form for application of the Lambert W function, we substitute and multiply both sides of the resulting equation by . This leaves , with the nonzero solution . Substituting back the expression for , we obtain Wien's displacement law with the value for Wien's constant given explicitly by

Calculus

The principal branch of the Lambert W function has the Taylor series expansion

around , which can be obtained the via Lagrange inversion theorem. Due to the singularity at , and as can be proved with the ratio test, the series converges for . The Lambert W function has the derivative

which is infinite at the branch point . Its antiderivative is given by

It is also possible to find antiderivatives of more complicated expressions containing the Lambert W function. See Corless et al. for an overview.[1]

Numerical calculation

The value of can be calculated by using a regular root-finding algorithm to solve the equation for . Since the left-hand side has simple derivatives, Newton's method and Halley's method are both good choices. Halley's method amounts to iterating

for . The initial value must be chosen carefully in order to end up on the correct branch. To calculate real values on the principal branch, any real number above will work, but faster convergence is obtained by taking the initial value from an interpolating function around 0 for small arguments and an asymptotic formula for large arguments. With a sufficiently accurate initial value, a few iterations of Halley's method will give a value that is correct to full precision in ordinary floating-point arithmetic.

Of course, we could use standard root-finding techniques to solve equations without going through the trouble of rewriting them in terms of the Lambert W function. From the numerical point of view, the advantage of using the Lambert W function is that highly optimized implementations that have been tested for correctness are available; further, those implementations allow the user to select a complex branch of choice.

History and application

Equations of the kind that can be solved analytically with the Lambert W function are common in mathematics and science, yet the utility of such a function was not realized until recently. The Lambert W function was introduced in the 1980's as a function in the Maple computer algebra system, whose interface required an explicit notation for solutions of equations. The function's history highlights the importance of good mathematical notation: due to previously not being recognized as a function in its own right, it had not been studied systematically, despite its most important properties requiring only elementary complex analysis. An account of the function and its history that helped popularize it is given in a 1996 paper by R. M. Corless et al. (with Donald Knuth a notable co-author).[1]

The basic theory behind the Lambert W function was investigated in 1779 by Leonhard Euler.[3] The Maple developers chose the name of Johann Heinrich Lambert instead of Euler's since Euler had referenced work by Lambert in his paper, and possibly because "naming yet another function after Euler would not be useful".[4]

Since its introduction, the Lambert W function has been applied to problems ranging from quantum physics to population dynamics to the complexity of algorithms. Cranmer[5] discusses the application of the Lambert W function in solar wind physics and writes in the conclusion: "The Lambert W function used in these solutions was defined and publicized only about a decade ago, but it has rapidly become a convenient tool for mathematical physicists. The elegance of explicit solutions to equations thought previously to be expressible only implicitly is clear, but there also are many practical benefits to having explicit solutions as well."

See also

References

  1. 1.0 1.1 1.2 1.3 Corless, R. M., Gonnet, G. H., Hare, D. E. G., Jeffrey, D. J. & Knuth, D. E. (1996). "On the Lambert W function". Adv. Computational Maths. 5, 329–359
  2. Valluri, S. R., Jeffrey, D. R. & Corless, R. M. (2000). "Some applications of the Lambert W function to physics". Can. J. Phys. 78, 823–831
  3. Euler, L. (1779). "De serie Lambertina plurimisque eius insignibus proprietatibus". Originally published in Acta Academiae Scientarum Imperialis Petropolitinae 1779, 1783, 29–51. Also in Opera Omnia: Series 1, Volume 6, pp. 350 - 369. See E532 in The Euler Archive for a scanned copy.
  4. Corless, R., Jeffrey, D. & Knuth, D. E. (1997). "A Sequence of Series for the Lambert W Function", ISSAC: Proceedings of the ACM SIGSAM International Symposium on Symbolic and Algebraic Computation (formerly SYMSAM, SYMSAC, EUROSAM, EUROCAL) (also sometimes in cooperation with the Symbolic and Algebraic Manipulation Groupe in Europe (SAME))
  5. Cranmer, S. R. (2004). "New views of the solar wind with the Lambert W function". Am. J. Phys. 72, 1397