5

Is it possible to analytically solve the expression $x^{x^x}=3$?

And how to solve this problem numerically?

Simply testing some results, I found that $\sqrt{2.6}<x<\sqrt{2.7}$. What matches the result provided by Elliot G in the comments.

But in addition to a numerical solution, like the technique posted by glowstonetrees, is it possible to find a "closed" formula for the solution of this problem?

Mrcrg
  • 2,767

2 Answers2

6

Quite sure you can't solve this analytically.

On the other hand, there are many numerical methods for solving $f(x)=0$. For example, Newton's method gives the sequence of iterates

$$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$$

for any starting guess $x_0$ that is close enough to the desired solution.

In your case, you would have

$$f(x) = x^{x^x}-3 \qquad \qquad f'(x) = x^{x^x}x^x\bigg( \frac 1x + \ln (x) \big(1+\ln(x)\big)\bigg)$$

So for example you could run a for-loop

\begin{align} & x_0 = 1 \\ & \text{for } n = 0,1,2,\dots \\ & \; \; \; \; \; x_{n+1} = x_n - \frac{x_n^{x_n^{x_n}}-3}{x_n^{x_n^{x_n}}x_n^{x_n}\Big( \frac {1}{x_n} + \ln (x_n) \big(1+\ln(x_n)\big)\Big)} \\ & \text{end} \end{align}

  • 2
    In my opinion, everything after the first sentence is irrelevant to this question. The OP didn’t have a problem getting a stellar approximation and doesn’t seem to be interested in the process. It almost comes across as “I need some fluff in here so I can get upvotes.” I’m more interested in why you’re “Quite sure you can’t solve this analytically.” Unless you have a justification as to how mentioning Newton’s method and designing a for-loop has remotely anything to do with finding a closed-form solution, I think I’ll downvote. – gen-ℤ ready to perish Jun 06 '20 at 21:46
  • 4
    The OP did one of the supposedly forbidden thing of editing the question after I posted my answer. Originally, the second part of his question asked "can this be solved using numerical methods", in which case I suggested Newton's method as an example. – glowstonetrees Jun 06 '20 at 22:11
  • 1
    +1 I see that now! I will flag the question for moderator intervention and ask for a rollback of the edits. I also left a comment for the OP. – gen-ℤ ready to perish Jun 06 '20 at 22:21
  • The OP put “how to solve this problem numerically?” back in the body of the post. – gen-ℤ ready to perish Jun 06 '20 at 23:18
1

For sure, a numerical solution could always be obtained using, as already suggested in comments, Newton method which will be the simplest.

You just need to reformulate the problem as : find the zero of function $$f(x)=x^{x^x}-3$$ The problem is that the function is so stiff that, if you do not have a good estimate, many iterations could be required. For example, let us start with $x_0=2$ which looks to be very close to the solution. The iterates will be $$\left( \begin{array}{cc} n & x_n \\ 0 & 2.0000000 \\ 1 & 1.8786299 \\ 2 & 1.7574536 \\ 3 & 1.6696436 \\ 4 & 1.6380522 \\ 5 & 1.6351011 \\ 6 & 1.6350785 \end{array} \right)$$

Trying to make the problem more linear, trying with $$g(x)=\log(x^{x^x})-\log(3)$$ $$\left( \begin{array}{cc} n & x_n \\ 0 & 2.0000000 \\ 1 & 1.7499438 \\ 2 & 1.6481903 \\ 3 & 1.6352591 \\ 4 & 1.6350785 \end{array} \right)$$ One more step in the same direction with $$h(x)=\log(\log(x^{x^x}))-\log(\log(3))$$

$$\left( \begin{array}{cc} n & x_n \\ 0 & 2.0000000 \\ 1 & 1.6165932 \\ 2 & 1.6349681 \\ 3 & 1.6350785 \end{array} \right)$$

  • @glowstonetrees already suggested Newton’s method for a numerical solution – gen-ℤ ready to perish Jun 07 '20 at 03:21
  • @gen-zreadytoperish yes but without the log trick... – pluton Jun 07 '20 at 03:26
  • @pluton I do not see the "trick" here - is it that there are less steps? But there are extra calculations at each step, so does it become less computation-demanding? – Dávid Laczkó Jun 07 '20 at 11:31
  • 1
    I think what @Claude Leibovici is trying to say is that we can rewrite the equation as $$x^{x^x}=3\implies x^x\ln(x)=\ln(3)$$ and apply Newton's method on $$f(x)=x^x\ln(x)-\ln(3)$$ instead. This achieves faster convergence because the function is less steep around the root. Thus, by doing the one extra step of calculating $\ln(3)$ at the beginning, you save yourself many steps afterwards because it converges quicker. – glowstonetrees Jun 07 '20 at 13:35
  • @glowstonetrees Plus an additional $ln$ at each step, right? – Dávid Laczkó Jun 08 '20 at 15:18
  • @DávidLaczkó Computing $a^b$ usually uses logarithms and an exponential function, so this would actually be one exponential function computed less per iteration. – Simply Beautiful Art Jul 01 '20 at 12:14