Inverse of a matrix

Calculate the inverse of the square matrix A using row operations.

    ┌          ┐
    │ 2  -1  3 │
A = │ 1  -1  1 │
    │ 4  -5  2 │
    └          ┘

How to solve this problem?

To compute the inverse using row operations, place the unitary matrix to the right of the matrix A. Perform elementary row operations to both matrices until turning A into the unit matrix. The most convenient procedure is using the entries on the main diagonal, turning into zeros all the entries above and below them, using elementary row operations of the third kind. Then use elementary row operations of the second kind to turn the entries on the main diagonal into 1 by multiplying the row where they are located by the inverse of its value. If one of the entries of the main diagonal turns into zero, stop the process.

Step 1: Place the Identity matrix to the right side of the matrix A.

┌                    ┐
│ 2  -1  3 | 1  0  0 │
│ 1  -1  1 | 0  1  0 │
│ 4  -5  2 | 0  0  1 │
└                    ┘
Step 2: Transform the matrix A to row echelon form. Make the same row operations to the Identity matrix.

r1 <———> r2
┌                    ┐
│ 1  -1  1 | 0  1  0 │
│ 2  -1  3 | 1  0  0 │
│ 4  -5  2 | 0  0  1 │
└                    ┘
r2 <———> r2 - 2•r1
r3 <———> r3 - 4•r1
┌                      ┐
│ 1  -1   1 | 0   1  0 │
│ 0   1   1 | 1  -2  0 │
│ 0  -1  -2 | 0  -4  1 │
└                      ┘
r3 <———> r3 + r2
┌                      ┐
│ 1  -1   1 | 0   1  0 │
│ 0   1   1 | 1  -2  0 │
│ 0   0  -1 | 1  -6  1 │
└                      ┘
Step 3: Make zeros all the entries above the main diagonal using the entries in the main diagonal, beginning for the right-bottom corner entry.

r2 <———> r2 + r3
r1 <———> r1 + r3
┌                      ┐
│ 1  -1   0 | 1  -5  1 │
│ 0   1   0 | 2  -8  1 │
│ 0   0  -1 | 1  -6  1 │
└                      ┘
r1 <———> r1 + r2
┌                      ┐
│ 1  0   0 | 3  -13  2 │
│ 0  1   0 | 2   -8  1 │
│ 0  0  -1 | 1   -6  1 │
└                      ┘
Step 4: Divide each row by the entry in the main diagonal.

r3 <———> -r3
┌                        ┐
│  1  0  0 |  3  -13   2 │
│  0  1  0 |  2   -8   1 │
│  0  0  1 | -1    6  -1 │
└                        ┘
Step 5: The inverse is the resulting matrix at the right side.

         ┌             ┐
         │  3  -13   2 │
Inv(A) = │  2   -8   1 │
         │ -1    6  -1 │
         └             ┘