Gauss-Jordan elimination to find matrix inverses

Notes

Gauss-Jordan elimination is often the most efficient way to find a matrix inverse. The idea works by adjoining an identity matrix on the right, then performing row operations to change the matrix on the left into an identity matrix to leave the matrix on the right as the inverse matrix.

If it is not possible to change the matrix on the left into an identity matrix by Gauss-Jordan elimination, then the matrix has no inverse (is noninvertible or singular).

Two by two matrix example

Find the inverse of the matrix [latex]A=\left(\begin{array}{c}-1&2\\4&2\end{array}\right)[/latex].

  1. Write the coefficients in an array format and adjoin the identity matrix on the right:
    [latex]\left[\begin{array}{cc|cc}-1&2&1&0\\4&2&0&1\end{array}\right][/latex]
  2. Obtain a 1 in the first row first column by dividing the first row by –1:
    [latex]\left[\begin{array}{cc|cc}\mathbf{1}&-2&-1&0\\4&2&0&1\end{array}\right][/latex]
  3. Obtain a 0 in the second row first column by subtracting four times the first row from the second row:
    [latex]\left[\begin{array}{cc|cc}1&-2&-1&0\\\mathbf{0}&10&4&1\end{array}\right][/latex]
  4. Obtain a 1 in the second row second column by dividing the second row by 10:
    [latex]\left[\begin{array}{cc|cc}1&-2&-1&0\\0&\mathbf{1}&2/5&1/10\end{array}\right][/latex]
  5. Obtain a 0 in the first row second column by adding two times the second row to the first row:
    [latex]\left[\begin{array}{cc|cc}1&\mathbf{0}&-1/5&1/5\\0&1&2/5&1/10\end{array}\right][/latex]

The inverse of the matrix is [latex]A^{-1}=\left(\begin{array}{c}-1/5&1/5\\2/5&1/10\end{array}\right)[/latex].

We can check this is correct: [latex]A^{-1}A=\left(\begin{array}{c}-1/5&1/5\\2/5&1/10\end{array}\right)\left(\begin{array}{c}-1&2\\4&2\end{array}\right)=\left(\begin{array}{c}1&0\\0&1\end{array}\right)[/latex].

Three by three matrix example

Find the inverse of the matrix [latex]B=\left(\begin{array}{c}2&2&4\\1&4&-4\\4&4&1\end{array}\right)[/latex].

  1. Write the coefficients in an array format and adjoin the identity matrix on the right:
    [latex]\left[\begin{array}{ccc|ccc}2&2&4&1&0&0\\1&4&-4&0&1&0\\4&4&1&0&0&1\end{array}\right][/latex]
  2. Obtain a 1 in the first row first column by interchanging the first two rows:
    [latex]\left[\begin{array}{ccc|ccc}\mathbf{1}&4&-4&0&1&0\\2&2&4&1&0&0\\4&4&1&0&0&1\end{array}\right][/latex]
  3. Obtain a 0 in the second row first column by subtracting two times the first row from the second row:
    [latex]\left[\begin{array}{ccc|ccc}1&4&-4&0&1&0\\\mathbf{0}&-6&12&1&-2&0\\4&4&1&0&0&1\end{array}\right][/latex]
  4. Obtain a 0 in the third row first column by subtracting four times the first row from the third row:
    [latex]\left[\begin{array}{ccc|ccc}1&4&-4&0&1&0\\0&-6&12&1&-2&0\\\mathbf{0}&-12&17&0&-4&1\end{array}\right][/latex]
  5. Obtain a 1 in the second row second column by dividing the second row by –6:
    [latex]\left[\begin{array}{ccc|ccc}1&4&-4&0&1&0\\0&\mathbf{1}&-2&-1/6&1/3&0\\0&-12&17&0&-4&1\end{array}\right][/latex]
  6. Obtain a 0 in the first row second column by subtracting four times the second row from the first row:
    [latex]\left[\begin{array}{ccc|ccc}1&\mathbf{0}&4&2/3&-1/3&0\\0&1&-2&-1/6&1/3&0\\0&-12&17&0&-4&1\end{array}\right][/latex]
  7. Obtain a 0 in the third row second column by adding twelve times the second row to the third row:
    [latex]\left[\begin{array}{ccc|ccc}1&0&4&2/3&-1/3&0\\0&1&-2&-1/6&1/3&0\\0&\mathbf{0}&-7&-2&0&1\end{array}\right][/latex]
  8. Obtain a 1 in the third row third column by dividing the third row by –7:
    [latex]\left[\begin{array}{ccc|ccc}1&0&4&2/3&-1/3&0\\0&1&-2&-1/6&1/3&0\\0&0&\mathbf{1}&2/7&0&-1/7\end{array}\right][/latex]
  9. Obtain a 0 in the first row third column by subtracting four times the third row from the first row:
    [latex]\left[\begin{array}{ccc|ccc}1&0&\mathbf{0}&-10/21&-1/3&4/7\\0&1&-2&-1/6&1/3&0\\0&0&1&2/7&0&-1/7\end{array}\right][/latex]
  10. Obtain a 0 in the second row third column by adding two times the third row to the second row:
    [latex]\left[\begin{array}{ccc|ccc}1&0&0&-10/21&-1/3&4/7\\0&1&\mathbf{0}&17/42&1/3&-2/7\\0&0&1&2/7&0&-1/7\end{array}\right][/latex]

The inverse of the matrix is [latex]B^{-1}=\left(\begin{array}{c}-10/21&-1/3&4/7\\17/42&1/3&-2/7\\2/7&0&-1/7\end{array}\right)[/latex].

We can check this is correct: [latex]B^{-1}B=\left(\begin{array}{c}-10/21&-1/3&4/7\\17/42&1/3&-2/7\\2/7&0&-1/7\end{array}\right)\left(\begin{array}{c}2&2&4\\1&4&-4\\4&4&1\end{array}\right)=\left(\begin{array}{c}1&0&0\\0&1&0\\0&0&1\end{array}\right)[/latex].

Video Tips

Practice Exercises

Use Gauss-Jordan elimination to find the inverses of the following matrices. Enter the values as decimals and round to 3 decimal places if necessary.

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

A Compendium of Mathematics Problems Copyright © by Iain Pardoe is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book