Gaussian elimination
Given the system of equations
$$- 2 x_{3} + \left(x_{1} - 4 x_{2}\right) = -3$$
$$x_{3} + \left(3 x_{1} + x_{2}\right) = 5$$
$$- 6 x_{3} + \left(3 x_{1} - 5 x_{2}\right) = -7$$
We give the system of equations to the canonical form
$$x_{1} - 4 x_{2} - 2 x_{3} = -3$$
$$3 x_{1} + x_{2} + x_{3} = 5$$
$$3 x_{1} - 5 x_{2} - 6 x_{3} = -7$$
Rewrite the system of linear equations as the matrix form
$$\left[\begin{matrix}1 & -4 & -2 & -3\\3 & 1 & 1 & 5\\3 & -5 & -6 & -7\end{matrix}\right]$$
In 1 -th column
$$\left[\begin{matrix}1\\3\\3\end{matrix}\right]$$
let’s convert all the elements, except
1 -th element into zero.
- To do this, let’s take 1 -th line
$$\left[\begin{matrix}1 & -4 & -2 & -3\end{matrix}\right]$$
,
and subtract it from other lines:
From 2 -th line. Let’s subtract it from this line:
$$\left[\begin{matrix}\left(-1\right) 3 + 3 & 1 - - 12 & 1 - - 6 & 5 - - 9\end{matrix}\right] = \left[\begin{matrix}0 & 13 & 7 & 14\end{matrix}\right]$$
you get
$$\left[\begin{matrix}1 & -4 & -2 & -3\\0 & 13 & 7 & 14\\3 & -5 & -6 & -7\end{matrix}\right]$$
From 3 -th line. Let’s subtract it from this line:
$$\left[\begin{matrix}\left(-1\right) 3 + 3 & -5 - - 12 & -6 - - 6 & -7 - - 9\end{matrix}\right] = \left[\begin{matrix}0 & 7 & 0 & 2\end{matrix}\right]$$
you get
$$\left[\begin{matrix}1 & -4 & -2 & -3\\0 & 13 & 7 & 14\\0 & 7 & 0 & 2\end{matrix}\right]$$
In 2 -th column
$$\left[\begin{matrix}-4\\13\\7\end{matrix}\right]$$
let’s convert all the elements, except
3 -th element into zero.
- To do this, let’s take 3 -th line
$$\left[\begin{matrix}0 & 7 & 0 & 2\end{matrix}\right]$$
,
and subtract it from other lines:
From 1 -th line. Let’s subtract it from this line:
$$\left[\begin{matrix}1 - \frac{\left(-4\right) 0}{7} & -4 - \frac{\left(-4\right) 7}{7} & -2 - \frac{\left(-4\right) 0}{7} & -3 - \frac{\left(-4\right) 2}{7}\end{matrix}\right] = \left[\begin{matrix}1 & 0 & -2 & - \frac{13}{7}\end{matrix}\right]$$
you get
$$\left[\begin{matrix}1 & 0 & -2 & - \frac{13}{7}\\0 & 13 & 7 & 14\\0 & 7 & 0 & 2\end{matrix}\right]$$
From 2 -th line. Let’s subtract it from this line:
$$\left[\begin{matrix}- \frac{0 \cdot 13}{7} & 13 - \frac{7 \cdot 13}{7} & 7 - \frac{0 \cdot 13}{7} & 14 - \frac{2 \cdot 13}{7}\end{matrix}\right] = \left[\begin{matrix}0 & 0 & 7 & \frac{72}{7}\end{matrix}\right]$$
you get
$$\left[\begin{matrix}1 & 0 & -2 & - \frac{13}{7}\\0 & 0 & 7 & \frac{72}{7}\\0 & 7 & 0 & 2\end{matrix}\right]$$
In 3 -th column
$$\left[\begin{matrix}-2\\7\\0\end{matrix}\right]$$
let’s convert all the elements, except
2 -th element into zero.
- To do this, let’s take 2 -th line
$$\left[\begin{matrix}0 & 0 & 7 & \frac{72}{7}\end{matrix}\right]$$
,
and subtract it from other lines:
From 1 -th line. Let’s subtract it from this line:
$$\left[\begin{matrix}1 - \frac{\left(-2\right) 0}{7} & - \frac{\left(-2\right) 0}{7} & -2 - \frac{\left(-2\right) 7}{7} & - \frac{13}{7} - \frac{\left(-2\right) 72}{7 \cdot 7}\end{matrix}\right] = \left[\begin{matrix}1 & 0 & 0 & \frac{53}{49}\end{matrix}\right]$$
you get
$$\left[\begin{matrix}1 & 0 & 0 & \frac{53}{49}\\0 & 0 & 7 & \frac{72}{7}\\0 & 7 & 0 & 2\end{matrix}\right]$$
It is almost ready, all we have to do is to find variables, solving the elementary equations:
$$x_{1} - \frac{53}{49} = 0$$
$$7 x_{3} - \frac{72}{7} = 0$$
$$7 x_{2} - 2 = 0$$
We get the answer:
$$x_{1} = \frac{53}{49}$$
$$x_{3} = \frac{72}{49}$$
$$x_{2} = \frac{2}{7}$$
Cramer's rule
$$- 2 x_{3} + \left(x_{1} - 4 x_{2}\right) = -3$$
$$x_{3} + \left(3 x_{1} + x_{2}\right) = 5$$
$$- 6 x_{3} + \left(3 x_{1} - 5 x_{2}\right) = -7$$
We give the system of equations to the canonical form
$$x_{1} - 4 x_{2} - 2 x_{3} = -3$$
$$3 x_{1} + x_{2} + x_{3} = 5$$
$$3 x_{1} - 5 x_{2} - 6 x_{3} = -7$$
Rewrite the system of linear equations as the matrix form
$$\left[\begin{matrix}x_{1} - 4 x_{2} - 2 x_{3}\\3 x_{1} + x_{2} + x_{3}\\3 x_{1} - 5 x_{2} - 6 x_{3}\end{matrix}\right] = \left[\begin{matrix}-3\\5\\-7\end{matrix}\right]$$
- this is the system of equations that has the form
A*x = B
Let´s find a solution of this matrix equations using Cramer´s rule:
Since the determinant of the matrix:
$$A = \operatorname{det}{\left(\left[\begin{matrix}1 & -4 & -2\\3 & 1 & 1\\3 & -5 & -6\end{matrix}\right] \right)} = -49$$
, then
The root xi is obtained by dividing the determinant of the matrix Ai. by the determinant of the matrix A.
( Ai we get it by replacement in the matrix A i-th column with column B )
$$x_{1} = - \frac{\operatorname{det}{\left(\left[\begin{matrix}-3 & -4 & -2\\5 & 1 & 1\\-7 & -5 & -6\end{matrix}\right] \right)}}{49} = \frac{53}{49}$$
$$x_{2} = - \frac{\operatorname{det}{\left(\left[\begin{matrix}1 & -3 & -2\\3 & 5 & 1\\3 & -7 & -6\end{matrix}\right] \right)}}{49} = \frac{2}{7}$$
$$x_{3} = - \frac{\operatorname{det}{\left(\left[\begin{matrix}1 & -4 & -3\\3 & 1 & 5\\3 & -5 & -7\end{matrix}\right] \right)}}{49} = \frac{72}{49}$$