In integers the equation x^{y}=y^{x}, where x and y are supposed to be distinct, has a unique solution (2, 4). (This is of course assuming that swapping x and y does give a new solution.

The situation is quite different if we are looking for rational solutions.

Let k = y/x, then also y=kx. Putting this into x^{y}=y^{x} gives

x^{kx}=(kx)^{x} or (x^k)^x=(kx)^x,


x^k=kx, or x^{k-1}=k,

from which we get a general solution:

x=k^{\frac{1}{k-1}}, y=k\cdot k^{\frac{1}{k-1}}=k^{\frac{k}{k-1}}.

From y = kx it follows that if k is irrational then so will be either x or y. So, in order to have them both rational, we have to assume k rational as well. Let \frac{p}{q}=\frac{1}{k-1} be in lowest terms. Then

k-1=\frac{q}{p}, k=\frac{p+q}{p}, \frac{k}{k-1}=\frac{p+q}{q}

so that

x=\big(\frac{p+q}{p}\big)^{p/q}, y=\big(\frac{p+q}{p}\big)^{(p+q)/q}

Since \frac{p}{q} is in lowest terms, p and q are mutually prime. and so are p and p+q. In order that both x and y be rational, it is necessary that both p and p+q be q-th powers of natural numbers. However, p=n^q, with q\ge 2, leads to

n^{q} < p+q < (1+n)^{q} = n^{q}+qn^{q-1}+\ldots

which is only possible when q=1. It follows that all positive rational solutions of the equation x^{y}=y^{x} are given by


x=\big(\frac{p+1}{p}\big)^{p} and y=\big(\frac{p+1}{p}\big)^{p+1},

where p is an arbitrary integer, except 0 and -1.

The behavior of the solutions as p\rightarrow \infty, is determined by the well known limit

\lim_{p\rightarrow \infty}\big(\frac{p+1}{p}\big)^{p} = \lim_{p\rightarrow \infty}\big(1+\frac{1}{p}\big)^{p}=e

and also

\lim_{p\rightarrow \infty}\big(\frac{p+1}{p}\big)^{p+1} = \lim_{p\rightarrow \infty}\big(1+\frac{1}{p}\big)^{p+1}=\lim_{p\rightarrow \infty}\big(1+\frac{1}{p}\big)^{p}\cdot \lim_{p\rightarrow \infty}\big(1+\frac{1}{p}\big)=e

A Little History

This is a famous problem going back to Goldbach and Euler, who proved that (*) are indeed the rational solutions of the equation x^{y}=y^{x}. In 1990, Marta Sved published a short paper where she proved that these are the only solutions. This is how Joe Roberts mentions the equation and its solutions.

Probably, unknown to either Sved or Roberts, the problem has been treated in the (Russian, 1959) Math Circles Library, where it was completely solved, albeit without a reference to either Goldbach or Euler. Naturally, neither Sved nor Roberts mention that Russian publication.


  1. D. O. Shklyarsky, N. N. Chentsov, I. M. Yaglom, Selected Problems and Theorems from Elementary Mathematics, part I - Arithmetic and Algebra, Moscow, Fizmatgiz, 1959 (Problem 114b), in Russian
  2. J. Roberts, Lure of Integers, MAA, 1992, p. 126
  3. M. Sved, On the Rational Solutions of x^{y}=y^{x}, Math Mag 63 (1990) 30-33