$x^x = y$. Given $y$, find $x$.

149 Views Asked by At

Title is fairly self-explanatory. For example, for $y=27$, $x$ would be $3$. Specifically I was trying to find $x$ given $y = 10^{100}$, but I'd like to know how to solve it for any value of $y$.

3

There are 3 best solutions below

2
On

Well, $x \ln x = \ln y$, so you can use binary search on $f(x) = x \ln x$ to get a pretty good estimate of the value. But you're not going to get a "closed form" formula for $x$ in this case.

It may be easier to use $\log_{10}$. For instance, in this case, you'd get $$ x \log_{10}(x) = 100 $$ so $x$ is between $0$ and $100$. Trying $x = 10$ gives a too-small value (namely 10), so $x = 10^{1.5}$ might be better: you get $10^{1.5} \cdot 1.5 \approx 31.62 \cdot 1.5 \approx 45$. So the right $x$ is somewhere between 30 and 100.

0
On

$$\begin{align} x^x&=y\\ x\log x&=\log y\\ e^{\log x}\log x&=\log y\\ \log x&=W(\log y)\\ x&=e^{W(\log y)}\\ \end{align}$$ Where $W(x)$ is the ProductLog function, defined as the inverse of $[f(x)=xe^x]$

For your number: $$\begin{align} x^x&=10^{100}\\ x\log x&=\log 10^{100}\\ e^{\log x}\log x&=\log 10^{100}\\ \log x&=W(\log 10^{100})\\ x&=e^{W(100\log 10)}\\ x&\approx 56.9 \end{align}$$

0
On

Hint :look Lambert W function. solutions represented as:

$$x=\frac{\ln(y)}{W(\ln y)}$$