Express the following invertible matrix A as a product of elementary matrices

The idea is to row-reduce the matrix to its reduced row echelon form, keeping track of each individual row operation.

Call the original matrix $A$.

Step 1. Switch $\operatorname{Row}_1$ and $\operatorname{Row}_2$. This corresponds to multiplying $A$ on the left by the elementary matrix $$ E_1= \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix} $$ and the result is $$ E_1A= \begin{pmatrix} -1 & 0 & 0 \\ 6 & 6 & -2 \\ -1 & 1 & 0 \end{pmatrix} $$

Step 2. Multiply $\operatorname{Row}_1$ by $-1$. This corresponds to multiplying $E_1A$ on the left by the elementary matrix $$ E_2= \begin{pmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} $$ and the result is $$ E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 6 & 6 & -2 \\ -1 & 1 & 0 \end{pmatrix} $$

Step 3. Subtract $6\cdot\operatorname{Row}_1$ from $\operatorname{Row}_2$. This corresponds to multiplying $E_2E_1A$ on the left by the elementary matrix $$ E_3 \begin{pmatrix} 1 & 0 & 0 \\ -6 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} $$ and the result is $$ E_3E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 6 & -2 \\ -1 & 1 & 0 \end{pmatrix} $$

Step 4. Multiply $\operatorname{Row}_2$ by $\displaystyle\frac{1}{6}$. This corresponds to multiplying $E_3E_2E_2A$ on the left by the elementary matrix $$ E_4 \begin{pmatrix} 1 & 0 & 0 \\ 0 & \frac{1}{6} & 0 \\ 0 & 0 & 1 \end{pmatrix} $$ and the result is $$ E_4E_3E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & -\frac{1}{3} \\ -1 & 1 & 0 \end{pmatrix} $$

Step 5. Add $\operatorname{Row}_1$ to $\operatorname{Row}_3$. This corresponds to multiplying $E_4E_3E_2E_1A$ on the left by the elementary matrix $$ E_5= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{pmatrix} $$ and the result is $$ E_5E_4E_3E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & -\frac{1}{3} \\ 0 & 1 & 0 \end{pmatrix} $$ Step 6. Subtract $\operatorname{Row}_2$ from $\operatorname{Row}_3$. This corresponds to multiplying $E_5E_4E_3E_2E_1A$ on the left by the elementary matrix $$ E_6= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & -1 & 1 \end{pmatrix} $$ and the result is $$ E_6E_5E_4E_3E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & -\frac{1}{3} \\ 0 & 0 & \frac{1}{3} \end{pmatrix} $$

Step 7. Multiply $\operatorname{Row}_3$ by $3$. This corresponds to multiplying $E_6E_5E_4E_3E_2E_1A$ on the left by the elementary matrix $$ E_7= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 3 \end{pmatrix} $$ and the result is $$ E_7E_6E_5E_4E_3E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & -\frac{1}{3} \\ 0 & 0 & 1 \end{pmatrix} $$

Step 8. Add $\displaystyle\frac{1}{3}\cdot\operatorname{Row}_3$ to $\operatorname{Row}_2$. This corresponds to multiplying $E_7E_6E_5E_4E_3E_2E_1A$ on the left by the elementary matrix $$ E_8= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & \frac{1}{3} \\ 0 & 0 & 1 \end{pmatrix} $$ and the result is $$ E_8E_7E_6E_5E_4E_3E_2E_1A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} $$

Finally, we have the equation $$ E_8E_7E_6E_5E_4E_3E_2E_1A=I $$ where each $E_i$ is an elementary matrix. To finish the problem, we write $$ A=E_1^{-1}E_2^{-1}E_3^{-1}E_4^{-1}E_5^{-1}E_6^{-1}E_7^{-1}E_8^{-1} $$ Can you invert each $E_i$ and carry out the matrix multiplication?