Tuesday 16 February 2021

More on the Lambert W Function

I wrote about the Lambert W function in a post titled The Omega Constant and the Lambert W Function on June 24th 2020. Recently, I watched a blackpenredpen video that involved the use of the Lambert W function or the product log as it's sometimes called.


In the video, use was also made of Geogebra and WolframAlpha so this post repeats what is covered in the video and contains screenshots from both these resources. The video deals mainly with the solution of the equation: $$ \sqrt[3]{x}=\ln(x)$$Firstly, let's look at the graphs of \(y=\sqrt[3]{x}\) and \(y=\ln(x)\) using Geogebra. Figure 1 shows a screenshot.


Figure 1: generated using Geogebra

As can be seen in Figure 1, there are two solutions, \(x \approx 6.41\) and \(x \approx 93.35\). Now let's go about solving the equation:$$
\begin{align}
\sqrt[3]{x} &=\ln(x) \\
x^{1/3} &= \ln(x) \\
\ln(x).x^{-1/3} &=1 \\
-1/3. \ln(x).e^{-1/3. \ln(x)} &=-1/3 \\
W \big (-1/3 .\ln(x).e^{-1/3. \ln(x)} \big ) &=W \big (-1/3 \big ) \\
-1/3.\ln(x) &=W(-1/3)\\
x &= e^{-3.W_0(-1/3)} \text{ and } e^{-3.W_{-1}(-1/3) }\\
x & \approx 6.41 \text{ and } 93.35
\end{align}$$Figures 2 and 3 show how WolframAlpha will return the two approximations using the productlog function:


Figure 2



Figure 3

Figure 4 shows the commands needed in SageMathCell to produce these results:


Figure 4

UPDATE: I thought I'd add the following problems to this post rather than to create a new post. Here is the challenge: 

PROBLEM 1: Find the value of \(x\) for \(a^x=bx\) with \(a>1\) and \(b>1\). Test for \(2^x=8x\).

To solve this, let's take the log of both sides:$$
\begin{align}
\log(a^x) &=\log(bx)\\
x \log a &= \log(bx)\\
bx \log a &=b\log(bx)\\
e^{\log(bx)} \log a &=b\log(bx)\\
\frac{\log a}{b} &=\log(bx) \, e^{-log(bx)} \\
\frac{\log a}{b} &=- \log(bx) \, e^{-log(bx)} \\
W \big (\frac{\log a}{b} \big )&=W \big ( - \log(bx) \, e^{-log(bx)} \big )\\
W \big (\frac{\log a}{b} \big )&=-log(bx)\\
\log(bx) &=-W \big (-\frac{\log a}{b} \big )\\
bx&=e^{-W (-\frac{\log a}{b} ) }\\
x&=\frac{ e^{-W (-\frac{\log a}{b} )}}{b} \\
\end{align}$$When we substitute \(a=2\) and \(b=8\) we get:$$
x=\frac{ e^{-W (-\frac{\log 2}{8} )}}{8} \approx 0.1375$$Figure 5 taken from Geogebra confirms this result. \(f\) is \(y=2^x\), \(g\) is \(y=8x\) and A is given as (0,14, 1.1) by the program:


Figure 5

PROBLEM 2: Here is another equation that I came across on YouTube.$$x^2+\log(x)=0$$Here is the solution using the Lambert W function:$$ \begin{align}
x^2+\log(x) &=0\\
1+\frac{\log(x)}{x^2} &=0\\
\log(x) \, x^{-2} &=-1\\
-2 \, \log(x) \,x^{-2} &=2\\
\log(x^{-2}) \, e^{\log(x^{-2})} &=2\\
W(\log(x^{-2}) \, e^{\log(x^{-2})}) &=W(2)\\
\log(x^{-2}) &=W(2)\\
x^{-2} &=e^{W(2)}\\
x^2 &=e^{-W(2)}\\
x &=\sqrt{e^{-W(2)}}\\
x &\approx 0.6529
\end{align}$$Again, Geogebra confirms the result. See Figure 6.

Figure 6


No comments:

Post a Comment