Here is a question on finding the Smith Normal Form of a polynomial matrix Smith normal form of a polynomial matrix
I am wondering why my method is wrong here:
$\begin{bmatrix} x^2&x-1\\ x&x^2 \end{bmatrix}\rightarrow \begin{bmatrix} x&x^2\\ x^2&x-1 \end{bmatrix}\rightarrow \begin{bmatrix} x&0\\ x^2&-x^3(x-1) \end{bmatrix}\rightarrow \begin{bmatrix} x&0\\ 0&-x^3(x-1) \end{bmatrix}$
Obviously $x|-x^3(x-1)$. So why is this wrong?
The answer should be $$\begin{bmatrix} 1&0\\ 0&x^4-x^2+x \end{bmatrix}$$