Let $I$ be an ideal of $R$, a commutative ring with identity. For an element $a\in R$, the ideal generated by the set $I\cup\{a\}$ is denoted by $(I,a)$. Assuming that $a\notin I$, it can be shown that \begin{equation} (I,a)=\{i+ra\;|\;i\in I, r\in R\}. \end{equation}
The problem I have to solve is the following:
In the ring $\mathbb{Z}$ of integers consider the principal ideals $(n)$ and $(m)$ generated by the integers $n$ and $m$. Using the notation introduced above, verify that \begin{equation} ((n),m)=((m),n)=(n)+(m)=(n,m)=(d), \end{equation} where $d$ is the greatest common divisor of $n$ and $m$.
Now, for the first of the four equalities: \begin{equation} \begin{split} ((n),m)=&\{i+rm\;|\;i\in(n), r\in\mathbb{Z}\}\\ =&\{an+rm\;|\;a\in\mathbb{Z}, r\in\mathbb{Z}\}\\ =&\{rm+am\;|\;r\in\mathbb{Z}, a\in\mathbb{Z}\}\\ =&\{j+an\;|\;j\in (m),a\in\mathbb{Z}\}\\ =&((m),n). \end{split} \end{equation} Is it correct?
For the other equalities, how could I proceed? Thanks!
The second line of your equalities corresponds to the definition of the ideal $(n,m)$. For me, the equality $(n)+(m)=(n,m)$ is obvious.
In the last equality (specific to $\mathbf Z$, or more generally to P.I.D.s, $(n,m)\subset (d)$ since clearly, $(n), (m)\subset (d)$. For the reverse inclusion, use Bézout's identity.