if $\displaystyle gcd(a,r) = d$ and $\displaystyle gcd(b,r) = 1$, then $\displaystyle gcd(ab,r) = d$.

$\displaystyle d|a, \ d|r, \ 1|b, \ 1|r$

By multiplying, we have d|ab and we are giving d|r.

So d is a divisor of ab and r. How can I show d is the greatest?

I tried contradiction assuming $\displaystyle c = gcd(ab,r)$ but not sure where to go with that.