In an integral domain prove that $a=b$ 
Let R be an integral domain  and $a,b\in R$ are elements satisfying $a^7=b^7$ and $a^{12} = b^{12}$. Prove that $a=b$.

My attempt:-
  Since $R$ is an integral domain, R is commutative. That is all I could conclude...could you please help me out?

If $b=0$ then $a^6=0$ but $R$ is an integral domain, so $a=0=b$
We suppose that $b\neq 0$. Then 
$a^{12}-b^{12}=(a^6-b^6)(a^6+b^6)=0$
but $R$ is an integral domain, so 
$a^6-b^6=0$ or $a^6+b^6=0$
If $a^6=b^6$ then 
$b^7=a^7=aa^6=ab^6$ that implies 
$b^6(b-a)=0$ 
but $b\neq 0$ then $b=a$
Conversely, if $a^6=-b^6$, then 
$b^7=a^7=aa^6=-ab^6$ so
$b^6(b+a)=0$ that means $b=-a$
In this case we get $b^7=a^7=(-1)^7b^7$. Thus
$(-1)^7=1$ that means $2=0$. So your ring must be $\mathbb{Z}/2\mathbb{Z}$ and we have $b=1=a$.
