# Is there a way to solve composite exponential equations precisely?

I have a, seemingly, trivial question. Find $x$ such that $$l = x^x,$$ for some constant value $l \in \mathbb{R}^{>0}$ and $x \in \mathbb{R}^{>0}$.

Obviously, this equation has a unique solution that can aprroximated. Neverthelss, I do not see an obvious approach to solve this equation precisly, nor can I find one on this website or using google. Maybe I am only missing the appropriate terminology to express the question.

EDIT: I would also be fine with a good explanation why it is difficult or not possible.

EDIT 2: As discussed in the comments, the equation, of course, has no unique solution for $l, x \in \mathbb{R}^{>0}$ as stated by me above.

• Careful! The solution won't be unique, in general! Jul 3 '18 at 8:14
• @TheoBendit I know that in other spaces it might not be unique. That is why I specified $l$ and $x$ to be from the poisitve reals.
– Dave
Jul 3 '18 at 8:15
• Also with positive reals there can be 2 solutions. Jul 3 '18 at 8:17
• @Dave I'm not sure if I can pinpoint an exact example, but I know that $\lim_{x\to 0^+} x^x = 1 = 1^1$. Given the function is not constant over $[0, 1]$, but is continuous, it definitely can't be injective. Jul 3 '18 at 8:27
• @Somnium I see, $x^x$ has a local minimum at $1/e$ and $\lim_{x \to 0} = 1$. So there is no unique solution. However, I was aiming for larger $l$, like 800 for example.
– Dave
Jul 3 '18 at 8:34

$$\ln l=x\ln x$$ Let $x=e^u$, $$\ln l=ue^u$$ $$W_k(\ln l)=u$$ $$W_k(\ln l)=\ln x$$ $$\color{Red}{x=e^{W_k(\ln l)}=\frac{\ln l}{W_k(\ln l)}}$$

There are infinitely many branches of the Lambert W function, and the $k$th branch is denoted as $W_k$.

Only $W_0$ and $W_{-1}$ accept a real argument and return a real value. So $k$ is either $0$ or $-1$.

As your $l$ is large(as mentioned in your comment), only $W_0$ can be used because $W_{-1}$ is real only for $-\frac1e\le x<0$.

Also, it is often inconvenient to compute W functions. An approximation is $$W_0(x)=\ln x-\ln\ln x+ o(1)$$ for large $x$.

Therefore, the solution to $x^x=l$ can also be approximated as $$x\approx e^{\ln\ln l-\ln\ln\ln l}=\frac{\ln l}{\ln\ln l}$$

NOTE: You need $\ln l$ to be large enough for the approximation, and so $l$ has to be extra large. Even $\ln 10000$ is just around $9.21$, which is not large enough for the approximation.

• Thank you a lot for your quick answer with all the details.
– Dave
Jul 3 '18 at 8:54
• @Dave Note that when I plot the graphs, the error between the approximation and the actual value diverges. I don’t know the reason for this strange behavior. Jul 3 '18 at 8:55
• Thank you for the hint. I am using scipy to do the calculations. I hope they did proper work in implementing the function.
– Dave
Jul 3 '18 at 9:17
• Note that there are some algorithms for computing the Lambert function to higher precision, usually based on iterative schemes; IIRC the more recent editions of The Art Of Computer Programming cover the topic, because it pops up repeatedly in the contexts of partitions, Bell Numbers, Stirling Numbers, etc. Jul 3 '18 at 19:22

Let me introduce you to a lovely little versatile function $W$ called the Lambert W function. $W$ is defined to be the inverse of the function $$f(x) = xe^x.$$ (Unfortunately, this function is not injective, so $W$ sometimes takes two values.) Essentially $W$ is defined by the relation $$W(x) e^{W(x)} = x$$ for all $x$.

How does this help? We can use this to solve the equation above. We have $$x^x = l \iff \ln x \cdot e^{\ln x} = \ln l,$$ so $\ln x = W(\ln l)$, hence $x = e^{W(\ln l)}$.

• Thank you a lot for your quick answer. In the end I accepted Szetos answer, because it has more details.
– Dave
Jul 3 '18 at 8:53

It depends on what you mean by "precisely". Only rational numbers can be represented by a finite number of decimal points, so any real number can only be approximated by numerical methods, or represented by some mathematical expression such as "square root". $x \rightarrow x^x$ is continuous and increasing for $x>1$, so it's 1:1. So the cardinality of $l$ such that $x$ is rational is the same as the cardinality of the rationals, so "almost all" $l$ will result in irrational $x$.