# Solve problem with the lambert W function?

**URL:** <https://community.wolfram.com/t/solve-problem-with-the-lambert-w-function/14583>\
**Category:** Questions\
**Tags:** calculus, statistics-and-probability\
**Created:** [August 12, 2019, 11:17am UTC](https://community.wolfram.com/t/solve-problem-with-the-lambert-w-function/14583 "2019-08-12T11:17:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadiaharoonstat](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sadiaharoonstat](https://community.wolfram.com/u/sadiaharoonstat)\
**Post date:** [August 12, 2019, 11:17am UTC](https://community.wolfram.com/t/solve-problem-with-the-lambert-w-function/14583/1 "2019-08-12T11:17:05Z")

</div>

I have facing a problem in solving the lambert W function in mathematica. I have generated the x values from lambert function but I cant get the solution .ProductLog",

```
\[Phi] = 0.5; \[Kappa] = 0.2; u = RandomReal[{0, 1}, 10]; 
x = (1/\[Phi])*
   Log[(\[Kappa] - 1 + ((1 + \[Kappa])^2 - 4*\[Kappa]*u)^0.5)/(
    2*\[Kappa])] - (1/\[Phi]^2) - (1/\[Phi])*\!\(\*
ButtonBox["ProductLog",
BaseStyle->"Link",
ButtonData->"paclet:ref/ProductLog"]\)[-(1/\[Phi])*
     Exp[-(1/\[Phi])] ((\[Kappa] - 
       1 + ((1 + \[Kappa])^2 - 4*\[Kappa]*u)^0.5)/(2*\[Kappa]))]

```

---

<div class="post-metadata">

**Author:** ![mhelmle](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@mhelmle](https://community.wolfram.com/u/mhelmle)\
**Post date:** [August 21, 2019, 7:29pm UTC](https://community.wolfram.com/t/solve-problem-with-the-lambert-w-function/14583/2 "2019-08-21T19:29:35Z")

</div>

Hi Maha,

there was a problem with whitespace characters and formatting likely caused by copying stuff from the documentation into the notebook. I fixed it below (it reads still the same):

```
\[Phi] = 0.5; \[Kappa] = 0.2; u = RandomReal[{0, 1}, 10]; 

x = (1/\[Phi])*
Log[(\[Kappa] - 1 + ((1 + \[Kappa])^2 - 4*\[Kappa]*u)^0.5)/(
2*\[Kappa])] - (1/\[Phi]^2) - (1/\[Phi])* ProductLog[
-(1/\[Phi])*
Exp[-(1/\[Phi])] ((\[Kappa] - 

1 + ((1 + \[Kappa])^2 - 4*\[Kappa]*u)^0.5)/(2*\[Kappa]))]

```

It should run now OK.

Regards,

Michael

---

<div class="post-metadata">

**Author:** ![sadiaharoonstat](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sadiaharoonstat](https://community.wolfram.com/u/sadiaharoonstat)\
**Post date:** [August 24, 2019, 3:09pm UTC](https://community.wolfram.com/t/solve-problem-with-the-lambert-w-function/14583/3 "2019-08-24T15:09:21Z")

</div>

Thank you so much Michael. God bless you!
