In this unit, we will solve systems of linear equations with the same number of equations as unknowns with a non-singular coefficient matrix. Therefore, the system will have a unique solution.
Given the numbers $a_{ij}$ and $b_{j}$ for $i,j=1,2,\ldots,n$ we try to find the values $x_{1},x_{2},\ldots,x_{n}$ that fulfill the set of $n$ linear equations
The system, in matrix notation, will be
that is
$$A\mathbf{x}=\mathbf{b}$$The methods can be:
We will study the methods of Gauss, Gauss-Jordan and LU Decomposition.
We will study the methods of Jacobi and Gauss-Seidel.
The Gaussian method performs two steps:
Consider the system $A\mathbf{x}=\mathbf{b}$ with
$\require{xcolor}$
$$ A=\left(\begin{array}{crc} 1 & 1 & 3\\ 3 & 0 & 1\\ 1 & -2 & 1 \end{array}\right) \quad \mathbf{b}=\left(\begin{array}{c} -2\\ -1\\ -3 \end{array}\right) $$Find $\mathbf{x}$ using Gauss method.
The system we want to solve is
$$ \begin{array}{rrrrrrr} x & + & y & + & 3z & = & -2\\ 3x & & & +& z & = & -1\\ x & -& 2y &+& z & = & -3 \end{array} $$We construct the augmented matrix of the system, which is the matrix $A$ with the column matrix $\mathbf{b}$ added as the fourth column.
The pivot is always an element of the main diagonal. The first pivot is in the first row and therefore in the first column.
We make zeros below the pivot, $\mathbf{{\color{red}1}},$ in the first column.
We make zeros under the pivot $\mathbf{{\color{red}{-3}}}$ in the second column.
And we already have an upper triangular matrix (with zeros below the main diagonal).
$$ \begin{array}{c} r''_{1}\\ r''_{2}\\ r''_{3} \end{array}\left(\begin{array}{rrr|r} 1 & 1 & 3 & -2\\ 0 & -3 & -8 & 5\\ 0 & 0 & 6 & -6 \end{array}\right) $$Let's go back to the notation with equations. The triangular system is
$$ \begin{array}{rrrrrrr} & x & + & y & + & 3z & = & -2\\ & & - & 3y & - & 8z & = & 5\\ & & & & & 6z & = & -6 \end{array} $$Solving for $z$ in the third equation
$$z = -1$$Solving for $y$ in the second equation
$$y =\frac{5+8z}{-3}=\frac{5-8}{-3}=1$$And $x$ in the first one
$$x = -2-y-3z = -2-1+3=0$$and the solution of the system is
$$\fbox{ $x = 0 \quad y = 1 \quad z = -1$}$$