Trouble in understanding a proof of a theorem related to UFD. Theorem :
In a UFD $R$, for any $a,b \neq 0$ prove that $ab \sim \gcd (a,b) . \operatorname{lcm} (a,b)$.
Proof : Let $d$ be a gcd of $a$ and $b$ respectively. Let $a = dx$ and $b = dy$.We show that $c = dxy$ is the lcm of $a$ and $b$.Clearly $a|c$ and $b|c$.Let $u \in R$ such that $a|u$ and $b|u$.Then $dx|u$ and since $y|b$, we also have $y|u$.Thus $c = dxy | u$. Therefore $c$ is a lcm of $a$ and $b$.
Now $ab = dx . dy = d^2 xy = dc$. Also since any two gcds are associates and the same is true for lcms, we have $ab \sim \gcd (a,b) . \operatorname{lcm} (a,b)$ as required.
But I fail to understand the logic that why $dx|u$ and $y|u$ $\implies dxy|u$?I think it should be $dxy | u^{2}$.Would anybody please help me understanding this concept.Then it will help me a lot.
Thank you in advance.
 A: There is an inexactness in the proof provided that is causing your confusion. Although the intent of the proof is correct, it doesn't explain why it's true. I shall provide a proof showing the omitted details, beginning with a lemma.

Lemma: For all $a,m,n\in R$ where $R$ is a UFD with $GCD(m,n)=1$, we have that $m|a\land n|a\Rightarrow mn|a$
Proof:  By assumption $\exists k,\ell$ such that $mk=n\ell=a$. We wish to show that $m|\ell$, because if we do we are done. We know that $m|n\ell$, and then apply that in a UFD we have that $GCD(x,y)=1\Rightarrow (x|yz\Rightarrow x|z)$ holds for all $x,y,z$. This second fact follows by simply considering the prime factorizations of the three terms and observing that since $x$ and $y$ are relatively prime, they cannot have any common prime factors, so all prime factors of $x$ are prime factors of $z$ and so $x|z$.

Now we are ready to prove the theorem. Let $d$ be the GCD, $a=dx,b=dy$, and $c=dxy$ as the proof in the OP says. Notice that $GCD(x,y)=1$. Let $u$ be some common multiple of $a$ and $b$. Now, from our lemma we have that $xy|u$, but we don't immediately have that $dxy|u$ as the proof in the OP claims. To see that this is in fact true, consider the prime factorization of $d$. Let $\alpha$ be the product of the prime factors of $d$ that don't divide $y$ and let $\beta$ be the ones that do. Since none of the prime factors of $\alpha$ divide $y$, we have that $GCD(\alpha x, y)=1$. Now, if any of the factors of $d$ divided both $x$ and $y$, then $x$ and $y$ wouldn't be relatively prime, so none of the prime factors of $\beta$ divide $x$. Therefore $GCD(\alpha x,\beta y)=1$ and so we can apply the lemma to find out that $\alpha x\beta y|u$. But $\alpha x\beta y=dxy$ so we are done.
