Finding Smith normal form of matrix over $ \mathbb{R} [ X ]$ I am trying to find the Smith normal form of matrix over $ \mathbb{R} [ X ]$ of the 4x4 matrix
$$M =\begin{pmatrix}
 2X-1 & X & X-1 & 1\\
 X & 0 & 1 & 0 \\
 0 & 1 & X & X\\
1 & X^2 & 0 & 2X-2
\end{pmatrix}$$
I know of two methods for computing the smith normal form of a matrix:
1) Using the algorithm
2) Computing the Fitting Ideals
The first process looks horrible and cumbersome for such a matrix- maybe it all cancels nicely but I have tried and it doesn't appear clean.
The second looks like it might work if the matix behaves 'nicely'- for example it isn't hard to see that $\mathrm{Fit}_1 (M)= \mathrm{Fit}_2 (M)= (1)  $ so we have the first two diagonal elements as 1. However computing the 3x3 sub determinants seems really lengthy and can't see any nice terms like 1 coming out. I could compute the whole 4x4, but again, this seems lengthy and then I'd hope it to not have many factors so I can 'deduce' the 3rd diagonal element, but this seems too hopeful.
Is there some property of the ring/ overall technique I'm missing?
Any help would be appreciated
 A: I don't think using row and column operations is so bad if you have a computer, at least.  (Assuming I didn't make a mistake, of course.)  I computed the Smith normal form using Sage using the following code:
R.<x> = PolynomialRing(QQ,1)
M = matrix(R,[[2*x-1, x, x-1, 1],[x, 0, 1, 0],[0, 1, x, x],[1, x^2, 0, 2*x-2]])
M.swap_rows(0,3)
M.add_multiple_of_row(1,0,-x)
M.add_multiple_of_row(3,0,-(2*x-1))
M.add_multiple_of_column(1,0,-x^2)
M.add_multiple_of_column(3,0,-(2*x-2))
M.swap_rows(1,2)
M.add_multiple_of_column(2,1,-x)
M.add_multiple_of_column(3,1,-x)
M.add_multiple_of_row(2,1,x^3)
M.add_multiple_of_row(3,1,-(-2*x^3+x^2+x))
M.add_multiple_of_column(3,2,-1)
M.add_multiple_of_row(3,2,-2)
M.swap_rows(2,3)
M.swap_columns(2,3)
M.add_multiple_of_row(3,2,2*x)
M.add_multiple_of_row(3,2,-6)
M.rescale_row(3,-1/13)
M.swap_rows(2,3)
M.add_multiple_of_row(3,2,-(x+2))
M.add_multiple_of_column(3,2,-(1/13*x^4 - 4/13*x^3 - 8/13*x^2 + 12/13*x - 19/13))
M.rescale_row(3,-13)
M

In the end, I get
$$
\left(\begin{array}{rrrr}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & x^{5} - 2 x^{4} - 3 x^{3} + 9 x^{2} - 8 x + 1
\end{array}\right) \, .
$$
You can try the code yourself online using the SageMathCell.
A: Since you've done the $1\times 1$ and $2\times 2$ minors ....
The $3\times 3$ minors got by deleting the first row and first column, and first row and last column are pretty obviously $X^3-2X+2$ and $X^5+1$ which are coprime. 
Now take a deep breath and calculate the determinant: it's $X^5-2X^4-3X^3+9X^2-8X+1$. (Thanks to @Quasicoherent.)
But I think that it's usually best to grit one's teeth and do the Gauss eliminations.
