Solving $W$ function What is the general form of Lambert $W$-function to calculate any $x$ in $\mathbb R$?
I had problems solving for $x, x^2-e^x=0$.
I reached $x=-2W(\frac12)$.
What does $W(\frac12)$ equal to?

Short answer:
As Ethan Bolker said, in general the only way to do it is using a computer and approximation methods. When a computer evaluates $W(z)$, it generally uses an approximation method.
Longer answer:
One such approximation method is as follows. It's an iterative method, which means you pick a starting number as a guess, plug it into the formula, and a better guess comes out. Repeat until you get the desired precision.

Source: 1996: R.M. Corless, G.H. Gonnet, D.E.G Hare, D.J. Jeffrey and
  D.E.  Knuth: On the Lambert W Function (Vol. 5: 329 – 359)

Quoted verbatim, except for changed formatting:

We return to the specific problem at hand that of computing a value
  of $W_k(z)$ for arbitrary integer $k$ and complex $z$ .
Taking full advantage of the features of iterative rootfinders
  outlined above we compared the efficiency of three methods, namely,
(1) Newton's method 
(2) Halley's method 
(3) the fourth order method described in [30] (as published this last method evaluates only the principal branch of $W$ at
  positive real arguments but it easily extends to all branches and to
  all complex arguments)
...  The results showed quite consistently that method (2) is
  the optimal method ...
For the $W$ function, Halley's method takes the form:
$$w_{j+1} = w_j - \frac{w_j e^{w_j}-z}{e^{w_j}(w_j+1)-\frac{(w_j+2)w_je^{w_j}-z}{2w_j + 2}}$$

You can find more information about Newton's Method and Halley's method on Wikipedia. Let me know if you're confused about the notation, what $k$ means, or what a "branch" is.
If there's more than one solution to $x = We^W$, then you have to pick one in order for $W$ to be a function. For real numbers, $x=We^W$ has a unique solution $W$ for $x>0$, has two solutions for $-\frac 1 e \le x \le 0$ and no solution for $x < -\frac 1 e$. So we "cut off the branch" that gives us the second solution for $-\frac 1 e \le x \le 0$, and the remaining function is called the "principal branch".
