In an Integral Domain is it true that $\gcd(ac,ab) = a\gcd(c,b)$?

In my algebra class I was given as homework assignment to prove that:

Given an integral domain $A$ and $a,b,c,d,e \in A$. Then if $d = \gcd(b,c)$ and $e = \gcd(ac, ab)$ then $e = ad$.

It is easy to see that $ad \mid ab$ and $ad \mid ac$, so this implies that $\exists q \in A; e = q(ad)$. Now I'm having problems showing that $q = 1_A$. Working through some equalities, I proved that $\forall n\in \mathbb{N}, q^n \mid d$ so this gives me the light suspicion that I might be going the right way, but I'm pretty positive that this does not imply $q = 1_A$.

Does anyone want to give me a hint?

Thanks in advance :)


Here's a solution:

Set $\;b=b'd$, $\;c=c'd\;\;$ ($b'\wedge c'=1$), $\;ab=\beta e$, $\;ac=\gamma e\;\;$ ($\beta\wedge\gamma=1$). We have: \begin{align*} q\beta e&=qab=qadb'=eb',\\ q\gamma e& =qac=qadc'=ec', \end{align*} whence, since $A$ is a domain, $\;b'=q\beta,\enspace c'=q\gamma$. As $b'\wedge c'=1$, these relations imply $q$ is a unit.