How would you go about solving $x^{2^{x}} = 2^{x}$? There should be a solution $1<x<2$, but I haven't found a way to derive the answer using the usual log laws, maybe there is an elegant way though...

  • 1
    $\begingroup$ There appears to be two solutions to that equation, one of which is interestingly close to $\frac{209}{10}$ $\endgroup$ – Daniel R Jan 16 '14 at 10:47
  • 1
    $\begingroup$ @DanielR. The solution at 20.9 is more than surprizing ! x^(2^x)-2^x is 1.217369791140204*10^2583146 for x=20.9 !!! Cheers. $\endgroup$ – Claude Leibovici Jan 16 '14 at 11:09
  • 1
    $\begingroup$ @ClaudeLeibovici Heh, seems like even WA has its dark spots. :) $\endgroup$ – Daniel R Jan 16 '14 at 11:39
  • 1
    $\begingroup$ @ClaudeLeibovici Does anybody know much about the algorithms that WA uses? I'm very interested at how it came up with this result. Come to think of it, it may stem from some form of integer overflow. $\endgroup$ – Cruncher Jan 16 '14 at 15:08
  • 1
    $\begingroup$ @Cruncher. This is a really good question ! When you get the answer, please tell me ! The story about the root around 20.9 will probably stay a mistery for a time. Conclusion (for the time being) : CAS are very useful but ... they can be wrong since done by human beings. So, a dark spot in WA as Daniel R. said ... Cheers. $\endgroup$ – Claude Leibovici Jan 16 '14 at 15:26

We all agree on the fact that the solution of this equation is close to $e^{1/e}$. What I did was to write the solution as $x=e^{1/(e+y)}$ and I expanded the equation as a Taylor series around $y=0$. Limited to the first order, this leads to an expression of $y$ (I am physically unable to write it down) which only includes $2$, e and $\log 2$. Its numerical value is $2.53791*10^{-6}$. For this value of $x=1.444667364812765575108917$ (quite close to Umberto's), the function value is $5.48006*10^{-12}$.

Edit (6 years later)

Taking logarithms, consider that we look for the zero of function $$f(x)=\log \left(x^{2^x}\right)-\log \left(2^x\right)=2^x\log(x)-x \log(2)$$ and perform one Newton iteration to get $$x_0=e^{\frac{1}{e}}\implies x_1=x_0+ \frac{{x_0} \left({x_0} \log (2)-2^{x_0} \log ({x_0})\right)}{2^{x_0}+2^{x_0} {x_0} \log (2) \log ({x_0})-{x_0} \log (2)}$$ which makes $x_1=1.44466736481181$ while the "exact" solution is $x=1.44466736481170$.

Using one iteration of Halley method gives $21$ exact figures. Using one iteration of Householder method gives $27$ exact figures. The formulae are explicit but really too lengthy to be reported here.

  • $\begingroup$ Very interesting @ClaudeLeibovici! $\endgroup$ – Umberto Jan 16 '14 at 14:43
  • $\begingroup$ Nice edit, 6 years later! :P $\endgroup$ – Mr Pie Jun 13 '20 at 3:54

Edited: what follows is not very useful. See below

Letting $y = 2^x$ we must have $x^y = y $.

This later is solved by

$$ y = \frac{W_{-1}( -\log(x)) }{-\log x} $$

where $W_{-1}$ is the second branch of the Lambert function - with domain in $(-1/e,0)$ and image in $(-\infty,-1)$.

But $y \log x =\log y$, then

$$ -W_{-1}( -\log(x)) = \log y = x \log 2$$

Or, letting $t= -\log x$

$$ -W_{-1}(t) = e^{-t} \log 2$$

enter image description here

Still, this is no explicit solution, but -to begin with- it shows (graphically) that the $t$ should be slighly larger than $-1/e$, and hence $x$ is slighly below $e^{1/e}$.

This is due to the fact that $\log 2 = 0.693147...$ is quite near to $ e^{-1/e} = 0.6922006...$

Update: forget about the Lambert function, it really doesn't add anything.

The equation can be manipulated to the form

$$ a x e^{-a x}=\log x, \hskip{1cm} {\rm with } \; a= \log2$$

enter image description here

This equation cannot be solved explicity, but we can verify nevertheless that the function

$$ F(x,a)=a x e^{-a x}- \log x$$

has a zero at $a_0=e^{-1/e}$ and $x_0=1/a_0=e^{1/e}$. Now, because our $a = \log 2 = 0.693147...$ is quite near $ a_0 = e^{-1/e} = 0.6922006...$, we can expect our solution $x$ to be near $x_0=e^{1/e}=1.444667861...$. This argument (I guess) could be empowered by doing a Taylor expansion of $F(x,a)$

Update: assuming that $F(x,a)=0$ defines implicitly $x=g(a)$, we compute the first two derivatives and evaluate them at $(x_0,a_0)$. We get



So we can refine the approximation:

$$ x \approx x_0 - \frac{{e}^{3/e-1}}{2} (\log 2 - a_0)^2 =1.4446673641...$$

A simpler procedure is to iterate:

$$x_{n+1} = \exp(a_0 x_n e^{-a_0 x_n})$$

It converges very quickly, in two iterations we get ten decimal digits: $x=1.4446673648...$

  • $\begingroup$ Nice approach, indeed ! What is funny is that to the terms (2, e, log(2)) I had, you add 3. This problem has been quite fascinating to a lot of people. Cheers. $\endgroup$ – Claude Leibovici Jan 17 '14 at 12:10

I do not think that there is any analytical solution to this equation. The only way to find the solution would be a root finder and I suggest Newton starting from a reasonable guess.

Let me be lazzy and start at $x_{old}=2$. Newton scheme will update the value according to the classical scheme

$$x_{new} = x_{old} - f(x_{old}) / f'(x_{old}) $$

We then have the following iterates :2.00000, 1.79992, 1.61902, 1.49567, 1.44977, 1.44472, 1.44467. For this last value of $x$, the value of the function is 0.000013522.

You can continue iterating until you reach the required accuracy.

  • $\begingroup$ I run the algorithm for 10000 and 100000 iterations and got no change. Result is 1.444667364811697662929645957774. Just as a reference :-) $\endgroup$ – Umberto Jan 16 '14 at 11:32
  • $\begingroup$ @Umberto. Nice problem, isn't ? $\endgroup$ – Claude Leibovici Jan 16 '14 at 11:39
  • $\begingroup$ Yeah... Is actually very interesting. Wolframalpha does not recognize the solution as something known... $\endgroup$ – Umberto Jan 16 '14 at 11:41
  • $\begingroup$ I agree, it seems to me that the solution could be transcendental. However, now I am wondering how a series would look like which would converge to our solution. $\endgroup$ – Just_a_fool Jan 16 '14 at 11:44
  • $\begingroup$ @Just_a_fool. Look at my latest answer ! Thanks for the problem. $\endgroup$ – Claude Leibovici Jan 16 '14 at 13:31

Maybe a bit of code could be useful to the OP so that he can try the newton algorithm. I quickly wrote something in phyton

import math
import sys

# function to calculate f(x)
def f(x):
        return f

def fp(x):
        return fp

x_old = 2.0
i = 1
while True:
        x_new = x_old -f(x_old)/fp(x_old)
        i += 1
        if (i==100000):
        x_old = x_new

print "Result is: "
print('%.30f' % x_new)

I hope it can be useful. As stated in my comment above the result of this code (on a linux machine) is 1.444667364811697662929645957774.


Just for fun.

In the first answers to this post, we saw : $2$, $\log(2)$ and $e$. Leonbloy introduced $3$. I was wondering if $\pi$ would appear. It did not.

The solution is close to $(\pi- \frac{1}{8})^{1/3}$ (worse than $e^{1/e}$). Then, make one single Newton iteration; this leads to an estimate of $1.44466748$ which is quite close to the solution $1.44466736$.

So, the iterated solution now includes : $2$ , $\log(2)$, $e$ , $3$ and $\pi$.

  • $\begingroup$ The solution is also close to $\big(\frac 7{19}\big)^{-7/19}\simeq 1.444667285\ldots$ $\endgroup$ – Mr Pie Jun 12 '20 at 19:41
  • 1
    $\begingroup$ @MrPie. Have a look at my edit in my first answer. Cheers :-) $\endgroup$ – Claude Leibovici Jun 13 '20 at 2:39

Here is something very similar, and I think this YouTube video may help. This is a video on how to solve equations of the type $$b^x = x,$$ and the presenter solves for $x$ by taking the logarithm of both sides by doing:

$$ \ln(b^x) = \ln(x)$$ $$x \ln(b) = \ln(x)$$ $$x = \frac{ \ln(x)}{ \ln(b)}$$

In this case, the $b$ in the video is $1^{1/e}$. This problem seems very related - seeing as the solutions are the same, and the formulas seem similar when you substitute $x$ with $b$ and $2^x$ with $x$.


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.