Let be D a unique factorization domain, k in D and $x=kd $ with $d$ a gcd of $a, b$ and $y$ a gcd of $ka, kb$ prove that x and y are associates; x divides y and y divides x. My attempt:
x=kd and a=dr, b=ds hence ka=kdr, kb=kds so ka=xr, kb=xs hence x divides y because y is gcd of ka and kb.
How to prove that y divides x?