How to compute $(\mathbb{Z}\oplus\mathbb{Z}/d\mathbb{Z})/\langle(a,b+d\mathbb{Z})\rangle$? The following problem astounded me, because I really thought it shouldn't be that hard, but somehow I can't wrap my head around it.
Let $A=\mathbb{Z}\oplus\mathbb{Z}/d\mathbb{Z}$ for some $d\in\mathbb{N}$, as well as $(a,b+d\mathbb{Z})\in A$. Then what is $A/\langle(a,b+d\mathbb{Z})\rangle$?
I tried to find necessary and sufficient conditions in terms of some modular equations for $(x,y+d\mathbb{Z})$ to be in $\langle(a,b+d\mathbb{Z})\rangle$, which of course would give the result by the first isomorphism theorem. One way of doing this would be to use the observation that $(x,y+d\mathbb{Z})\in\langle(a,b+d\mathbb{Z})\rangle$ if and only if $a|x$ and $ad|bx-ay$, which gives that $A/\langle(a,b+d\mathbb{Z})\rangle$ is isomorphic to the image of $A$ under $(x,y+d\mathbb{Z})\mapsto(x+a\mathbb{Z},bx-ay+ad\mathbb{Z})$, but then I'm stuck at calculating this image.
 A: The following method applies to any quotient of a finitely generated abelian group.
Call $I=\langle(a,b+d\mathbb{Z})\rangle.$  The quotient $A/I$ can be represented in matrix form as $\left(\matrix{a&b\\0&d}\right)$, which is to be read as "$A/I$ is the abelian group generated by $x$ and $y$ subject to the two relations $ax+by=0$ and $dy=0$.
With this point of view, realize that 


*

*$\Bbb Z$-invertible row operations correspond to changes of variables on the space of relators, and have no effect on the group described.

*$\Bbb Z$-invertible column operations correspond to changes of variables on the space of generators, and have no effect either on the group up to isomorphism, but in this case you need to keep track of the changes realized if you wish to express the generators in the end in terms of the original generators that you started with.


Now, follow the recipe:


*

*Compute the $\gcd$ of $a$, $b$, $d$ (call it $c$).

*Use row and column operations so that $c$ becomes one of the entries.

*Use row and column operations to replace every entry in the same row and column as $c$ with a $0$.

*You end up either with $\left(\matrix{c&0\\0&0}\right)$ and your quotient group is $\Bbb Z/c\Bbb Z\oplus \Bbb Z$ (happens when $a=0$), or  with $\left(\matrix{c&0\\0&c'}\right)$ for some $c'$ and your quotient group is $\Bbb Z/c\Bbb Z\oplus \Bbb Z/c'\Bbb Z$.


However, to identify the generators of these factors in the end (in terms of the generators of the initial factors), you need to keep track of the changes of variables performed during column operations.

Note: in the general case, at step 4. you end up with  $\left(\matrix{c&0\\0&M}\right)$ with some submatrix $M$. At this point a factor $\Bbb Z/c\Bbb Z$ splits out and you can start over with $M$.
