# X^x = n, value of x?

1. Apr 16, 2010

### Epic Sandwich

This just crossed my mind a while ago after tricking one of my friends that pi^pi = 36 (he's not the fastest).

Anyway, say we say that x^x = 36. Is there any mathematical way to work out the value of x? The only solution I can think of is trial and error, I can't believe that's the only way to do it though!

2. Apr 16, 2010

### CRGreathouse

Lambert's W function works. Numerical methods are usually used; there are plenty that are better than trial and error. The secant method, in particular, is useful here.

Here's Pari's solution to 500 digits:
Code (Text):
> \p500
realprecision = 500 significant digits
> solve(x=1,9,x^x-36)
time = 10 ms.
%1 = 3.1356423938890448229304002435243798685431704626991494623687331920918980549484396260412000567683132168848411846174309842591610927438140351855194492146118312054308539184700182238312099667934923102924766875469711375568451864527307249738059671297357877550674305563183865792744445601224970373805346735988344847987303772917155627939948275878697780269822512410680975751300644967399011559837869483582429262545760441341171144409909232083024706624771222873986622339663191335540682429994265917887874699294499044

3. Apr 16, 2010

### Epic Sandwich

Right, how exactly did it generate that? Is there no way of doing it myself to a reasonable degree of accuracy, or do I have to let a computer do it?

4. Apr 16, 2010

### CRGreathouse

Brent's algorithm, I think.

You can use Newton's method or the secant method by hand. Each step of Newton's method roughly doubles the number of correct digits, so if you start with 3.14 (2 correct digits) you should be able to get to 4 digits in one step, 8 in 2 steps, 16 in 3 steps, etc.

But this is like asking how to calculate a square root or a logarithm by hand. There are methods, but beyond just a few digits most people use a calculator or computer for convenience.

5. Apr 16, 2010

### elect_eng

Very gullible indeed! That's over 1 % error. Engineers won't even accept that anymore.

Next time try telling him pi^3 = 31. Now that's only just over 0.02 % error. You can at least fool the engineers with that one.

6. Apr 16, 2010

### Epic Sandwich

Should have rephrased that, I told him that's how pi was generated and that pi^pi is exactly 36. The sum itself just equalling that wouldn't be a very elaborate prank, haha.