Relations and Lambert's W Function (2024)

Relations and Lambert's W Function (1)Relations and Lambert's W Function (2)
  • About
  • Statistics
  • Number Theory
  • Java
  • Data Structures
  • Cornerstones
  • Calculus

We have already seen how one can solve many equations that only involve a single variable for the value(s) of that variable that make the equation true. A natural question to then ask is what happens when an equation involves more than one variable?

For example, consider the simple equation $x^2 + y^2 = 25$. If we attempt to solve this equation for one variable, notice that for all $x \in (-5,5)$ there are two solutions for $y$. Likewise, for all $y \in (-5,5)$ there are two solutions for $x$. We can clearly say that neither $x$ or $y$ is a (single) function of the other. $$y = \pm \sqrt{25-x^2} \quad \textrm{ and } \quad x = \pm \sqrt{25-x^2}$$That said, the $x$ and $y$ values that solve the equation discussed above are certainly related in some way. As such, we change our verbiage a bit. For any equation of two or more variables, the solution to that equation (i.e., the pairs of values that satisfy it) is called a relation.

One should note that just as we don't require an equation to describe a function (recall the peculiar way we described functions with arrows from one finite set to another, when we first introduced the notion of what a function was), we don't require an equation to describe a relation either. All we really need is a set of coordinate pairs (or $n$-tuples, more generally). Indeed, this is how a binary relation is typically defined: a set of ordered pairs, where we say $x$ and $y$ are related only if $(x,y)$ is in the aforementioned set.

† : In case you are curious, a set of $n$-tuples -- that is, coordinates in $\mathbb{R}^n$ (possibly representing solutions to an equation with $n$ variables, but not required to do so) can be used to define a more general $n$-ary relation.

Of course, defining such relations through the identification of a set of ordered pairs naturally leads to graphs of relations -- i.e., plots of the coordinate pairs that make up the relation on a coordinate plane.

In the case above, note that $x^2 + y^2 = 25$ precisely when $\sqrt{x^2 + y^2} = 5$. By the Pythagorean Theorem the left side of that second equation represents the distance between a point $(x,y)$ and the origin $(0,0)$. Thus, we see the graph of the relation $\{(x,y) \in \mathbb{R}^2 \ | \ x^2 + y^2 = 25\}$ is a circle of radius $5$, centered at the origin.

As an important aside, note that more generally -- but for similar reasons -- we can say: $$\textrm{The graph of }\{(x,y) \in \mathbb{R}^2 \ | \ (x-h)^2 + (y-k)^2 = r^2\} \textrm{ is a circle with center $(h,k)$ and radius $r$}$$

Graphing $x^2 + y^2 = 25$ on the left below, note that it does not pass the vertical line test, which is consistent with our earlier observation that there is more than one $y$-value associated with several individual $x$-values (and vice-versa). As such, this relation can't be described by a single function.

Relations and Lambert's W Function (3)

However, we can express this relation as the union of two function "pieces" (which we call branch functions) -- shown here by considering those points with negative vs. non-negative $y$-values in the red and blue semi-circles above, respectively. Nicely, we can consider the points $(-5,0)$ and $(5,0)$ to be part of one or both branch functions without any ill effects.

Importantly, while in this case it is easy to describe the blue and red functions using the formulas found when solving for $y$, it should be noted that not all equations in two variables $x$ and $y$ can be easily solved for $y$. A beautiful (and useful) example of this is discussed in the next section.

Lambert's W function

Consider the following relation:$$ye^y = x$$We can graph this relation by realizing that if we swap the $x$ and $y$ values in this equation and then graph that relation, the result should be the reflection of our original graph over the line $y=x$!This graphing problem is far easier -- consider the following qualitative analysis:

Focusing on the far left side of the graph, where $x$ is large in magnitude but negative, notice that $xe^x$ can be made arbitrarily small but stays negative. Consider $$-10 e^{-10} = -\frac{10}{e^{10}}, \quad -100 e^{-100} = -\frac{100}{e^{100}} \doteq , \quad -1000 e^{-1000} = -\frac{1000}{e^{1000}}$$The denominators are growing much faster in magnitude than the numerators, although overall the fraction remains negative. As such, the graph of $y=xe^x$ should approach (from below) a horizontal asymptote formed by the $x$-axis.

At $x=-1$, note that $y = -\frac{1}{e}$ and at $x=0$, $y = 0 \cdot e^0 = 0 \cdot 1 = 0$.

Once $x$ is positive and increases without bound, $e^x$ certainly also increases without bound, as must then their product $xe^x$.

With all the above, we might come to the conclusion that the graph of $y=xe^x$ looks like the following:

Relations and Lambert's W Function (4)
Now, let's remember what we have -- the graph above is the graph of the relation $ye^y = x$ reflected across the line $y=x$. So the graph of the actual relation we seek is the one in blue below:
Relations and Lambert's W Function (5)

Of course, we can see by virtue of the blue curve not passing the vertical line test that the relation $ye^y = x$ can't be described by a single function, but we can still express this relation as the union of two branch functions. In this case, the two branch functions are determined by the section of the blue curve above and below height $-1$. Since finding an explicit formula for each branch is difficult, let us simply give them names. We call these two functions $W_0(x)$ (or simply $W(x)$ when the context is clear) and $W_{-1}(x)$, respectively.

‡ : Actually, finding an explicit formula for $W(x)$ is provably impossible if restricted to using only the functions we currently have introduced (or even the trigonometric ones to come)!

Relations and Lambert's W Function (6)

$W(x)$ is also known as Lambert's W function, so named by mathematicians Robert Corless and David Jeffrey of the University of Western Ontario in a paper they wrote along with Gaston Gonnet, David Hare, and Donald Knuth in 1996, as it has an interesting connection to solving equations of the form $x = q + x^m$, which was first accomplished by Johann Heinrich Lambert in 1758.

Some have suggested that the use of the letter $W$ is to honor British mathematician Sir Edward Wright, who did much of the initial exploration of this function, although others have argued its origin had more to do with a programming quirk in the mathematical software known as Maple.

Speaking of mathematical software, this function is not typically found on scientific calculators -- but $W_0(x)$ can be evaluated using the command productlog(x) in either Mathematica or wolframalpha.com. Similarly, $W_{-1}(x)$ can be found with productlog(-1,x) on both of these platforms.

Fascinatingly, $W(x)$ can be used to help us solve equations that otherwise would be unsolvable in terms of the functions we have explored so far! For the curious, examples follow.

In all of the problems below, our strategy is to note that $W(x)$ has inverse $W^{-1}(x) = xe^x$ and thus we seek or manufacture an occurrence of $xe^x$, or more generally $ue^u$ for some expression $u$ in terms of $x$. Then, we will re-interpret this as the inverse of Lambert's $W$ function and see where we can go from there -- often applying the socks and shoes strategy at that point:

Question

Solve: $x + \ln x = 5$

Solution
$$\begin{array}{rcll}x + \ln x &=& 5 & \quad {\Tiny \textrm{to introduce the desired $e^x$, we exponentiate both sides, base $e$}}\\e^{x+\ln x} &=& e^5 & \quad {\Tiny \textrm{we then pull the power apart to isolate $e^x$ as its own factor}}\\e^{\ln x} \cdot e^x &=& e^5 & \quad {\Tiny \textrm{now, we can (fortuitously) simplify the $e^{\ln x}$ factor to just $x$}}\\x \cdot e^x &=& e^5 & \quad {\Tiny \textrm{letting us now take advantage of the inverse of Lambert's $W$ function}}\\W^{-1}(x) &=& e^5 & \quad {\Tiny \textrm{finally, undo $W^{-1}$ by applying $W$ to both sides (i.e., socks-and-shoes)}}\\x &=& W(e^5) & \end{array}$$

Question

Solve: $x^3 e^x = 7$

Solution

$$\begin{array}{rcll}(x^3 e^x)^{1/3} &=& 7^{1/3} & \quad {\Tiny \textrm{wanting to see $x$ instead of $x^3$ above, we cube root both sides}}\\xe^{x/3} &=& 7^{1/3} & \quad {\Tiny \textrm{we can address the $x/3$ that popped up with a "u-substitution" of $u = x/3$ (so $x=3u$)}}\\3u e^u &=& 7^{1/3} & \quad {\Tiny \textrm{letting us now take advantage of the inverse of Lambert's $W$ function}}\\3W^{-1}(u) &=& 7^{1/3} & \quad {\Tiny \textrm{from here, its socks and shoes!}}\\W^{-1}(u) &=& \frac{1}{3} \cdot 7^{1/3} & \\ u &=& W(\frac{1}{3} \cdot 7^{1/3})\\\end{array}$$Just don't forget that we actually want a solution for $x$, not $u$. So recalling that $x=3u$, we have$$\textstyle{x = 3 W(\frac{1}{3} \cdot 7^{1/3})}$$

Question

Solve: $x^x = 4$

Solution

$$\begin{array}{rcll}x^x &=& 4 & \quad {\Tiny \textrm{address the lack of $e$ by taking the natural log of both sides}}\\\ln x^x &=& \ln 4 & \quad {\Tiny \textrm{properties of logs lets us pull the exponent $x$ to the front of the left side}}\\x \ln x &=& \ln 4 & \quad {\Tiny \textrm{using the fact that $e^x$ and $\ln x$ are inverses, we can introduce a $e^u$ factor}}\\e^{\ln x} \cdot \ln x &=& \ln 4 & \quad {\Tiny \textrm{nicely, simply commuting the factors on the left reveals the desired $ue^u$ form!}}\\(\ln x) \cdot e^{\ln x} &=& \ln 4 & \quad {\Tiny \textrm{now use the inverse of Lambert's $W$ function}}\\W^{-1}(\ln x) &=& \ln 4 & \quad {\Tiny \textrm{from here, it's socks and shoes..}}\\\ln x &=& W(\ln 4) &\\x &=& e^{W(\ln 4)} \end{array}$$

Question

Solve: $6x = e^{2x}$

Solution
$$\begin{array}{rcll}6x &=& e^{2x} & \quad {\Tiny \textrm{we see $x$ and $e^x$, but not together - so divide both sides by $e^{2x}$ (equivalently, multiply by $e^{-2x}$)}}\\6xe^{-2x} &=& 1 & \quad {\Tiny \textrm{if that $6$ was just a $-2$, we'd have the $u(x)e^{u(x)}$ form we seek, so divide both sides by $-3$}}\\-2xe^{-2x} &=& -\frac{1}{3} & \quad {\Tiny \textrm{now we can take advantage of the inverse of Lambert's $W$ function -- but we must be careful..}}\\\end{array}$$

Recall that the graph of the relation $ye^y = x$ is built from two functions, $W(x)$ and $W_{-1}(x)$. The first had domain $[-\frac{1}{e},\infty)$, the second had domain $[-\frac{1}{e},0)$. Consequently, when we have $u(x) e^{u(x)} = c$ where $c$ is in $[-\frac{1}{e},0)$, there are actually two possible conclusions: either $$W_{0}^{-1}(u(x)) = c \quad \textit{or} \quad W_{-1}^{-1}(u(x)) = c$$ As such,$$\textstyle{W_0^{-1}(-2x) = -\frac{1}{3} \quad \textit{or} \quad W_{-1}^{-1}(-2x) = -\frac{1}{3}}$$Then proceeding with a socks and shoes strategy on both possibilities:

$$\begin{array}{rcl}-2x &=& W_0 \left(-\frac{1}{3} \right) \quad \textit{or} \quad W_{-1} \left(-\frac{1}{3} \right)\\x &=& -\frac{1}{2}W_0 \left(-\frac{1}{3} \right) \quad \textit{or} \quad -\frac{1}{2}W_{-1} \left(-\frac{1}{3} \right)\end{array}$$

Question

Solve: $x^5 = 8^x$

Solution

$$\begin{array}{rcll}x^5 &=& 8^x & \quad {\Tiny \textrm{address both the extra exponent $5$ and lack of $e$, by taking a natural log of both sides}}\\\ln x^5 &=& \ln 8^x & \quad {\Tiny \textrm{properties of logs lets us pull the exponents to the front of each expression}}\\5\ln x &=& x \ln 8 & \quad {\Tiny \textrm{divide both sides by $5x$ to get variables on one side, constants on the other}}\\(\ln x) \cdot (\frac{1}{x}) &=& \frac{\ln 8}{5} & \quad {\Tiny \textrm{we can introduce an $e^u$ using the inverse properties of $e^x$ and $\ln x$}}\\(\ln x) \cdot e^{\ln \frac{1}{x}} &=& \frac{\ln 8}{5} & \quad {\Tiny \textrm{we almost have $ue^u$ form on the left -- rewrite $1/x$ as a power to get closer}}\\(\ln x) \cdot e^{\ln x^{-1}} &=& \frac{\ln 8}{5} & \quad {\Tiny \textrm{then use log properties to pull the negative exponent out of the log}}\\(\ln x) \cdot e^{-\ln x} &=& \frac{\ln 8}{5} & \quad {\Tiny \textrm{not essential -- but we can write the right side more compactly using log properties}}\\(\ln x) \cdot e^{-\ln x} &=& \ln \sqrt[5]{8} & \quad {\Tiny \textrm{now, the first factor is just missing a negative -- so negate both sides}}\\(-\ln x) \cdot e^{-\ln x} &=& -\ln \sqrt[5]{8} & \quad {\Tiny \textrm{success! now we can use the inverse of Lambert's $W$ function}}\\\end{array}$$However, as the value on the right side is in $[-\frac{1}{e},0)$ we must again consider two cases: $$W_0((-\ln) \cdot e^{-\ln x}) = -\ln \sqrt[5]{8} \quad \textit{or} \quad W_{-1}((-\ln) \cdot e^{-\ln x}) = -\ln \sqrt[5]{8}$$ Now we proceed with the socks and shoes strategy:$$\begin{array}{rcl}-\ln x &=& W_0(-\ln \sqrt[5]{8}) \quad \textit{or} \quad W_{-1}(-\ln \sqrt[5]{8})\\\ln x &=& -W_0(-\ln \sqrt[5]{8}) \quad \textit{or} \quad -W_{-1}(-\ln \sqrt[5]{8})\\x &=& e^{-W_0(-\ln \sqrt[5]{8})} \quad \textit{or} \quad e^{-W_{-1}(-\ln \sqrt[5]{8})}\\\end{array}$$

Relations and Lambert's W Function (2024)

FAQs

What is the formula for Lambert W function? ›

The Lambert W function W(x) represents the solutions y of the equation y e y = x for any complex number x . For complex x, the equation has an infinite number of solutions y = lambertW(k,x) where k ranges over all integers.

Is the Lambert W function useful? ›

The Lambert W function's branches cannot be expressed in terms of elementary functions. It is useful in combinatorics, for instance, in the enumeration of trees.

What is the generalized Lambert W function? ›

The Lambert W function gives the solutions of a simple exponential polynomial. The generalized Lambert W function was defined by Mezö and Baricz, and has found applications in delay differential equations and physics.

What is the only Lambert law equation? ›

If in traversing a path of length dx the intensity is reduced from I to I – dI then Lambert's law states that dI/I is the same for all elementary paths of length dx. Thus Equation 7.8 may be obtained, where K is a constant known as the absorption coefficient.

How is the Lambert W function derived? ›

Another way to find the derivative of the Lambert function:
  1. recall that W(x) is the inverse of f(x)=xex.
  2. recall that if g(x) is the inverse of f(x), then g′(x)=1f′(g(x)) For f(x)=xex, f′(x)=xex+ex=ex(x+1) So, if f(x)=xex, and g(x)=W(x) is its inverse, then g′(x)=1eW(x)(W(x)+1)
  3. recall that eW(x)=xW(x)
Oct 10, 2015

What is the inverse of Lambert W? ›

The inverse of this function is called the Lambert W_{-1} function. It is represented by its maroon graph in the picture below. Mathematica's notation for W_0(x) function is ProductLog[x], or, equivalently ProductLog[0,x]. Mathematica's notation for W_{-1}(x) function is ProductLog[-1,x].

Is Lambert W an elementary function? ›

Solutions to a wide variety of transcendental equations can be expressed in terms of the Lambert W function. The W function, also occurring frequently in many branches of science, is a non-elementary but now standard mathematical function implemented in all major technical computing systems.

What is the main weakness of the Lambert projection? ›

Distances are accurate only along the standard parallels. Scale, area, and distances are increasingly distorted away from the standard parallels, but they are the same along any given parallel and symmetric across the central meridian. The projection is not conformal at the poles.

What is the Lambert W function for applications in physics? ›

The Lambert function and its possible applications in physics are presented. The actual numerical implementation in C++ consists of Halley's and Fritsch's iterations with initial approximations based on branch-point expansion, asymptotic series, rational fits, and continued-logarithm recursion.

What is the significance of the Lambert law? ›

We use Beer Lambert Law to conduct a qualitative and quantitative analysis of biological and dosimetric materials that may contain organic or inorganic materials. We can determine the concentration of various substances in cell structures by measuring their absorbing spectra in the cell.

What is the representation of the Lambert W function? ›

The Lambert W function is the many-valued analytic inverse of z(w)=we w . We use elementary complex analysis to derive closed-form representations of all of the branches of W through simple quadratures.

Is the Lambert W function analytic? ›

Analytic Approximations to the Lambert W Function. which in practice is used as the starting point for numerical inversion of the equation. The appearance of the logarithm, however, means that one has a lovely singularity at the origin. This asymptotic expression is thus not well suited to analytic treatment there.

What is the principle of Lambert? ›

The Beer-Lambert law states that: for a given material sample path length and concentration of the sample are directly proportional to the absorbance of the light. where, A is the amount of light absorbed for a particular wavelength by the sample.

What is the Lambert lighting formula? ›

In optics, Lambert's cosine law says that the radiant intensity or luminous intensity observed from an ideal diffusely reflecting surface or ideal diffuse radiator is directly proportional to the cosine of the angle θ between the observer's line of sight and the surface normal; I = I0 cos θ.

What is the formula for W reversible? ›

Work done in reversible adiabatic process (w)=ΔU=nR(γ−1)(T2−T1)

Which is the correct equation for Lambert Beer law? ›

The Beer–Lambert law relates the absorption of light by a solution to the properties of the solution according to the following equation: A = εbc, where ε is the molar absorptivity of the absorbing species, b is the path length, and c is the concentration of the absorbing species.

Top Articles
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 6210

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.