Elements as a product of unit and power of element in UFD I'm studying number theory on my own and now I encountered a problem I couldn't solve. Namely

Let $n\geq 1$ be an integer, and let $R$ be a unique factorization domain. Suppose that $a,b$ are coprime elements of $R$ with the property that $ab=c^n$ for some nonzero $c\in R$. Why do there are $r,s\in R$ and unit $u\in R^*$ such that $a=ur^n$ and $b=u^{-1}s^n$?

And does the same proof works in the cases $R=\mathbb Z$ and $R=\mathbb Z[i]$ as those are given separately in the book "Catalan's Conjecture"?
 A: Here is a somewhat detailed account:
Since $R$ is UFD both $a$ and $b$ have unique factorizations into irreducible elements, say $a = p_1 p_2 \cdots p_k$ and $b = q_1 q_2 \cdots q_l$.
But so does $c$, say $c = t_1\cdots t_d$. Then we know that 
$c^n = ab$
so writing out using the factorizations we have
$t_1^n t_2^n \cdots t_d^n = p_1 \cdots p_k q_1 \cdots q_l$.
By the uniqueness of factorizations we then get that $p_1 = ut_i$ for some $i = 1, \dots , d$, where $u$ is some unit. Suppose $p_1 = ut_1$ (if not then just reshuffle the indices). Now since $a$ and $b$ are coprime and since we have just shown that $t_1$ divides $a$, we know that $t_1$ does not divide $b$. So all the rest of the $t_1$'s must divide $a$ as well, i.e. $t_1^n$ divides $a$. This happens for each of the $t_j$'s so we find (with some reshuffling of indices)
$a = ut_1^n \cdots t_j^n$
$b = vt_{j+1}^n \cdots t_d^n$.
Where $u$ and $v$ are units (gotten by multiplying all units together in the above process) Now $u$ and $v$ are inverses as is seen by the fact that $ab = c^n$ so they cancel each other in the product.
As for $R = \mathbb{Z}$ and $R = \mathbb{Z}[i]$, well the above works if $R$ is a UFD. Is this the case for $\mathbb{Z}$ and $\mathbb{Z}[i]$?
A: Theorem $\ $ Let $n\geq 1$ be an integer, and let $R$ be a unique factorization domain. Suppose that $a,b$ are coprime elements of $R$ with the property that $ab=c^n$ for some nonzero $c\in R$. Then there are $r,s\in R$ and unit $u\in R^*$ such that $a=ur^n$ and $b=u^{-1}s^n$
Proof $\ $ By induction on the number $\,k\,$ of prime factors of $c$. If $\,k=0\,$ then $\,c\,$ is a unit, so $\,a,b\,$ are units, so $\,a = a\cdot 1^n,\ b = a^{-1}c^n$ works. Else $\,k\ge 1,\,$ so some prime $\,p\mid c\,$ so $\,p^n\mid c^n\mid ab,\,$ so $\,p^n\mid a\,$ or $\,b\,$ by $\,a,b\,$ coprime. Wlog $\,p^n\mid b,\,$ so canceling $\,p^n$ we get $\,a(b/p^n) = (c/p)^n.\,$ Since $\,c/p\,$ has fewer prime factors than $\,c,\,$ by induction $\, a = ur^n,\ b/p^n = u^{-1} s^n,\,$ so $\,b = u^{-1}(ps)^n.\ \ $ QED
