System of linear equations

Solve the following system of linear equations using Gaussian elimination.

7y+z-2w = 5
-4x-4y-z+w = -6
4x+7y+z-2w = 9
4x+5y+2z-w = 5

How to solve this problem?

Represent the system of linear equations in matrix form; where each row correspond to an equation, and each column to a variable, and the entries of the matrix are composed by the coefficients of the variables (this matrix is called the coefficient matrix). Add a column at the end of the coefficient matrix composed by the constant terms (this new matrix is called the augmented matrix). Transform the augmented matrix to row echelon form. If it has solution, translate the resulting matrix to its associated system of linear equations, and use back substitution to find the solution of the system above.

Step 1: Represent the system of linear equations in matrix form. The matrix before the dashed line is the coefficient matrix; the whole matrix is the augmented matrix.

    ┌                      ┐
    │  0   7   1  -2 |   5 │
    │ -4  -4  -1   1 |  -6 │
A = │  4   7   1  -2 |   9 │
    │  4   5   2  -1 |   5 │
    └                      ┘
Step 2: Transform the augmented matrix to row echelon form.

r1 <———> r4
┌                      ┐
│  4   5   2  -1 |   5 │
│ -4  -4  -1   1 |  -6 │
│  4   7   1  -2 |   9 │
│  0   7   1  -2 |   5 │
└                      ┘
r2 <———> r2 + r1
r3 <———> r3 - r1
┌                    ┐
│ 4  5   2  -1 |   5 │
│ 0  1   1   0 |  -1 │
│ 0  2  -1  -1 |   4 │
│ 0  7   1  -2 |   5 │
└                    ┘
r3 <———> r3 - 2•r2
r4 <———> r4 - 7•r2
┌                    ┐
│ 4  5   2  -1 |   5 │
│ 0  1   1   0 |  -1 │
│ 0  0  -3  -1 |   6 │
│ 0  0  -6  -2 |  12 │
└                    ┘
r4 <———> r4 - 2•r3
┌                    ┐
│ 4  5   2  -1 |   5 │
│ 0  1   1   0 |  -1 │
│ 0  0  -3  -1 |   6 │
│ 0  0   0   0 |   0 │
└                    ┘
Step 3: Classify the system.

The rank of the matrices are equal, but less than the number of variables. There is an infinite number of solutions (the system is consistent dependent).

Step 4: Translate the row echelon form matrix to the associated system of linear equations, eliminating the null equations.

4x+5y+2z-w = 5
y+z = -1
-3z-w = 6
Step 5: Select the free variables, which are the ones associated to those columns in the coefficient matrix that do not contain leading entries.

{ w }
Step 6: Back substitution. Starting by the last equation, isolate the dependent variable expressing it in terms of the free variables, and replaces it in the equation above. Do this process until the first equation.

-3z-w = 6
z = (-6-w)/3

y+z = -1
y = -1-z
y = -1-((-6-w)/3)
y = (3+w)/3

4x+5y+2z-w = 5
x = (5-5y-2z+w)/4
x = (5-5•((3+w)/3)-2•((-6-w)/3)+w)/4
x = 1
Step 7: Vector solution.

S =  { (1 ; (3+w)/3 ; (-6-w)/3 ; w) | w ∈ R }

S =  { (1 ; 1+0.3333w ; -2-0.3333w ; w) | w ∈ R }