Back Substitution
Solve an upper-triangular system from the bottom row upward, substituting known later variables.
Start with the last variable
The bottom row gives z = 2 directly. Substitute it into the second row to get y = 3, then into the first to get x = −2.
backSubstitute([[1, 2, −1, 2], [0, 1, 3, 9], [0, 0, 1, 2]])Work upward in order
The last row gives y = 2. Replace y in the top row, subtract its contribution, and obtain x = 4.
backSubstitute([[1, 3, 10], [0, 2, 4]])Divide by each diagonal pivot
The bottom pivot gives y = 3. The top diagonal entry is 2, so divide the remaining right-hand side by 2 to finish x = 2.
backSubstitute([[2, 1, 7], [0, 1, 3]])Practice
Practice: problems like this one, made and checked in your browser.
Recap
- Back substitution starts with the last nonzero row.
- Substitute known components before solving the row above.
- Every diagonal pivot must be nonzero.