Find the rank and the elementary divisors of an abelian group. Let $G$ be a finitely generated abelian group with four generators $x_1, x_2, x_3$ and $x_4$ satisfying the following relations:
$x_{1}^{4}x_{2}^{4}x_{3}^{6}x_{4}^{8}=e$
$x_{1}^{2}x_{2}^{4}x_{3}^{6}x_{4}^{12}=e$
How can I compute the rank and the elementary divisors of $G$?
So far, I have that $x_{1}=x_{4}^{2}$, but I don't know how to proceed.
 A: Writing your group additively, the relations are
\begin{align}
4x_1 + 4x_2 + 6x_3 + 8x_4 = 0 \\
2x_1 + 4x_2 + 6x_3 + 12x_4 = 0.
\end{align}
This means that your group $G$ is the cokernel of the following map
$$\Bbb Z^2 \xrightarrow{\begin{bmatrix} 4 & 2 \\ 4 & 4 \\ 6 & 6 \\ 8 & 12 \end{bmatrix}} \Bbb Z^4.$$
(That is, if $\varphi$ denotes the above map, then $G \cong \Bbb Z^4/\operatorname{image}(\varphi)$.)
Now, check that doing row or column operations does not change the cokernel.
$$\begin{bmatrix} 4 & 2 \\ 4 & 4 \\ 6 & 6 \\ 8 & 12 \end{bmatrix}\rightsquigarrow \begin{bmatrix} 4 & 2 \\ 4 & 4 \\ 2 & 2 \\ 8 & 12 \end{bmatrix}\rightsquigarrow \begin{bmatrix} 4 & 2 \\ 0 & 0 \\ 2 & 2 \\ 8 & 12 \end{bmatrix}\rightsquigarrow \begin{bmatrix} 2 & 0 \\ 0 & 0 \\ 2 & 2 \\ 8 & 12 \end{bmatrix}$$
$$\rightsquigarrow \begin{bmatrix} 2 & 0 \\ 0 & 0 \\ 0 & 2 \\ 8 & 12 \end{bmatrix} \rightsquigarrow \begin{bmatrix} 2 & 0 \\ 0 & 0 \\ 0 & 2 \\ 0 & 0 \end{bmatrix} \rightsquigarrow \begin{bmatrix} 2 & 0 \\ 0 & 2 \\ 0 & 0 \\ 0 & 0 \end{bmatrix}$$
Thus, your group is isomorphic to $\Bbb Z^{\oplus 2} \oplus \Bbb Z/2 \oplus \Bbb Z/2$.

This was somewhat ad-hoc. A more detailed exposition of this algorithm can be found in Abstract Algebra by Dummit and Foote around p. 480.
