Finding S,T in matrix equivalence problem So guys I could really need some help finding the two matrices S,T.  I seem to have some problems getting all the elemantary row,colmun opperations done to get the result. Maybe there is also an easier way of finding S,T. Anything can help. 
The rank of the matrix A over the field $\mathbb{Q}(x)$ is 2. Find the matrices $S,T \in GL_{4}(\mathbb{Q}(X))$ 
$$A = \begin{pmatrix}
1  & x & 0 & -x \\ 
x+1 &0  &-x  &x^2 \\ 
2x+1 &x^2  &-x  &0 \\ 
 1& -x^2 &-x  &2x^2 
\end{pmatrix}$$
so that 
$$
SAT = \begin{pmatrix} \
1 & 0 &0  & 0\\ 
0 & 1 &0  &0 \\  
 0& 0 & 0 & 0\\ 
0 & 0 &0  &0 
 \end{pmatrix} 
 \in\ GL_{4}(\mathbb{Q}(X))
$$
 A: This problem comes down to finding appropriate bases for the domain (input) and codomain (output). Recall that the columns of a transformation matrix are the images of the domain basis vectors. The last two columns are zero, so the last two basis vectors for the domain must be elements of the kernel. We can choose the other two freely. The matrix $T$ will have these vectors for its columns so that $AT$ will be the matrix of their images.  
Turning now to the output, we see that the first two basis vectors must be the images of the first two input basis vectors. The other two can again be chosen freely. (In fact, this choice is irrelevant to the form of the resulting matrix since the last two columns of $AT$ are zero.) This matrix converts from the standard basis to this basis, so these vectors form the columns of $S^{-1}$.  
We begin by row-reducing $A$ to find a basis for its kernel. In order to keep the expressions relatively simple and so reduce the chance of making an error, I recommend waiting to normalize pivots to $1$ as long as possible. After a bit of work, we reach $$\pmatrix{1&x&0&-x\\0&-x^2-x&-x&2x^2+x\\0&0&0&0\\0&0&0&0}.$$ Divide the second row by $-x$ to get $$\pmatrix{1&x&0&-x\\0&x+1&1&-(2x+1)\\0&0&0&0\\0&0&0&0},$$ at which point we can stop. The rank of the matrix is indeed two, and the isolated $1$’s in each non-zero row allow us to determine the kernel: it consists of vectors of the form $((d-b)x,b,(2x+1)d-(x+1)b,d)^T$, with basis $(x,-1,x+1,0)^T$ and $(x,0,2x+1,1)^T$.  
We could’ve also found the kernel directly by multiplying $A$ by $(a,b,c,d)^T$ and setting the result to zero, producing the equations $$\begin{align}(b-d)x+a&=0\\dx^2+ax-cx+a&=0\\bx^2+(2a-c)x+a&=0\\(2d-b)x^2-cx+a&=0.\end{align}$$ The first equation gives us $a=(d-b)x$ and substituting this back into the system will give us the other dependency found in the previous paragraph. An obvious and convenient choice for our other two basis vectors is $(1,0,0,0)^T$ and $(0,0,1,0)^T$, so we have $$T=\pmatrix{1&0&x&x\\0&0&-1&0\\0&1&x+1&2x+1\\0&0&0&1}.$$  
With this choice of basis vectors we can immediately write down the first two vectors of the output basis, which are also the first two columns of $S^{-1}$: they are simply the first and third columns of $A$. We can take for the last two columns the corresponding columns of the identity matrix. To find $S$, augment the resulting matrix with the identity and row-reduce, leaving pivots unnormalized at first: $$\left(\begin{array}{cccc|cccc}1&0&0&0 & 1&0&0&0\\x+1&-x&0&0 & 0&1&0&0\\2x+1&-x&1&0 & 0&0&1&0\\1&-x&0&1 & 0&0&0&1\end{array}\right)\to\left(\begin{array}{cccc|cccc}1&0&0&0 & 1&0&0&0\\0&-x&0&0 & -(x+1)&1&0&0\\0&0&1&0 & -x&-1&1&0\\0&0&0&1 & x&-1&0&1\end{array}\right).$$ Divide the second row by $-x$ to obtain $$S=\pmatrix{1&0&0&0\\1+\frac1x&-\frac1x&0&0\\-x&-1&1&0\\x&-1&0&1}.$$
