# If $a^b=c^d$, then $c$ and $a$ are powers of the same number?

I want to know in which situations two numbers that can be expressed as powers can be equal. I think it's intuitive that if two powers (say $a^b$ and $c^d$) are equal, then the bases must be themselves powers of a single natural number (say $a=m^k$ and $c=m^l$, so that $m^{kb}=m^{ld}$, and $kb=ld$). But I'm having a hard time proving it.

My approach is as follows: I factor $a$ and $c$ into prime factors and write the equation $a^b=c^d$ as: $$\left({p_1}^{a_1} {p_2}^{a_2} \cdots {p_n}^{a_n}\right)^b=\left({p_1}^{c_1} {p_2}^{c_2} \cdots {p_n}^{c_n}\right)^d$$ (where $p_1=2$, $p_2=3$, $p_3=5$, etc are the prime numbers) which turns into the following system: $$a_1 b = c_1 d \\ a_2 b = c_2 d \\ \vdots \\ a_n b = c_n d$$ I want to prove that the vectors $\left[a_1,a_2,\ldots,a_n\right]$ and $\left[c_1,c_2,\ldots,c_n\right]$ are both integer multiples of some other vector. It's ok to assume that the mdc's of boths lists are $1$, because if, say, $\mathrm{mdc}\left\{a_1,a_2,\ldots,a_n\right\}=k>1$, then we could factor out $k$ from the $a_j$'s and incorporate it into $b$ (this is the same as reducing $a^b$ to $m^{kb}$). Assuming that the mdc's are $1$, I want to prove that the vectors for $a$ and $c$ are equal.

I don't where to go from here. I can do it in the case that the mdc's are pairwise $1$, that is, $\mathrm{mdc}\left\{a_1,a_2\right\}=\mathrm{mdc}\left\{a_1,a_3\right\}=\cdots=\mathrm{mdc}\left\{a_{n-1},a_n\right\}=1$, but not in the general case.

Alternatively, we first prove the following claim. To use the claim below, let $$k:=\gcd(b,d)$$. From $$a^b=c^d$$, we have $$a^{\frac{b}k}=c^{\frac{d}k}\,.$$ As $$\gcd\left(\dfrac{b}{k},\dfrac{d}{k}\right)=1$$, by the claim, there exists $$e\in\mathbb{Z}_{>0}$$ such that $$a=e^{\frac{d}k}\text{ and }c=e^{\frac{b}k}\,.$$

Claim Let $$x,y,p,q\in\mathbb{Z}_{>0}$$ be such that $$\gcd(p,q)=1$$ and $$x^p=y^q$$. Then, there exists $$u \in \mathbb{Z}_{>0}$$ such that $$x=u^q$$ and $$y=u^p$$.

Proof. As $$\gcd(p,q)=1$$, there exist $$r,s\in\mathbb{Z}$$ such that $$pr+qs=1$$. Hence, $$x=x^{pr+qs}=x^{pr}x^{qs}=\left(x^p\right)^rx^{qs}=\left(y^q\right)^rx^{qs}=\left(x^sy^r\right)^q\,.$$ Take $$u:=x^sy^r$$, which is a rational number. Then, $$x=u^q$$ and $$y=u^p$$. Since $$x$$ is an integer, $$u$$ must also be an integer (there are multiple ways to show this, the easiest one I know is that $$z=u$$ is a rational root of $$z^q-x$$, and by the Rational Root Theorem, we conclude that $$u\in\mathbb{Z}$$).

You notice the fact about the gcd's (i.e., mdc's) of the numbers $a_i$ and $c_i$. The key here is to notice that $b$ and $d$ can also be assumed relatively prime (if they have gcd equal to $k$, then take the $k$th root of both sides of $a^b = c^d$ to reduce to the case where the exponents are relatively prime.)

Now the key fact is known as Euler's Lemma: if $b$ and $d$ are relatively prime and $b$ divides evenly into $md$, then $b$ is a divisor of $m$.

Assuming this, we find from $a_i b = c_i d$ that $b$ is a divisor of $c_i d$, so by Euler's Lemma is a divisor of $c_i$ for all $i$. Similarly, $d$ is a divisor of $a_i$ for all $i$. Dividing all of the equations $a_i b = c_i d$ by $b$, we find $a_i = e_i d$ for some integers $e_i$. Substituting this into $a_i b = c_i d$ and dividing by $d$, we find as well that $c_i = e_i b$ for all $i$. Thus, the vectors $[a_1, \ldots, a_n]$ and $[b_1, \ldots, b_n]$ are both multiples of $[e_1, \ldots e_n]$.

Let us look case by case

1. Either $b$ divides $d$ ( or $d$ divides $b$, it is similar ) then we get $a_i=\frac{d}{b}c_i$. Thus your claim is satisfied as for vector $v=[c_1,c_2..c_n]$ your vector $a=\frac{d}{b}v$ and $c=v$.
2. $b$ and $d$ are co-primes then $a_i=k_id$ and $c_i=k_ib$ ( here $k_i$ are integers ). Again your claim is satisfied as for vector $v=[k_1,k_2...k_n]$ your vectors $a=dv$ and $c=bv$.
3. Neither divides the other but their gcd is not 1 ( that is they are not co-primes either ). Lets say gcd($b,d$)=$q$. So $\frac{b}{q}$ and $\frac{d}{q}$ are co-primes. Now again this is similar to case 2 as $a_i=k_i\frac{d}{q}$ and $c_i=k_i\frac{b}{q}$ ( similar to case 2 we can find the vector $v=[k_1,k_2...k_n]$ and vectors $a=\frac{d}{q}v$ and $c=\frac{b}{q}v$ ).
As these 3 cases are the only possible cases ( also no two cases can occur at once ) your claim is proved.
Hope it helps.