10
$\begingroup$

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.

$\endgroup$
6
  • 3
    $\begingroup$ Careful! The solution won't be unique, in general! $\endgroup$ Jul 3 '18 at 8:14
  • $\begingroup$ @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. $\endgroup$
    – Dave
    Jul 3 '18 at 8:15
  • 1
    $\begingroup$ Also with positive reals there can be 2 solutions. $\endgroup$
    – Somnium
    Jul 3 '18 at 8:17
  • 1
    $\begingroup$ @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. $\endgroup$ Jul 3 '18 at 8:27
  • $\begingroup$ @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. $\endgroup$
    – Dave
    Jul 3 '18 at 8:34
19
$\begingroup$

$$\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.

$\endgroup$
4
  • $\begingroup$ Thank you a lot for your quick answer with all the details. $\endgroup$
    – Dave
    Jul 3 '18 at 8:54
  • $\begingroup$ @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. $\endgroup$
    – Szeto
    Jul 3 '18 at 8:55
  • $\begingroup$ Thank you for the hint. I am using scipy to do the calculations. I hope they did proper work in implementing the function. $\endgroup$
    – Dave
    Jul 3 '18 at 9:17
  • 3
    $\begingroup$ 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. $\endgroup$ Jul 3 '18 at 19:22
10
$\begingroup$

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)}$.

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

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$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.