The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Inventing an Operation to Solve x^x = y

Date: 02/19/2000 at 14:24:08
From: RedSting71
Subject: Solving x^x = y

I saw this problem in a question somewhere on your site. The answer, 
according to the response, was to enter a value for x, see if it 
works, then go down or up, and try again... Say you have the equation:

     x^x = 5

You input 2 for x, and get

     2^2 = 4

So then you try 3, and get

     3^3 = 27

This is useless. The answer is irrational, and it will take a long 
time to solve it. Using natural logs, you get this:

         x^x = 5
     x ln(x) = ln(5)
           x = ln(5)/ln(x)

This doesn't help. Here is what I did to solve it. Multiplication is 
just a form of addition, in that x + x = 2x. Exponentiation is then 
just a form of multiplication, in that x * x = x^2. So, to solve x^x, 
you would need to make a new operation - one above exponentiation, 
like multiplication is above addition. So let x^x = x@2, where "@" is 
the symbol for this new operation, whatever it may be called. We get 

     x^x = 5
     x@2 = 5

To solve, all we have to do is find the inverse of @2. I will use the 
symbol & to signify the inverse operation of @. So we get this:

         x@2 = 5
     (x@2)&2 = 5&2

And 5&2 is the answer. This is not the square root of 5. It would be 
something "above" square roots, like x^x = 5. Is this the only way to 
solve it? Calculators aren't programmed with operations above 
exponentiation, and I'm not sure any exist... Are there other ways to 
solve x^x = 5, or x^x = .5, whether x is real or imaginary or complex? 

Another thing - why is addition commutative, multiplication 
commutative, but not exponentiation? 2^3 is not equal to 3^2, and this 
causes problems. Try to solve:

     2^x = 8

The answer is log(8)/log(2), I know. But log(x) is just 10^y = x, 
where log(x) is y. This also seems stupid. You need a calculator with 
built-in log functions to solve this. All you do is complicate the 
equation 2^x = 8 with log functions. If exponents were commutative, 
you would solve it like this:

     2^x = 8   (so...)
     x^2 = 8
       x = sqrt(8)

But this is not the case. Why?

Date: 02/20/2000 at 07:17:35
From: Doctor Mitteldorf
Subject: Re: Solving x^x = y

Dear Red,

Your note is a breath of fresh air. I wish everyone who came to us put 
as much thought and inventiveness into their encounters with math as 
you do. I'm always preaching that the only way really to learn math is 
to invent it yourself, and here you are doing exactly that.

So I'll happily answer some of your questions, and make some 
suggestions about more conundrums to explore.

Your second question first, about the x^y relation being non-
commutative. Why should it commute? I guess the fact that addition is 
commutative is obvious from the definition. The fact that 
multiplication is commutative isn't so obvious, at least until you 
think of multiplication in terms of counting a two-dimensional n by m 
array. And in advanced math, there are lots of kinds of multiplication 
that don't commute. Have you studied matrix multiplication yet? That's 
the first one that you'll come across. Why would you think x^y should 
equal y^x? Multiplying x*x*x*...*x, a total of y times is very 
different from multiplying y*y*y*...*y a total of x times. It would be 
an unexpected result indeed if you could prove they always had to be 

And your first question: I want you to separate in your mind the 
naming of an operation and the construction of an algorithm for that 
operation. For example, everybody learns that a = log(b) is the 
inverse function for b = 10^a. And there's a button on your calculator 
that will compute log(b) in a moment. But do you have a good feel for 
how the calculator does it? For that matter, it's not really obvious 
how the calculator does 10^a, either. If a is an integer like 3, then 
10^a is just 10*10*10. And if a is a half-integer like 2.5, then it 
can be done with square roots: 10*10*sqrt(10). But how would the 
calculator handle 10^pi?

In order to calculate a/b, the calculator does a lot of trial and 
error, trying different numbers times b until it gets closer and 
closer to a. (That's the same way you do long division by hand.) Does 
the calculator figure logs the same way, trying different a's in 10^a 
until it gets closer and closer to b? This would seem to be a doubly 
long and tedious algorithm, because we just said that calculating 10^a 
is already a trial-and-error algorithm; so doing a separate 10^a each 
time you want to test a new  a  seems really slow. Any thoughts on how 
the calculator does it? Or how you could do it by hand (they're not 
really different)?

Here's an answer that isn't the one the calculator really uses for log 
or 10^x, but it's one that you can always use to invert ANY function. 
Let's say you know if you're given any x how to compute the function 
f(x). And let's say you're given the problem: What x will make 
f(x) = y? This method was invented 350 years ago by Isaac Newton, and 
people still call it "Newton's method." First, you have to guess a 
value of x. (Sometimes it's important that the guess be fairly close, 
but if the function f is very smooth, then the first guess can be way, 
way off and you'll still hone in on the right x quite fast.) Call your 
original guess x0. Calculate f(x0) and see how far it is from y. 
Subtract y-f(x0) to see how far off you are. Unfortunately, this 
doesn't tell you how far off x is but only how far off you are in 

So guess again. Call your second guess x1, and make it pretty close to 
x0. Once again, calculate y-f(x1) to see how far off you are in 

Now comes the trick: We'll look for a proportion between movement in 
x-space and movement in y-space. The amount you moved in x-space was 
x1-x0. The amount you moved in y-space was f(x1)-f(x0). So the ratio 
between the two is

     r = -------------
            x1 - x0

This ratio r tells you, for a given movement in x space, how large you 
expect the corresponding movement in y-space to be. We'll use r to 
construct our third guess, which will be MUCH better than the first 
two guesses. Start with x1. The amount we still need to move in 
y-space is y-f(x1). The ratio of movement in y-space to movement in 
x-space is r. So the amount we need to move in x-space is (y-f(x1))/r. 
Our next guess will be:

     x2 = x1 + (y-f(x1))/r

Why won't this answer be exact? Because r isn't a fixed ratio. It 
changes as you move through x-space. We knew r for the region between 
x0 and x1, but we applied it to the region between x1 and x2, where a 
slightly different r should have been used. Nevertheless, this method 
gets you much closer than you were before.

Now calculate f(x2) to see how close you are, and also as preparation 
for your next guess (x3). You can use x1 and x2 and f(x1) and f(x2) to 
calculate a new r, and then use the new r to calculate 

     x3 = x2 + (y-f(x2))/r

Now that you have the idea, you can calculate x4 and x5 and x6 and 
each one will be closer and closer to the right answer. In fact, this 
method usually closes in very rapidly on the right answer.  If you're 
using a calculator, it may be that by the time you get to x4 you're so 
close to the answer that all of the digits that your calculator can 
display are correct.

There's one more idea I want to leave you with. I've given you a 
general algorithm to invert any function f. I also want to show you a 
way to solve the particular equation x^y = y^x.  (For example, 2^4 = 
4^2.) The first thing to do is to take the 1/y power of both sides. 
Then you have x = y^(x/y). Now take the 1/x power of both sides. You 
get x^(1/x) = y^(1/y). This form has the advantage that the x's are 
all on one side and the y's are all on the other. So you can pick a y, 
calculate y^(1/y) and call this z. How can you find an x so that 
x^(1/x) = z? Answer: Start by taking z^z. Then take z to that power: 
z^(z^z). Then take z to THAT power: z^(z^(z^z))). Keep going as long 
as you like, getting closer and closer to the number x that satisfies 
the equation.

For example, if you took y = 4, you would have

     z = 4^(1/4) = sqrt(2) = 1.414...

Take z^z and you have... well, I think I'll leave you to work this one 
out. Don't take my word for it: Try taking z^(z^(z^z))) as many times 
as you feel like, and see if you get closer and closer to 2.

Why does it work? And what's even more mysterious, why does it 
SOMETIMES work. For example, if you let z = 3, then z^z = 27 and 
z^(z^z) = 7625597484987. Do it one more time and you have more digits 
than can fit in your computer's memory. Clearly this process isn't 
converging for z = 3. But it converged just fine for z = sqrt(2). 
What's the largest z for which the process converges?

I hope you keep inventing and keep sharing the results with us here at 
the Math Forum. Maybe you'll solve some of these puzzles, or better 
still, maybe you'll invent your own. I want to hear from you soon.

- Doctor Mitteldorf, The Math Forum   

Date: 02/22/2000 at 16:16:27
From: RedSting71
Subject: Re: Solving x^x = y

Here is something else:

The "center," as I call it, of addition is 0. To determine the inverse 
of x in addition (which is -x), you do 0 - x. Also, 0 is its own 
additive inverse. Finally, 0 + x is x, and 0 * x = 0.

The "center" of multiplication is 1. To determine the inverse of x in 
multiplication (which is 1/x), you do 1 / x. 1 is also its own 
multiplicative inverse. Finally, 1 * x = x, and x ^ 0 = 1.

What then is the center of exponents? Here is what I figured out about 
exponents. Say you have:

     x / y = x * (1/y)

Because dividing by y is the same as multiplying times y's 
multiplicative inverse, or 1/y, I will call y in this case a 
"multiplicative number". X will be called the "base". In addition:

     x - y = x + (-y)

Y is an "additive number", and X is again the base. The inverse of y 
changes from addition to multiplication. Yet, with exponents/roots, I 

     y-rt(x) = x^(1/y)  

[rt is the radical, and y-rt means 'the yth root'.]

The y inverse has not changed! Thus, I concluded that exponentiation 
is an operation between two different types of numbers: an exponential 
base and a multiplicative number, where the multiplicative number is 
the exponent. What then is the center? There are a few things that 
define the center C of an operation <op>:

<op>       = the operation,
<inv-op>   = the inverse operation (for addition it's subtraction,
                for multiplication it's division),
<above-op> = the next higher order operation (for addition it's multi-
                plication, for multiplication it's exponentiation),
inv(x)     = the inverse of x (for addition it's -x, for multipli-
                cation it's 1/x)

     (1)   x <inv-op> x = C
     (2) x <above-op> 0 = C   
     (3)       C <op> x = x
     (4)   C <inv-op> x = inv(x)
     (5)              C = inv(C)

For addition, 0 is the only one that satisfies all these 5 criteria. 
For multiplication, 1 is the only one (for all numbers besides 0). For 
exponentiation, the story changes.

(1) x-rt(x) - this differs for different x's. The sqrt(2) is not the 
same as the 3-rt(3). But in multiplication, 2/2 = 3/3, and in 
addition, 2-2 = 3-3. So, the center can be thought of as x-rt(x), 
although it doesn't help.

(2) We need an above operation for this. In the previous e-mail, I 
invented one, and used the symbol '@'. However, it was only for the 
purpose of solving x^x. I am not sure what x@0 would be. However, I 
did get this for the formula for @ (take a look to see if it is right 
or not):

     x@y = x^(x^(y-1))

I'm not sure if this is right. If it is, then #2 says the center is 
again x-rt(x).

(3) We say the center is x-rt(x). To satisfy #3, it must be that 
x-rt(x)^x = x, which it does. So, the expression x-rt(x) seems to 
satisfy #3 as well. So far, it seems like it could be the center.

(4) For x's inverse, I will need another variable, y. We already know 

     x-rt(y) = y^(1/x)

We got x's inverse (1/x) not through the use of x-rt(x), but through 
the use of 1. So, x-rt(x) does not satisfy criteria #4! Instead, the 
number 1 does.

5) Is x-rt(x) its own inverse? Let's take a look:

     y^(x-rt(x)) = [x-rt(x)]-rt(y)

Or, does y to the power of the xth root of x equal the xth root of x 
of y? The answer is no. Only 1 satisfies this as well.

We have a problem: x-rt(x) solves criteria #1, #2, and #3, but 1 
satisfies #4 and #5. I would go with x-rt(x) as the center, but then 
#4 and #5 is what determines the exponential inverse - so I believe it 
is 1. What do you think? 

A final note about exponentiation not being commutative. I realize it 
doesn't have to be commutative, but if it were, it would be a whole 
lot easier to work with.

Date: 02/28/2000 at 11:27:31
From: Doctor Mitteldorf
Subject: Re: Solving x^x = y

I'm not sure it's possible to come up with a "center for 
exponentiation" that has all the properties that you want it to have. 
You might have to have a different center depending on whether you're 
looking at the exponent or the base; and you might even have to have 
different centers depending on what the other variable is. One great 
thing about math: you get to make it up. Try out a definition that 
sounds reasonable, and see if you can draw interesting conclusions 
from it. This is the way math is done these days.

>A final note about exponentiation not being commutative. I realize it 
>doesn't have to be commutative, but if it were, it would be a whole 
>lot easier to work with.


- Doctor Mitteldorf, The Math Forum   
Associated Topics:
High School Functions

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.