Let $A$ be a free abelian group with basis $x_1,x_2,x_3$ and let $B$ be a subgroup of A generated by $x_1+x_2+4x_3, 2x_1-x_1+2x_3$. In the group $A/B$ find the order of the coset $(x_1+2x_3)+B$.
How can I find this order? Just so you can reply more directly, I shall find a basis $f_1,f_2,f_3$ such that $d_1\cdot f_1,d_2\cdot f_2,d_3\cdot f_3$ is a basis of $B$ where $d_i|d_{i+1}$.
$Attempt$: so by $Smith$ algorithm, $\begin{pmatrix}1 & 2 \\1 & -1 \\4 & 2 \\\end{pmatrix}$ $\underrightarrow{R_2\to R_2-R_1} \begin{pmatrix}1 & 2 \\0 & -3 \\4 & 2 \\\end{pmatrix}$ $\underrightarrow{R_3\to R_3-4R_1} \begin{pmatrix}1 & 2 \\0 & -3 \\0 & -6 \\\end{pmatrix}$ $\underrightarrow{R_3\to R_3-2R_1} \begin{pmatrix}1 & 2 \\0 & -3 \\0 & 0 \\\end{pmatrix}$ $\underrightarrow{C_2\to C_2-2C_1} \begin{pmatrix}1 & 0 \\0 & -3 \\0 & 0 \\\end{pmatrix}$$\underrightarrow{C_2\to -C_2} \begin{pmatrix}1 & 0 \\0 & 3 \\0 & 0 \\\end{pmatrix}$ and therefore, $d_1=1, \space d_2=3, \space d_3=0.$
Therefore, while $M= \begin{pmatrix}1 & 2 \\1 & -1 \\4 & 2 \\\end{pmatrix}$, there exist $Q,P\in GL_n(\Bbb{Z})$ such that $QMP^{-1}= \begin{pmatrix}1 & 0& 0 \\0 & 3 & 0\\0 & 0 & 0\\\end{pmatrix}$ and $P^{-1}$ columns are a basis of $A$ that fulfills the aforementioned requirements. One way to find $P^{-1}$ is to classify the identity element where the classification is the inverse of the row operations I used above in the opposite direction: from the end to the start: $\begin{pmatrix}1 & 0& 0 \\0 & 1 & 0\\0 & 0 & 1\\\end{pmatrix}$ $\underrightarrow{R_3\to R_3 + 2R_1}\begin{pmatrix}1 & 0& 0 \\0 & 1 & 0\\0 & 2 & 1\\\end{pmatrix}$ $\underrightarrow{R_3\to R_3+4R_1}\begin{pmatrix}1 & 0& 0 \\0 & 1 & 0\\4 & 2 & 1\\\end{pmatrix}$ $\underrightarrow{R_2\to R_2+R_1}\begin{pmatrix}1 & 0& 0 \\1 & 1 & 0\\4 & 2 & 1\\\end{pmatrix}$ $\Rightarrow \{x_1+x_2+4x_3, x_2+2x_3 , x_3\}$ is the desired basis, where $\Rightarrow \{x_1+x_2+4x_3, 3\cdot (x_2+2x_3 )\}$ is a basis of $B$. Furthermore: $A/B\cong \Bbb{Z}_{f_1}\times \Bbb{Z}_{f_2}\times \Bbb{Z}_{f_3}/1\cdot \Bbb{Z}_{f_1}\times 3\cdot \Bbb{Z}_{f_2}\times 0\cdot \Bbb{Z}_{f_3} \cong \Bbb{Z}/\Bbb{Z}\times \Bbb{Z}/3\Bbb{Z}\cong \Bbb{Z}/3\Bbb{Z}$. How shall I continue?
If you stick to the "$QAP^{-1}$ convention" and do things horizontally, then $(Q^{-1})^{\top}$ is what gives you the basis and $P^{-1})^{\top}$ is what gives you the generators. To avoid transposing, take $\begin{pmatrix}1&1&4\\2&-1&-2\end{pmatrix}$.
Using elementary row and column operations and recording them in matrix form, I get that $$QAP^{-1}=\begin{pmatrix}1&0&0\\0&3&0\end{pmatrix}$$
where $Q=\begin{pmatrix}1&0\\-2&1\end{pmatrix}$ and $P=\begin{pmatrix}1&1&4\\0&-1&-2\\0&0&1\end{pmatrix}$, since $P^{-1}=\begin{pmatrix}1&1&-2\\0&-1&2\\0&0&1\end{pmatrix}$.
As it is known, our good generators are now given by $(f_1',f_2')=Q(f_1,f_2)^{\top}$ where $f_1=e_1+e_2+4e_3$ and $f_2=2e_1-e_2+2e_3$, so that $f_1'=f_1$ and $f_2'= -3e_2-6e_3=-3(e_2+2e_3)$.
And our good basis is given by $(e_1',e_2',e_3')=P(e_1,e_2,e_3)^{\top}$, so that $e_1'=f_1'=f_1$ and $e_2'=-e_2-2e_3$ and $f_2'=3e_2'$.
Now $x_1+2x_3=(1,0,2)= (1,1,4)+(0,-1,-2)=e_1'+e_2'$. I say this has order $3$ in the quotient.