Gauss-Jordan elimination with three variables

Notes

Here we use Gauss-Jordan elimination to solve a system of three linear equations with three variables.

Unique solution

The system of linear equations may have a unique solution, for example:

  • 2x  + 2y + 4z = –2
  • x + 4y – 4z = –1
  • 4x + 4y + z = 3
  1. Write the coefficients in an array format:
    [latex]\begin{array}{ccc|c}2&2&4&-2\\1&4&-4&-1\\4&4&1&3\end{array}[/latex]
  2. Obtain a 1 in the first row first column by interchanging the first two rows:
    [latex]\begin{array}{ccc|c}\mathbf{1}&4&-4&-1\\2&2&4&-2\\4&4&1&3\end{array}[/latex]
  3. Obtain a 0 in the second row first column by subtracting two times the first row from the second row:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\\mathbf{0}&-6&12&0\\4&4&1&3\end{array}[/latex]
  4. Obtain a 0 in the third row first column by subtracting four times the first row from the third row:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\0&-6&12&0\\\mathbf{0}&-12&17&7\end{array}[/latex]
  5. Obtain a 1 in the second row second column by dividing the second row by –6:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\0&\mathbf{1}&-2&0\\0&-12&17&7\end{array}[/latex]
  6. Obtain a 0 in the first row second column by subtracting four times the second row from the first row:
    [latex]\begin{array}{ccc|c}1&\mathbf{0}&4&-1\\0&1&-2&0\\0&-12&17&7\end{array}[/latex]
  7. Obtain a 0 in the third row second column by adding twelve times the second row to the third row:
    [latex]\begin{array}{ccc|c}1&0&4&-1\\0&1&-2&0\\0&\mathbf{0}&-7&7\end{array}[/latex]
  8. Obtain a 1 in the third row third column by dividing the third row by –7:
    [latex]\begin{array}{ccc|c}1&0&4&-1\\0&1&-2&0\\0&0&\mathbf{1}&-1\end{array}[/latex]
  9. Obtain a 0 in the first row third column by subtracting four times the third row from the first row:
    [latex]\begin{array}{ccc|c}1&0&\mathbf{0}&3\\0&1&-2&0\\0&0&1&-1\end{array}[/latex]
  10. Obtain a 0 in the second row third column by adding two times the third row to the second row:
    [latex]\begin{array}{ccc|c}1&0&0&3\\0&1&\mathbf{0}&-2\\0&0&1&-1\end{array}[/latex]

The solution to the system of linear equations is x = 3, y = –2, and z = –1. We can check this is correct:

  • 2(3) + 2(–2) + 4(–1) = 6 – 4 – 4 = –2
  • 3 + 4(–2) – 4(–1) = 3 – 8 + 4 = –1
  • 4(3) + 4(–2) + (–1) = 12 – 8 – 1 = 3

No solution

The system of linear equations may have no solution, for example:

  • 2x  + 2y + 4z = –2
  • x + 4y – 4z = –1
  • 5x + 8y + 4z = 3
  1. Write the coefficients in an array format:
    [latex]\begin{array}{ccc|c}2&2&4&-2\\1&4&-4&-1\\5&8&4&3\end{array}[/latex]
  2. Obtain a 1 in the first row first column by interchanging the first two rows:
    [latex]\begin{array}{ccc|c}\mathbf{1}&4&-4&-1\\2&2&4&-2\\5&8&4&3\end{array}[/latex]
  3. Obtain a 0 in the second row first column by subtracting two times the first row from the second row:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\\mathbf{0}&-6&12&0\\5&8&4&3\end{array}[/latex]
  4. Obtain a 0 in the third row first column by subtracting five times the first row from the third row:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\0&-6&12&0\\\mathbf{0}&-12&24&8\end{array}[/latex]
  5. Obtain a 1 in the second row second column by dividing the second row by –6:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\0&\mathbf{1}&-2&0\\0&-12&24&8\end{array}[/latex]
  6. Obtain a 0 in the first row second column by subtracting four times the second row from the first row:
    [latex]\begin{array}{ccc|c}1&\mathbf{0}&4&-1\\0&1&-2&0\\0&-12&24&8\end{array}[/latex]
  7. Obtain a 0 in the third row second column by adding twelve times the second row to the third row:
    [latex]\begin{array}{ccc|c}1&0&4&-1\\0&1&-2&0\\0&\mathbf{0}&0&8\end{array}[/latex]
  8. Stop because the third row is equivalent to 0x + 0y + 0z = 8, which has no solution.

Infinite solutions

The system of linear equations may have infinite solutions, for example:

  • 2x  + 2y + 4z = –2
  • x + 4y – 4z = –1
  • 5x + 8y + 4z = –5
  1. Write the coefficients in an array format:
    [latex]\begin{array}{ccc|c}2&2&4&-2\\1&4&-4&-1\\5&8&4&-5\end{array}[/latex]
  2. Obtain a 1 in the first row first column by interchanging the first two rows:
    [latex]\begin{array}{ccc|c}\mathbf{1}&4&-4&-1\\2&2&4&-2\\5&8&4&-5\end{array}[/latex]
  3. Obtain a 0 in the second row first column by subtracting two times the first row from the second row:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\\mathbf{0}&-6&12&0\\5&8&4&-5\end{array}[/latex]
  4. Obtain a 0 in the third row first column by subtracting five times the first row from the third row:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\0&-6&12&0\\\mathbf{0}&-12&24&0\end{array}[/latex]
  5. Obtain a 1 in the second row second column by dividing the second row by –6:
    [latex]\begin{array}{ccc|c}1&4&-4&-1\\0&\mathbf{1}&-2&0\\0&-12&24&0\end{array}[/latex]
  6. Obtain a 0 in the first row second column by subtracting four times the second row from the first row:
    [latex]\begin{array}{ccc|c}1&\mathbf{0}&4&-1\\0&1&-2&0\\0&-12&24&0\end{array}[/latex]
  7. Obtain a 0 in the third row second column by adding twelve times the second row to the third row:
    [latex]\begin{array}{ccc|c}1&0&4&-1\\0&1&-2&0\\0&\mathbf{0}&0&0\end{array}[/latex]
  8. Stop because the third row is equivalent to 0x + 0y + 0z = 0, which has an infinite number of solutions.

The solution set to the system of linear equations can be parameterized by setting z=t, so that y = 2t and x = –1 – 4t. We can check this is correct:

  • 2(–1–4t)  + 2(2t) + 4t = –2 – 8t + 4t + 4t = –2
  • (–1–4t) + 4(2t) – 4t = –1 – 4t + 8t – 4t = –1
  • 5(–1–4t) + 8(2t) + 4t = –5 – 20t + 16t + 4t = –5

Video Tips

Practice Exercises

Use Gauss-Jordan elimination to solve the following systems of linear equations. Enter 0, 1, or “infinite” for “number of solutions.” If there are 0 solutions enter “na” (for “not applicable”) for “x,” “y,” and “z,” if there is 1 solution enter number values for “x,” “y,” and “z,” and if there are infinite solutions enter “t” for “z” and functions of t (e.g., “1+2t”) for “x” and “y.”

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