# How to solve this $p^q = q^p$ without logarithms [duplicate]

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

I have found $2^4 = 4^2$ by trial and error,

What is the general solution? I have no idea of where to start.

-

## marked as duplicate by JavaMan, lhf, Ross Millikan, William, AangSep 27 '12 at 9:12

type it into wolfram alpha and then learn about the en.wikipedia.org/wiki/Lambert_W_function – binn Sep 26 '12 at 4:05
@robjohn how did you find that, sorry that it is a duplication. – yiyi Sep 26 '12 at 7:22
I had answered Determine the number of solutions of the equation $n^m = m^n$ and that is commented to be a duplicate of $x^y = y^x$ for integers $x$ and $y$ – robjohn Sep 26 '12 at 7:53

You have found the only solution in integers except $p=q.$ For rationals, let $p=\frac ab, q=\frac cd$, both in lowest terms. Now use the laws of exponents and you will find a one dimensional set of solutions. Continuity extends this to the reals.

Added: You want $\left(\frac ab\right)^{\frac cd}=\left(\frac cd\right)^{\frac ab}$. Think about the primes that might divide $a,b,c,d$

-
Could you explain that a more. – yiyi Sep 26 '12 at 4:15

For the case when $q/p$ is rational, let $q/p = r$, so $q = p r$. Substituting this in $p^q = q^r$, $p ^ {pr} = (pr)^p$ so, taking the $p$-th root, $p^r = pr$ sp $p^{r-1} = r$ or $p = r^{1/(r-1)}$ and $q = p r = r^{r/(r-1)}$.

If $r = 2$, $p = 2$ and $q = 4$.

If $r = 3$, $p = 3^{1/2}$ and $q = 3^{3/2}$.

If $1/(r-1) = n$, where $n$ is an integer, $r = 1+1/n = (n+1)/n$ so $r/(r-1) = n+1$ and $p = ((n+1)/n)^n$ and $q = ((n+1)/n)^{n+1}$.

Note: This is definitely not original with me.

That's all for now.

-