Solution of a Lambert W function

3.8k Views Asked by At

The question was : (find x)

$6x=e^{2x}$

I knew Lambert W function and hence:

$\Rightarrow 1=\dfrac{6x}{e^{2x}}$

$\Rightarrow \dfrac{1}{6}=xe^{-2x}$

$\Rightarrow \dfrac{-1}{3}=-2xe^{-2x}$

$\Rightarrow -2x=W(\dfrac{-1}{3})$

$\therefore x=\dfrac{-1}{2} W(\dfrac{-1}{3})$


But when i went to WolframAlpha, it showed the same result but in the graph:

WolframAlpha Graph http://www5b.wolframalpha.com/Calculate/MSP/MSP132207dchg91df64hcb0000351g9904e7fi986a?MSPStoreType=image/gif&s=61&w=349.&h=185.&cdf=Coordinates&cdf=Tooltips

The curves intersect at a point...

And hence there is a second solution as $x=\dfrac{-1}{2} W_{-1}(\dfrac{-1}{3})$

And it also gives approximates as $x=0.309 $ or $0.756$

So, How to find out the second solution of a Lambert W function and also How to find their approximates?

Please reply. Thanks!


P.S. - This may seem a duplicate but i have seen a lot of StackExchange articles none of which show the correct explanation.

2

There are 2 best solutions below

5
On BEST ANSWER

In terms of Lambert function, there are two roots which are $$x_1=-\frac{1}{2} W\left(-\frac{1}{3}\right)\approx 0.309$$ $$x_2=-\frac{1}{2} W_{-1}\left(-\frac{1}{3}\right)\approx 0.756$$ If you want to compute accurately these roots, you could solve $$f(x)=6x-e^{2x}=0$$ using Newton method.

Even if we already know the results, you can notice that $f(x)$ goes through an extremum for $x=\frac{\log (3)}{2}$ and for this specific value $f(x)=3 \log (3)-3 >0$. The second derivative test shows that this is a maximum. You can also notice that $f(0)=-1$ and $f(1)=6-e^2<0$. So $0$ and $1$ are good candidates as starting points.

Starting from a guess $x_0$, Newton method will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ which, for the case we consider gives $$x_{n+1}=\frac{e^{2 x_n} (2 x_n-1)}{2 \left(e^{2 x_n}-3\right)}$$ Starting with $x_0=0$ generates the following iterates : $0.250000$, $0.305030$, $0.309498$, $0.309531$ which is the solution for six significant figures.

Starting with $x_0=1$ generates the following iterates : $0.841759$, $0.771741$, $0.756744$, $0.756069$, $0.756067$ which is the solution for six significant figures.

For sure, you could do the same using Halley or Housholder methods for faster convergence. For illustartion purposes, using Halley starting at $x_0=0$ produces the following iterates : $0.281250$, $0.309419$, $0.309531$; starting at $x_0=1$ : $0.799604$, $0.756909$, $0.756067$.

Edit

You could easily show that $f(x)=ax-e^{2x}$ has no root if $a<2e$, a double root for $a=2e$ (it will be $x=\frac 12$) and two roots for $a>2e$.

What is amazing is that, if you expand $f(x)=ax-e^{2x}$ as a Taylor series buit at $x=\frac 12$ you have $$f(x)=\left(\frac{a}{2}-e\right)+(a-2 e) \left(x-\frac{1}{2}\right)-2 e \left(x-\frac{1}{2}\right)^2+O\left(\left(x-\frac{1}{2}\right)^3\right)$$ If you solve the quadratic, the roots are given by $$x_{\pm}=\frac{a\pm\sqrt{a^2-4 e^2}}{4 e}$$ which, for $a=6$ gives $\approx 0.318$ and $\approx 0.785$ . Quite close, isn't it for the price of a quadratic ?

4
On

The Lambert W function has infinitely many branches. For $-1/e < x < 0$, both the "$-1$" branch $W_{-1}$ and the "$0$" branch $W_0$ are real; both are $-1$ at $-1/e$, but $W_{-1}(x)$ decreases to $-\infty$ as $x$ increases to $0$ while $W_0(x)$ increases to $0$. Here's a plot, with $W_0$ in red and $W_{-1}$ in blue.

enter image description here

For numerical approximations, Newton's method converges quickly, or you could use power series. The Puiseux series for $W_0(x)$ for $x$ near $x = -1/e$ is (according to Maple)

$$ -1+{\frac {\sqrt {2}\sqrt {x+{{\rm e}^{-1}}}}{\sqrt {{{\rm e}^{-1}}}}} -2/3\,{\frac {x+{{\rm e}^{-1}}}{{{\rm e}^{-1}}}}+{\frac {11\,\sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{3/2}}{36\, \left( {{\rm e}^{-1}} \right) ^{3/2}}}-{\frac {43\, \left( x+{{\rm e}^{-1}} \right) ^{2}}{ 135\, \left( {{\rm e}^{-1}} \right) ^{2}}}+{\frac {769\,\sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{5/2}}{4320\, \left( {{\rm e}^{-1}} \right) ^{5/2}}}-{\frac {1768\, \left( x+{{\rm e}^{-1}} \right) ^{3} }{8505\, \left( {{\rm e}^{-1}} \right) ^{3}}}+{\frac {680863\,\sqrt {2 } \left( x+{{\rm e}^{-1}} \right) ^{7/2}}{5443200\, \left( {{\rm e}^{- 1}} \right) ^{7/2}}}-{\frac {3926\, \left( x+{{\rm e}^{-1}} \right) ^{ 4}}{25515\, \left( {{\rm e}^{-1}} \right) ^{4}}}+{\frac {226287557\, \sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{9/2}}{2351462400\, \left( {{\rm e}^{-1}} \right) ^{9/2}}}-{\frac {23105476\, \left( x+{{\rm e}^{ -1}} \right) ^{5}}{189448875\, \left( {{\rm e}^{-1}} \right) ^{5}}}+{ \frac {169709463197\,\sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{11/2} }{2172751257600\, \left( {{\rm e}^{-1}} \right) ^{11/2}}} $$ The series for $W_{-1}$ is $$ -1-{\frac {\sqrt {2}\sqrt {x+{{\rm e}^{-1}}}}{\sqrt {{{\rm e}^{-1}}}}} -2/3\,{\frac {x+{{\rm e}^{-1}}}{{{\rm e}^{-1}}}}-{\frac {11\,\sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{3/2}}{36\, \left( {{\rm e}^{-1}} \right) ^{3/2}}}-{\frac {43\, \left( x+{{\rm e}^{-1}} \right) ^{2}}{ 135\, \left( {{\rm e}^{-1}} \right) ^{2}}}-{\frac {769\,\sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{5/2}}{4320\, \left( {{\rm e}^{-1}} \right) ^{5/2}}}-{\frac {1768\, \left( x+{{\rm e}^{-1}} \right) ^{3} }{8505\, \left( {{\rm e}^{-1}} \right) ^{3}}}-{\frac {680863\,\sqrt {2 } \left( x+{{\rm e}^{-1}} \right) ^{7/2}}{5443200\, \left( {{\rm e}^{- 1}} \right) ^{7/2}}}-{\frac {3926\, \left( x+{{\rm e}^{-1}} \right) ^{ 4}}{25515\, \left( {{\rm e}^{-1}} \right) ^{4}}}-{\frac {226287557\, \sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{9/2}}{2351462400\, \left( {{\rm e}^{-1}} \right) ^{9/2}}}-{\frac {23105476\, \left( x+{{\rm e}^{ -1}} \right) ^{5}}{189448875\, \left( {{\rm e}^{-1}} \right) ^{5}}}-{ \frac {169709463197\,\sqrt {2} \left( x+{{\rm e}^{-1}} \right) ^{11/2} }{2172751257600\, \left( {{\rm e}^{-1}} \right) ^{11/2}}}$$