Fun logarithm question

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

-
There appears to be two solutions to that equation, one of which is interestingly close to $\frac{209}{10}$ –  Daniel R Jan 16 '14 at 10:47
@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. –  Claude Leibovici Jan 16 '14 at 11:09
@ClaudeLeibovici Heh, seems like even WA has its dark spots. :) –  Daniel R Jan 16 '14 at 11:39
@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. –  Cruncher Jan 16 '14 at 15:08
@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. –  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}$.

-
Very interesting @ClaudeLeibovici! –  Umberto Jan 16 '14 at 14:43

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

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

The equation can be manipulated to the form

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

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

$$\left.\frac{dx}{da}\right|_{x_0,a_0}=0$$

$$\left.\frac{d^2x}{da^2}\right|_{x_0,a_0}=-{e}^{3/e-1}$$

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

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

-
I run the algorithm for 10000 and 100000 iterations and got no change. Result is 1.444667364811697662929645957774. Just as a reference :-) –  Umberto Jan 16 '14 at 11:32
@Umberto. Nice problem, isn't ? –  Claude Leibovici Jan 16 '14 at 11:39
Yeah... Is actually very interesting. Wolframalpha does not recognize the solution as something known... –  Umberto Jan 16 '14 at 11:41
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. –  Just_a_fool Jan 16 '14 at 11:44
@Just_a_fool. Look at my latest answer ! Thanks for the problem. –  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

#!/usr/bin/python
import math
import sys

# function to calculate f(x)
def f(x):
f=math.pow(x,math.pow(2,x))-math.pow(2,x)
return f

def fp(x):
fp=math.pow(2,x)*math.pow(x,math.pow(2,x)-1)*(x*math.log(2)*math.log(x)+1)
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):
break
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$.

-