I am trying to prove the following :

> 
> Let $R$ be a commutative ring with unity, $a,b\in R$; suppose $(a)+(b)$ is principal. Show that $(a)\cap(b)$ is principal.
> (Hint: first look at $R=\mathbb{Z}$ to gain some insight).
> 
> 
> 

In $\mathbb{Z}$ if have $d=\gcd(a,b)$ then $(d)=(a)+(b)$, and if $m=\text{lcm}(a,b)$ then $(m)=(a)\cap(b)$ and $m=\displaystyle\frac{|ab|}{d}$, so my idea is to prove that $(a)\cap(b)=\displaystyle\Big(\frac{ab}{d}\Big)$ holds in $R$.

Since $(a)+(b)=(d)$ is principal we know that $\gcd(a,b)$ exists because:

$c|a,b\iff (a),(b)\subset (c)\iff (d)\subset (c)\iff c|d$.

If $(a)\cap(b)=(m)$ were to be principal then $\text{lcm}(a,b)$ would exist because:

$a,b|n\iff (n)\subset (a)\cap(b)=(m)\iff m|n$.

Now $d|a,b$ so $a,b|\displaystyle\frac{ab}{d}$ and $\displaystyle\Big(\frac{ab}{d}\Big)\subset(a)\cap(b)$. If $n\in(a)\cap(b)$ then $(dn)=((a)+(b))(n)=(an)+(bn)\subset (ab)$.

If $d$ **is not** a zero divisor then $dn\in (ab)\implies n\in\displaystyle\Big(\frac{ab}{d}\Big)$. However if $d$ **is** a zero divisor we cannot draw this conclusion.

**Question**: if $(a)+(b)=(d)$ is principal and $d$ is a zero divisor, can we still have that $(a)\cap(b)$ is principal?

I have seen (very closely) related questions discussed on this site, but they generally assume that $R$ is (at least) a domain. I am wondering if I'm missing something simple or if $R$ being a domain is really necessary and should be added to the statement I'm trying to prove. I've tried to prove this result by generalizing other identities between $\gcd$ and $\text{lcm}$ from $\mathbb{Z}$, but I always end up having to assume that $d$ is not a zero divisor to end the proof.