I am trying to find all the roots of the equation $xe^{-x}=A$.
I tried using LambdertW function. I used $-xe^{-x}=-A$
Solution is $x = -LW(-A)$, where $LW$ is the Lambertw finction.
As $-xe^{-x}$ is negative, decreases intially and then increases close to zero, there will two roots corresponding to -A.
When I use the lambertW function in matlab, I am only able to get one root out of the two roots.
Is there any way to get both the roots?
According to the documentation: https://www.mathworks.com/help/symbolic/lambertw.html, the syntax for both roots should be
lambertw(0,k)andlambertw(-1,k), as the description says: