2

In a case such as $x^x=27$ we can solve by inspection that $x=3$.

But how can we solve this algorithmically in general, given that $N\in Q$ where $Q\subset\Bbb Z$ and $Q=[1,10^{10}]$ and $x\in\Bbb R$?

lqhcpsgbl
  • 123
  • My first instinct will be to take $\log$ both sides. – AvZ Feb 28 '15 at 08:51
  • 1
    Using Taylor's approximation of $x \ln x$ might help. – Gonate Feb 28 '15 at 09:00
  • 1
    If you like some exploring of this, you might have fun reading the article "wexzal" (written in the 90'ies I think) and possibly only accessible via archive.org. When I read it first, it made me really curious. (If you've difficulties to find it online, I've an early copy of it) P.s. another nice treatize on this subject is the "x^x-spindle" which analyzes the behave of the function using a graphical representation. – Gottfried Helms Feb 28 '15 at 09:06
  • @GottfriedHelms. Could I get a copy of it ? My e-mail address is in my profile. Thanks. – Claude Leibovici Feb 28 '15 at 09:10
  • @GottfriedHelms I want to learn more about it, can I get a copy of the paper, please? My e-mail address is in my profile,too. Thanks. – lqhcpsgbl Feb 28 '15 at 09:36
  • @zoosuck: didn't find your email adress. But I've put it on my website some time ago. See http://go.helms-net.de/math/divers/WexZal.pdf (It was a pure ascii-file, so it is not formatted) – Gottfried Helms Feb 28 '15 at 09:48
  • @GottfriedHelms Thanks a lot! – lqhcpsgbl Feb 28 '15 at 14:35

2 Answers2

3

To find $x$, you have to solve the equation

$$x\ln(x) = \ln(N)$$

This equation does not have a closed form solution using only the functions we usually use. However, using Lambert's function, which is the inverse of the function $$x\mapsto x\ln x,$$ you can still express the solution exactly, since $W(\ln N) = W(x\ln x)=x$

5xum
  • 123,496
  • 6
  • 128
  • 204
2

Newton's method has the fastest convergence that I know of.

For solving 0 = f(x)

The idea is to

1.) guess a solution $x_0$

2.) put it into the function you want to find the zero solution of (ie: calculate $f(x_0)$ )

3.) calculate the derivative at that point $f'(x_0)$

4.) Use this information to find the equation of a straight line with slope $f'(x_0)$ and passing through $f(x_0)$

5.) find where this line hits zero

6.) use this as your next guess for x

Which ends up being $x_0 - (f(x_0)/f'(x_0))$

Repeat this over and over.

So you end up iterating

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

in our case $f(x) = x^x -27$

since we want to know when this is zero

or

f(x) = x^x - c

if you prefer

See here for finding the derivative of $x^x$

So the final iteration scheme will be

$x_{n+1} = x_n -[\frac{{x_n}^{x_n} - C}{ln(x_n + 1){x_n}^{x_n}}]$

sav
  • 1,032
  • 5
  • 12
  • check out http://www.wolframalpha.com/input/?i=x^x you can see that on the domain x >= 1, x^x is a monotonically increasing function. This is ideal for using newton's method. The interesting stuff happens when x < 0, then imaginary numbers get involved ... but perhaps that's another story – sav Mar 01 '15 at 03:11
  • The Lambert's function is a really interesting idea, computing a result from it boils down to newton's method as well http://en.wikipedia.org/wiki/Lambert_W_function#Numerical_evaluation – sav Mar 01 '15 at 03:13