Fun logarithm question

3.8k Views Asked by At

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

6

There are 6 best solutions below

2
On BEST ANSWER

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.

5
On

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.

0
On

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.

1
On

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

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

2
On

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

0
On

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