How to solve $x^2 = e^x$ The question is to find $x$ in:


  \begin{equation*}
x^2=e^x
\end{equation*}





  I know Newton's method and hence could find the approx as $x\approx -0.7034674225$ from 


\begin{equation*}
x_{n+1} = x_n - \dfrac{x_n^2-e^{x_n}}{2x_n-e^{x_n}}
\end{equation*}



According to WolframAlpha:




  They also say that $x=-2W(\dfrac{1}{2})$ which shows that it can be solved using some Lambert-W function...Can anyone tell me how to do this?


Thanks a lot!

P.S. - I studied a li'l bit of Lambert-W ... So i guess a detailed explanation would not be needed ... just the initial steps!
$$
x^2=e^x\implies x/2=\pm\tfrac12e^{x/2}\implies-x/2\,e^{-x/2}=\pm\tfrac12
$$
Therefore,
$$
x=-2\mathrm{W}\!\left(\pm\tfrac12\right)
$$
Since $\mathrm{W}(x)$ is real only for $x\ge-\frac1e$, we only have one real solution:
$$
x=-2\mathrm{W}\!\left(\tfrac12\right)=-0.70346742249839165205
$$
You can write $\mathrm{f(x)=e^{-x}.x^2}$
Now differentiate this function w.r.t x.
$$\mathrm{f`(x)=e^{-x}(2x-x^2)}$$.
Now set $$\mathrm{f'(x)=0}$$.
It yields the solutions $$\mathrm{x=0 and x=2}$$.
The values of f(x) at these x values are 0 and $\mathrm{4/e^2}$ respectively. Obviously $\mathrm{4/e^2}$ is less than 1.
Now plot the graph of this function. Find the number of intersection points of this function and $\mathrm{y=1}$.