[Math] Explanation of backwards substitution in Gaussian elimination

algorithmsgaussian eliminationlinear algebra

I'm not sure what the back subsitution is doing on Gaussian Elimination…

enter image description here

I understand how it is trying to get the upper triangular matrix with the 0s under the diagonal, and so I get the why we're doing row2 – 4/2 row1 etc.

I just don't understand the back substitution, like why do (-2)/2 to get x3, why do (3-(-3)x3/3 to get x2 etc like where are those numbers coming from and why.

I just like to know why the book is doing what its doing, but it didn't really explain what it was doing to get x3, x2, x1.

Best Answer

The last matrix represents the following system (which is equivalent to the original system): $$\begin{align} 2x_1 -x_2 +x_3 &= 1 \\ 3x_2 - 3x_3 &= 3 \\ 2x_3 &= -2 \end{align}$$

The logic behind back substitution should be clear now. We repeatedly substitute the values (or expressions) found for $x_{i+1}, x_{i+2} \ldots x_{n}$ back into the equation containing $x_i$ until all variables have been solved for: $$\begin{align} x_3 &= \frac{-2}{2} = -1 \\ x_2 &= \frac{3+3x_3}{3} = \frac{3+3(-1)}{3} = 0\\ x_1 &= \frac{1+x_2-x_3}{2} = \frac{1 + 0 -(-1)}{2} = 1 \end{align}$$