Possible Duplicate:
Prove that $a=b$, where $a$ and $b$ are elements of the integral domain $D$
Something I'm curious about, suppose $a,b$ are elements of an integral domain, such that $a^m=b^m$ and $a^n=b^n$ for $m$ and $n$ coprime positive integers. Does this imply $a=b$?
Since $m,n$ are coprime, I know there exist integers $r$ and $s$ such that $rm+sn=1$. Then $$ a=a^{rm+sn}=a^{rm}a^{sn}=b^{rm}b^{sn}=b^{rm+sn}=b. $$
However, I'm worried that if $r$ or $s$ happen to be negative then $a^{rm}, a^{sn}$, etc may not make sense, and moreover, I don't see where the fact that I'm working in a domain comes into play. How can this be remedied?