# Solve $x^y \, = \, y^x$ [duplicate]

Possible Duplicate:
$x^y = y^x$ for integers $x$ and $y$

I obtained a question asking for how to solve $\large x^y = y^x$. The given restraints was that $x$ and $y$ were both positive integers. By a bit of error an trial we quickly see that $x=2$ and $y=4$ is one solution.

• My question is: How do one show that $(2\,,\,4)$ is the only non trivial, positive solution to the equation?

Now my initial approach was as follows: We have

$$\large x^y = y^x$$

The trivial solution is obviously when $y=x$, so let us focus on when $y \neq x$. Let us make a more general statement. Firstly I take the log of both sides

$$\large y \log x = x \log y$$

Let us divide by x and \log x (We now assume $x\neq 0$ and $x\neq 1$ since 0 is not a positive number, and 1 gives us a trivial solution)

$$\large \frac{y}{x} = \frac{\log y }{\log x}$$

For these sides to be equal, we must remove the logarithms on the right hand side, this is achived if $y$ is on the form $x^a$. Now This gives

$$\large \frac{x^a}{x} = \frac{\log \left(x^a\right) }{\log(x)}$$

$$\large x^{a-1} = a$$

So finaly we obtain that $\displaystyle \large x=\sqrt[ a-1]{a}$ and $\displaystyle \large y = \sqrt[a-1]{a^a}$

Now setting $a=2$ gives us $x = 2$ and $y=4$ as desired.

My question is, how do we prove that $x=2$ and $y=4$ is the only integer solutions? My thought was to show that $\displaystyle \large \sqrt[ a-1]{a}$ and $\displaystyle \large \sqrt[a-1]{a^a}$ are both irrational when a>2, but I have not been able to show this.

Any help is greatly appreciated, cheers =)

-

## marked as duplicate by Aryabhata, Zev ChonolesFeb 28 '12 at 21:03

This MO thread is relevant, mathoverflow.net/questions/22230/ab-ba-when-a-is-not-equal-to-b – user1729 Feb 28 '12 at 16:21
@user1729: Don't like searching MSE itself? :-) – Aryabhata Feb 28 '12 at 19:04
$1729 = 10^3 + 9^3 = 12^3 + 1^3.$ – Will Jagy Feb 28 '12 at 20:53
I've closed the question as a duplicate. There is the option of merging the questions, which will move all answers here to the other question (N3buchadnezzar gets to keep the reputation received from asking this question). Is anyone against doing so? – Zev Chonoles Feb 28 '12 at 21:05
@Aryabhata: No, it was just that the question I linked to popped to the top of the MO stack last week, and I was surprised to find an almost identical question here less than a week later! (Almost identical? Perhaps "intricately related" would be better. Certainly, the answers answer a more general question: when are the solutions rational. Also, the discussion is very interesting.) – user1729 Feb 29 '12 at 9:46

The function $u:x\mapsto(\log x)/x$ is increasing on $[1,\mathrm e]$ from $u(1)=0$ to $u(\mathrm e)=1/\mathrm e$, and decreasing on $[\mathrm e,+\infty)$ from $u(\mathrm e)=1/\mathrm e$ to $0$. Hence, if $u(x)=u(y)$ with $y\gt x\geqslant 1$, then $y\gt \mathrm e\gt x\gt1$. Since $\mathrm e\lt3$, this implies that $1\lt x\lt3$. If furthermore $x$ is an integer, then $x=2$. The unique root of the equation $u(y)=(\log2)/2$ such that $y\gt\mathrm e$ is $y=4$. Hence $(x,y)=(2,4)$ is the unique solution.

-

I thought this sounded familiar. The equation $a^b = b^a$ can be written as $$\frac{\log a}{a} = \frac{\log b}{b}$$ If you carefully draw the curve $y= \log x$ in the $x-y$ plane, the quantity $\frac{\log a}{a}$ is the slope of the line that passes through the origin and the point $(a, \log a).$ So the equation $\frac{\log a}{a} = \frac{\log b}{b}$ says that the lines from the origin to $(a, \log a)$ and to $(b, \log b)$ have the same slope, therefore they are the same line. That is, the three points are collinear.

So, a graphical solution is to draw lines through the origin, with positive slope, that intersect the curve $y= \log x.$ It will be seen fairly quickly that one intersection point, call it $a,$ has $1 < a < e.$ As you want $a$ an integer, the only choice is $a=2.$

The calculus part is this: the line through the origin with slope $\frac{1}{e}$ is tangent to the curve $y= \log x$ at the point $(e, \log e \; = \; 1).$ To intersect the curve twice, we need slope a little bit less that that, and the first intersection point will be a little bit to the left of $e.$

-

Another approach for these kind of problems:

$$x^y=y^x$$

By dividing both sides of equations by $x^x$, we'll have:

$$x^{y-x}=(\frac{y}{x})^x$$

Now, what you can say about $\frac{y}{x}$ ?

Try to continue.

-
I have no idea what we can say about that fraction. Care to explain? – Pureferret Feb 28 '12 at 20:59
y/x must be integer.(Why?) – Salech Alhasov Feb 28 '12 at 21:38