$\gcd(a,b)=1, x^a = y^b\Rightarrow x = n^b$, $ y = n^a$ for an integer $n$. If $ a$, $ b$, $ x$, $ y$ are integers greater than $1$ such that $ a$ and $ b$ have no common factor except $1$ and $ x^a = y^b$ show that $ x = n^b$, $ y = n^a$ for some integer $ n$ greater than $1$.
I started this way: $x^a=y^b$ $=>$ $x=y^{b/a}=(y^{1/a})^b$. Thus $x$ is an integer, and so is $y^{1/a}$, so $y=n^a$ for some integer $n$ greater than $1$. Then from the given relation, we get $x=n^b$. 
I am not very convinced with my solution, as I feel I did some mistake. Can anyone point out where the mistake is? Any other solution is also welcome :)

Here is an alternate method. 
Note that set of primes dividing $x$ and $y$ are same. Take any prime $p$ diving $x$(and 
hence $y$), and let $\alpha$ is the maximum power of $p$ in $x$ and $\beta$ is the maximum power of $p$ in $y$. Then $x^a=y^b \implies p^{\alpha a}=p^{\beta b}$, which implies $a|\beta b $ and $b| \alpha a$. But remember that $gcd(a,b)=1$. So, $a|\beta$ and $b|\alpha$. 
Suppose, $\beta= a\cdot \beta_p$ and $\alpha=b\cdot \alpha_p$. Then we have, $\alpha a=\beta b$ or, $b\alpha_pa =a\beta_p b$ or, $\alpha_p=\beta_p$. So, for each prime $p$ diving $x$, we have such $\alpha_p$. Check that $n=\prod_{p|n}p^{\alpha_p}$ satisfies the required property.   
