Something not looking obvious in solving equation $x^y=y^x$ for rational $x$ and $y$. This is a very popular problem (I believe, its Question 666 by Ramanujan):
Solve in positive rational numbers  $x^y=y^x$.
There are quite a few sites and videos about solving this equation, but at any time I find something taken for granted, that doesn't look obvious to me.
Typically the solution looks like the following:
Let $x$,  $y$ be the rational numbers, satisfying the equation and $y>x$ (case $y=x$ is trivial and disregarded). Then $q=\frac{y}{x}$ is also a rational number and $q>1$.
Substituting $y=qx$ into the equation, gives:  $x^{qx}=(qx)^x$. Then we raise both sides into power $\frac{1}{x}$, solve for $x$ and get $y$ as $qx$. The result is:
$$
x=q^\frac{1}{q-1}, \qquad y=q^\frac{q}{q-1}
$$
No questions so far.
Now, assume $k=\frac{1}{q-1}$. Since $q>1$,  $k$ is positive. Also  $q=\frac{k+1}{k}$.  Now, the solution can be rewritten in terms of $k$:
$$
x=\left(\frac{k+1}{k}\right)^k, \qquad y=\left(\frac{k+1}{k}\right)^{k+1},
$$
where $k$ is an integer (???).
From where it follows, that $k$ must be an integer? Mere examples $4^\frac{1}{2}=2$,   or $\left(\frac{1}{4}\right)^\frac{1}{2}=\frac{1}{2}$   show, that $a^r$ may be rational, even if $r$ is fractional. I guess there is something to do specifically with $\left(\frac{k+1}{k}\right)^k$, however, despite my best effort, I couldn't find a way to prove that.
 A: For the sake of contradiction, suppose $k>0$ is not an integer. Then $k=\frac st$, where $s$ and $t$ are positive integers, $\gcd(s, t)=1$ and $t>1$.
Let $x=\frac pq$, where $p$ and $q$ are positive integers, $\gcd(p,q)=1$.
We have
$$
\frac pq=x=\left(\frac{k+1}{k}\right)^k=\left(\frac{s+t}s\right)^{\frac st}
$$
$$
\frac {p^t}{q^t}=\frac{(s+t)^s}{s^s}
$$
Note that $\gcd(s+t,s)=\gcd(t,s)=1$.
Since the fractions on both sides are reduced fractions, we have $p^t=(s+t)^s$ and $q^t=s^s$.
Since $\gcd(s,t)=1$ and $(s+t)^s$ is a $t$-th power of an integer, $s+t$ must be a $t$-th power of an integer as well.
Since $\gcd(s,t)=1$ and $s^s$ is a $t$-th power of an integer, $s$ must be a $t$-th power of an integer as well.
However, $t=(s+t)-s$. That cannot be true since the difference between any two positive $t$-th powers of integers is greater than $t$ when integer $t>1$.
We have reached a contradiction.
A: This is not exactly an answer, but relates to some related thoughts.
An implicit plot of two variable function product reveals the "factors"  just as $x^2-y^2$  displays factor graphs for $x-y,x+y.$
The plot of
$$ \frac{x^x-y^y}{x-y}$$
shows a factor $ (x-y)$ alright but shows one second "transcendental" non-polynomial factor selected by the software.
This is because it is not a single variable  to isolate  the second factor by use of L'Hospital's Rule. Depending on direction we can have any second factor, which cannot be unique.
ContourPlot[x^x-y^y==0,{x,-2,2},{y,-2,2},PlotLabel->"x power x minus y power y FACTORS ",GridLines->Automatic,AspectRatio->1,ContourStyle->{Red,Thick},PlotRange->All]
slope[u_]=u^u(1+Log[u]);
g1=ContourPlot[( slope[x]+slope[y])/2==0,{x,-2,2},{y,-2,2},PlotLabel->"FACTOR1",GridLines->Automatic,AspectRatio->1,PlotStyle->{Purple,Thick},PlotRange->All];
g2=ContourPlot[( slope[x]-slope[y])/10^-8==0,{x,-2,2},{y,-2,2},PlotLabel->"FACTOR2STRAIGHT_LINE",GridLines->Automatic,AspectRatio->1,PlotRange->All];
Show[{g1,g2},PlotRange->All]


Two cases with factor weightages $ (1+1, 1-1)$ are attempted. They give the implicit straight line factor $x-y$ and another "factor" looking like a rectangular hyperbola  bounded in range/domain $(0,\pm 2)$ that is by no means unique., i.e.,
by choosing curve direction in $x-y$ plane several "factors" can be obtained and plotted.
It is of interest to find the choice made by Mathematica.
