8

We can solve the equation $x^x=c$ using the Lambert $W$ function, but how do we solve $x^{x^x}=c$?

IV_
  • 6,964

4 Answers4

5

Taking a part of Yves Daoust's answer, see that

$$x^{x^{x+1}}=(x^x)^{x^x}=\left(x^{x^x}\right)^x=c$$

can be solved with two applications of the Lambert W function.

But of course, you wish to find $x^{x^x}=c$.

Suppose you know $x\approx d$.

This means

$$d^{d^d}\approx c$$

$$\implies d^{d^{d+1}}\approx c^d$$

Or,

$$x_{n+1}^{x_{n+1}^{x_{n+1}+1}}=c^{x_n}$$

$$\large x_{n+1}=e^{W\left[W(x_n\ln(c))\right]}$$

So, if you have a calculator handy, you can do something along these lines:

$$x_0=d$$

$$x_1=e^{W\left[W(d\ln(c))\right]}$$

$$x_2=e^{W\left[W(x_1\ln(c))\right]}$$

$$etc.$$

Testing it with $c=500$ and $x_0=2.3$:

$$\begin{align} x_0 & =\overline{2.3} \\ x_1 & =\overline{2.33}3760625 \\ x_2 & =\overline{2.339}000432 \\ x_3 & =\overline{2.3398}0707 \\ x_4 & =\overline{2.3399}31091 \\ x_5 & =\overline{2.33995}0156 \\ x_6 & =\overline{2.339953}086 \\ x_7 & =\overline{2.3399535}36 \\ \end{align}$$

See that $x_7^{x_7^{x_7}}=499.9994005$. The calculations may be a little off because I did them with my scientific calculator though, but it seems accurate enough. It also seems that it approximates one more digit at a time correctly, which may seem slow, but given the size of the numbers we are trying to use, a few digits make good differences. (compare $x=2.3$ and $x=2.4$ and see how far they are off from $c=500$.)

Also note that for the most part, the solution will be less than $4$ if $c$ even fits on your calculator.

  • Nice approximation. – Pentapolis Sep 22 '16 at 21:28
  • @Pentapolis Thanks. I use fixed-point iteration for the calculation of the Lambert W function. Comes in handy for these weird type problems. – Simply Beautiful Art Sep 22 '16 at 21:29
  • @SimpleArt, clever solution. I tried "solve x^x^x=500" in Wolfram Alpha and got $x \approx 2.33995361843844...$ with no work shown and "Standard computation time exceeded..." message. This seems to indicate no solution even in terms of exotic special functions. If someone has access to Mathematica it would be interesting to learn what they obtain. – poweierstrass Sep 22 '16 at 22:19
  • @poweierstrass Yeah, I'm limited to scientific calculators and slower fingers than Mathematica. Something like Mathematica would be great. – Simply Beautiful Art Sep 22 '16 at 22:21
  • If you go for a numerical solution, Newton will do a much better job than this fixed-point approach, which in addition requires two $W$ evaluations per iteration. And how do you get $d$ ? –  Sep 23 '16 at 07:24
  • @YvesDaoust You guess, like you do at the start of most numerical algorithms. And yes, Newton's method would probably do better, but I decided to go with simpler Fixed-point. – Simply Beautiful Art Sep 23 '16 at 17:12
  • @SimpleArt: you can do better than guessing. And I wouldn't call "simpler" nested fixed-point iterations. –  Sep 23 '16 at 17:21
  • @YvesDaoust Sure. :3 sorry I can't upvote you because I only get one upvote per answer. – Simply Beautiful Art Sep 23 '16 at 17:31
3

Not a solution, but you can solve a similar equation with a double application of $W$:

$$x^{x^{x+1}}=c,$$

because

$$x^{x^{x+1}}=(x^x)^{x^x}.$$

Unfortunately, $x^{x^{x+1}}$ is far form $x^{x^x}$, as it is $(x^{x^x})^x$.


For a numerical solution, I recommend Newton, with the iterations

$$x\leftarrow x-\frac{x\ln x+\ln \ln x-\ln\ln c}{\ln x+1-\dfrac1{x\ln x}}.$$

For the case $x^{x^x}=500$ with the starting approximation $2.3$, in three steps,

$$\begin{align}2.3&\to 286.234283705\\ 2.33993454643&\to 499.860587996\\ 2.33995361844&\to 499.999999977\\ 2.33995361844&\to 500.0\end{align}$$


An initial value can be estimated empirically by dropping the second term in

$$x\ln x+\ln\ln x=\ln\ln c.$$

Then solving with Lambert and using one of its asymptotic expressions we get

$$x\approx\frac{\ln\ln c}{\ln\ln\ln c}(\ln\ln\ln c)^{1/k \ln\ln\ln c}.$$

By trial and error, we found $k=4$ to give good results (e.g. $500\to2.457$) for values of $c$ in the range of double-precision floats. It is worth to note that because of some overshoot, with this starting formula Newton's iterations fail on the evaluation of $\ln\ln x$ for $c<33$. Smaller values require a different method.

1

A potential solution can be extrapolated from my first question on this site (found here), where I explain that the function $$x^{x^x} = \,^3x = x + \sum_{n=2}^{\infty}\sum_{k=0}^{n-2}\bigg(\frac{S_{n-1}^{k+1}\log^{k+n}(x)x^n}{\Gamma(n)}\bigg) = x + \sum_{n=0}^{\infty}\sum_{k=0}^{n}\bigg(\frac{S_{n+1}^{k+1}\log^{k+n+2}(x)x^{n+2}}{\Gamma(n+2)}\bigg)$$
Where $S_n^k$ are the Stirling numbers of the second kind. This could potentially be used to express a solution in terms of an infinite series which could then be calculated to arbitrary accuracy.

1

The function $f$ with $f(x)=x^{x^x}$ doesn't have partial inverses over non-disrete domains in terms of elementary functions and/or Lambert W. Therefore, your equation $x^{x^x}=c$ cannot be rearranged for $x$ by applying only Lambert W and/or elementary operations (means elementary functions) you can read from the equation.
But it is an open question if the equation has solutions in the elementary numbers.

Equations of your kind can be solved by generalized Hyper Lambert W functions (see the references below).

$$x^{x^x}=c$$ $$e^{\ln(x)e^{\ln(x)x}}=c$$ $$\ln(e^{\ln(x)e^{\ln(x)x)}}=\ln(c)$$ for $-\pi<\Im(\ln(x)e^{\ln(x)x)})\le\pi$: $$\ln(x)e^{\ln(x)x}=\ln(c)$$ $$G(\ln(x);\ln(x))=\ln(c)$$ $$\ln(x)=HW(\ln(x);\ln(c))$$ $$x=e^{HW(\ln(x);\ln(c))}$$

So we have a closed form for $x$, and the series representations of Hyper Lambert W (e.g. Lagrange inversion) give some hints for calculating $x$.
$\ $

Fantini, J.; Kloepfer, G.: Wexzal/The coupled Exponent, 1998

Helms, G.: Wexzal"/"coupled exponent" , "Superroot" and a generalized Lambert-W

Galidakis, I. N.: On solving the p-th complex auxiliary equation $f^{(p)}(z)=z$. Complex Variables 50 (2005) (13) 977-997

Galidakis, I. N.: On some applications of the generalized hyper-Lambert functions. Complex Variables and Elliptic Equations 52 (2007) (12) 1101-1119

Galidakis, I.; Weisstein, E. W.: Power Tower. Wolfram MathWorld

IV_
  • 6,964