# How to solve $x^x=k$? [duplicate]

Possible Duplicate:
$x^x=y$. How to solve for $x$?

If we have $x^x=4$ it's easily solved by substituting $x$ with $2$. But for general equation like $x^x = k$, how we can find the solution?

Moreover, what if we have equation $$x^{a+bx}=k$$ or $$x^{f(x)}=k$$

-

## marked as duplicate by Guess who it is., Gerry Myerson, Henning Makholm, Asaf Karagila, t.b.Nov 5 '11 at 22:17

Solving $x^x=k$ requires the services of the Lambert function, $W(x)$. Recall that the Lambert function is the inverse of the function $xe^x$.
\begin{align*}e^{x\ln\,x}&=k\\x\ln\,x&=\ln\,k\\e^{\ln\,x} \ln\,x&=\ln\,k\\\ln\,x&=W(\ln\,k)\\x&=e^{W(\ln\,k)}\end{align*}