Finding elementary matrices

linear algebramatrices

So let's consider these matrices $$A=\begin{bmatrix}-1 & 1\\2 & 1\\\end{bmatrix}$$
$$
B =\begin{bmatrix}
1 & 2\\
-1 & 1\\
\end{bmatrix}
$$

And the question is to find the invertible matrix $X$ such that $AX=B$ and express $X$ as a product of 2 elementary matrices.

What I know I tried:
So I do know that you could easily get X by inverting A and multiplying it by B but I need the two elementary matrices so i tried a different solution.

$$(A\cdot E_{1})\cdot E_{2} = B$$

So what I did was to try to make A equal to by elementary row operations and doing the same to another 2 $\times$ 2 identity matrix.

$$\begin{bmatrix}1 & 0\\0 & 1\\\end{bmatrix}\begin{bmatrix}-1 & 1\\2 & 1\\\end{bmatrix}$$

$$R_{1} \iff R_{2}$$

$$\begin{bmatrix}0 & 1\\1 & 0\\\end{bmatrix}\begin{bmatrix}2 & 1\\-1 & 1\\\end{bmatrix}$$

$$R_{1} + R_{2} \implies R_{1} $$

$$\begin{bmatrix}1 & 1\\1 & 0\\\end{bmatrix}\begin{bmatrix}1 & 2\\-1 & 1\\\end{bmatrix}$$

So I was able to arrive to C in two elementary operations like the problem specified. But then when I try to check with my original equation:

$$(A\cdot E_{1})\cdot E_{2} = B $$
$$\begin{pmatrix}\begin{bmatrix}-1 & 1\\2 & 1\\\end{bmatrix}\begin{bmatrix}0 & 1\\1 & 0\\\end{bmatrix}\end{pmatrix}\begin{bmatrix}1& 1\\1 & 0\\\end{bmatrix}$$

It doesn't equal to C. I don't understand what i'm doing wrong? I have tried to do the calculation over and over and I still arrive at the same thing. Where is my mistake here? Is it the process itself?

Best Answer

Try to calculate $A^{-1}B$ and you'll see that the matrix is different from $E_1E_2$ , so because of the inverse of a square matrix is unique (and so $A^{-1}B$ too) your method is wrong.


To solve the problem I would use a property of the traspose matrix, namely :

$$(KA)^T=A^TK^T$$

To use this find the elementary matrices for the system : $$KA^T = B^T$$ with $K=E_2E_1$, and then traspose everything , obtaining :

$$(E_2E_1A^T)^T = (B^T)^T \iff AE_1^TE_2^T = B$$