Table of contents
Source video: 【俗说矩阵】用矩阵求非齐次线性方程组轻轻松松,几步就能搞定!
3 cases of solutions
There are 3 cases of solutions for a non-homogeneous linear system:
- A single unique solution
- Infinitely many solutions
- No solution
Augmented matrix
When performing Gaussian elimination, the equations results will also change. Hence, the coefficient matrix and the “results” column(s) are composed together forming the augmented matrix. Such that the “two matrices” will perform the same elementary row operations.
$$ \begin{cases} x₁ + 2x₂ + 3x₃ = 5 \\\ x₁ + 6x₂ + 7x₃ = 9 \\\ x₁ + 10x₂ + 6x₃ = 8 \\\ \end{cases} $$$$ \begin{array}{cc} A = \begin{bmatrix} 1 & 2 & 3 \\\ 1 & 6 & 7 \\\ 1 & 10 & 6 \end{bmatrix} & A|b = \begin{bmatrix} 1 & 2 & 3 & | 5 \\\ 1 & 6 & 7 & | 9 \\\ 1 & 10 & 6 & | 8 \end{bmatrix} \end{array} $$The augmented matrix can be leveraged to determine the case of the solution.
Single unique solution
Performing elementary row operations on the augmented matrix:
-
Eliminate the unknown x₁ in eq. 2 and eq. 3 by performing -r1 + r2 and -r1+r3:
$$ \begin{bmatrix} 1 & 2 & 3 & | 5 \\\ 0 & 4 & 4 & | 4 \\\ 0 & 8 & 3 & | 3 \end{bmatrix} $$
-
Cancel the common factor 4 for the 2nd line by multiplying the 2nd line with 1/4.
$$ \begin{bmatrix} 1 & 2 & 3 & | 5 \\\ 0 & 1 & 1 & | 1 \\\ 0 & 8 & 3 & | 3 \end{bmatrix} $$ -
Eliminate the unknown x₂ in eq. 3 by performing -8r2 + r3 :
$$ \begin{bmatrix} 1 & 2 & 3 & | 5 \\\ 0 & 1 & 1 & | 1 \\\ 0 & 0 & -5 & | -5 \end{bmatrix} $$
After that, the augmented matrix becomes row echelon form.
Next, the unknowns in the system can be solved from bottom to top by substituting x₃ into eq. 2, and then substituting x₂, x₃ to eq. 1.
$$ \begin{cases} x₁+& 2x₂ +& 3x₃ = 5 \\\ & x₂ +& x₃ = 1 \\\ & & x₃ = 1 \\\ \end{cases} $$Therefore, the unique solution for this non-homogeneous linear system is: 𝐱 = $[^{\_{x₁}}\_{^{x₂}\_{x₃}} ] = [^{\_{2}}\_{^{0}\_{1}} ]$
Also, by looking at the coefficient matrix and the augmented matrix after elementary row operations, the number of their non-zeros lines are both 3, which equals to the number of unknowns.
Thus, the conclusion is that if the augmented matrix has the same number of non-zeros lines of the coefficient matrix, where they both are in row echelon form, but also the number of non-zeros lines equals to the number of unknowns, then this non-homogeneous linear system has a single unique solution.
Infinitely many solutions
$$ \begin{cases} x₁ + 2x₂ + 3x₃ = 5 \\\ x₁ + 3x₂ + 4x₃ = 6 \\\ x₁ + 4x₂ + 5x₃ = 7 \\\ \end{cases} $$Performing elementary row operations on the augmented matrix as follows:
-
Eliminate x₁ of row2 and row3 by -r1+r2 and -r1+r3 :
$[^{\_{1\ 2\ 3\ |5}} \_{^{1\ 3\ 4\ |6}\_{1\ 4\ 5\ |7}}]$ ➔ $[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 2\ 2\ |2}}]$ -
Cancel the commen factor of row3 by multiplying with 1/2 :
$[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 2\ 2\ |2}}]$ ➔ $[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 1\ 1\ |1}}]$ -
Eliminate the unknowns x₂, x₃ in row3 by performing -r2+r3:
$[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 1\ 1\ |1}}]$ ➔ $[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 0\ 0\ |0}}]$
Then the equations become:
$$ \begin{cases} x₁ +& 2x₂ +& 3x₃ = 5 \\\ & x₂ +& x₃ = 1 \\\ & & 0 = 0 \\\ \end{cases} $$By representing x₁, x₂ with x₃, the solution vector becomes: 𝐱 = $[^{\_{3-x₃}}\_{^{1-x₃}\_{x₃}} ]$
That means x₃ can be any value, and x₁ and x₂ can be any value too. Therefore, this non-homogeneous linear system has infinitely many solutions.
Here, the number of non-zero lines in coefficient matrix and augmented matrix is less than the number of unknowns: r(𝐀|𝐛) = r(𝐀) = 2 < 3
So the conclusion is if the augmented matrix and the coefficient matrix in row echelon form have the same number of non-zero rows, which is less than #unknowns, then the non-homogeneous linear system has infinitely many solutions.
No solutions
$$ \begin{cases} x₁ + 2x₂ + 3x₃ = 5 \\\ x₁ + 3x₂ + 4x₃ = 6 \\\ x₁ + 4x₂ + 5x₃ = 9 \\\ \end{cases} $$$[^{\_{1\ 2\ 3\ |5}} \_{^{1\ 3\ 4\ |6}\_{1\ 4\ 5\ |9}}]$ $^{-r1+r2}\_{-r1+r3}$ ➔ $[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 2\ 2\ |4}}]$ ½×r3 ➔ $[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 1\ 1\ |2}}]$ -r2+r3 ➔ $[^{\_{1\ 2\ 3\ |5}} \_{^{0\ 1\ 1\ |1}\_{0\ 0\ 0\ |1}}]$
The corresponding equations are:
$$ \begin{cases} x₁ +& 2x₂ +& 3x₃ = 5 \\\ & x₂ +& 4x₃ = 6 \\\ & & 0 = 1 \\\ \end{cases} $$The 3rd equation is a fault. That means no matther what values the unknowns are, this linear equation system cannot be satisfied. Hence, there is no solution.
In this situation, the number of non-zero rows in the coefficient matrix is not equal to the augmented matrix: r(𝐀|𝐛) = 3 ≠ r(𝐀) = 2.
The conclusion is if the number of non-zero lines in the augmented matrix mismatch with the coefficient matrix in row echelon form, then the non-homogeneous linear equation system has no solution.
General solution of infinitely many solution
$$ \begin{cases} x₁ +& 2x₂ +& 3x₃ = 5 \\\ & x₂ +& x₃ = 1 \\\ & & 0 = 0 \\\ \end{cases} $$Its general solution being represented with x₃ is 𝐱 = $[^{\_{3-x₃}}\_{^{1-x₃}\_{x₃}} ]$
To structure the solution, the constant terms are separated out and x₃ is replaced by k.
𝐱 = $[^{\_{3-x₃}}\_{^{1-x₃}\_{x₃}} ]$ = x₃$[^{\_{-1}}\_{^{-1}\_{1}} ] + [^{\_{3}}\_{^{1}\_{0}} ]$ = k$[^{\_{-1}}\_{^{-1}\_{1}} ] + [^{\_{3}}\_{^{1}\_{0}} ]$
This general solution consistitute two components: random number times a column vector k$[^{\_{-1}}\_{^{-1}\_{1}} ]$ and a constant vector.
-
If the $k [^{\_{-1}}\_{^{-1}\_{1}} ]$ is substituted into equation system individually, the results of all equations are 0s.
$$ \begin{cases} x₁ +& 2x₂ +& 3x₃ = 0 \\\ & x₂ +& x₃ = 0 \\\ & & 0 = 0 \\\ \end{cases} $$So this term is the general solution for the homogeneous linear equations system.
-
And the constant vector can just make the system satisfied. Hence, it’s the specific solution of the non-homogeneous linear equation system.
Therefore, the general solution for a non-homogeneous linear equation system is made up by two parts: the general solution of the corresponding homogeneous linear equation system and the specific solution of the non-homogeneous linear equation system.
The method to find the general solution of the corresponding homogeneous linear equation system has been introduced in the last video.
Find the specific solution
Based on the augmented matrix in row echelon form, the leading variables are x₁ and x₂, while x3 is the free variable.
Theoratically, any one of the solution satifying the non-homogeneous linear equation system is a specific solution. So, the free varaible can be assigned with any value. And in practice, free variables are all set to 0 for the purpose of solving convinently.
If Letting x3 = 0, then x2=1, x1 =3. Thus, the specific vector 𝛈 = $[^{\_{3}} \_{^{1}}\_{0}]$
Steps of solving
-
Write the augmented matrix 𝐀|𝐛 based on the equation system and determine the number of unknowns n.
$$ \begin{cases} x₁ +& 2x₂ +& 3x₃ +& x₄ &= 3 \\\ x₁ -& 4x₂ -& x₃ -& x₄ &= 1 \\\ 2x₁ +& x₂ +& 4x₃ +& x₄ &= 5 \\\ x₁ -& x₂ +& x₃ & &= 2 \\\ \end{cases} $$𝐀|𝐛 =
$$ \begin{bmatrix} 1 & 2 & 3 & 1 & | 3 \\\ 1 & -4 & -1 & -1 & | 1 \\\ 2 & 1 & 4 & 1 & | 5 \\\ 1 & -1 & 1 & 0 & | 2 \end{bmatrix} $$, n = 4
-
Transform the augmented matrix to row echelon form by performing elementray row operations.
$[^{^{1\ 2\ 3\ 1\ | 3}\_{1\ -4\ -1\ -1\ |1}} \_{^{2\ 1\ 4\ 1\ | 5}\_{1\ -1\ 1\ 0\ | 2}}]$ $^{\_{-(-r1+r2)}} \_{^{-(-2r1+r3)} \_{-(-r1+r4)}}$ ➔ $[^{^{1\ 2\ 3\ 1\ | 3} \_{0\ 6\ 4\ 2\ |2}} \_{^{0\ 3\ 2\ 1\ | 1}\_{0\ 3\ 2\ 1\ | 1}}]$ ½r2 ➔ $[^{^{1\ 2\ 3\ 1\ | 3} \_{0\ 3\ 2\ 1\ |1}} \_{^{0\ 3\ 2\ 1\ | 1}\_{0\ 3\ 2\ 1\ | 1}}]$ $^{-(-r2+r3)} \_{-(-r2+r4)}$ ➔ $[^{^{1\ 2\ 3\ 1\ | 3} \_{0\ 3\ 2\ 1\ |1}} \_{^{0\ 0\ 0\ 0\ | 0}\_{0\ 0\ 0\ 0\ | 0}}]$ -
Check the number of non-zero rows r(𝐀|𝐛) of the obtained simplified augmented matrix and r(𝐀) for the coefficient matrix.
r(𝐀|𝐛) = r(𝐀) = 2 < 3 -
Determine the case of the situations:
- r(𝐀|𝐛) = r(𝐀) = n, single unique solution
- r(𝐀|𝐛) = r(𝐀) < n, inifinitely many solutions
- r(𝐀|𝐛) ≠ r(𝐀), no solution
Because r(𝐀|𝐛) = r(𝐀) = 2 < 4, this non-homogeneous equation system has infinitely many solutions.
-
For the case of infinitely many solutions, determine the leading variables and free variables first, and solve the fundamental system of solution, then make up the general solution for the non-homogeneous equation system:
General solution of the corresponding homogeneous equation system- Specific solution of the non-homogeneous equation system
The leading variables are x1 and x2, while x3 and x4 are free variables.
-
Solve the general solution of the homogeneous equation system by letting the result of all equations be 0.
$$ \begin{cases} x₁ +& 2x₂ +& 3x₃ +& x₄ &= 0 \\\ & 3x₂ +& 2x₃ +& x₄ &= 0 \\\ 0 &= 0 \\\ 0 &= 0 \\\ \end{cases} $$- Transform the coefficient matrix to row echelon form $[^{^{1\ 2\ 3\ 1\ | 3} \_{0\ 3\ 2\ 1\ |1}} \_{^{0\ 0\ 0\ 0\ | 0}\_{0\ 0\ 0\ 0\ | 0}}]$
- Determine the leading variables and free variables.
- By assigning values to free variables orthogonally, the general solution for homogeneous equation system can be constructed.
• Take x3,x4 as 0,1, then x2=-1/3, x1=-1/3;
• Take x3,x4 as 1,0, then x2=-2/3, x1=-5/3;
• The fundamental system of solution constitute $[^{^1\_1}\_{^0\_{-3}}]$ and $[^{^5\_2}\_{^{-3}\_0}]$
• General solution for homogeneous equation system:
𝐱’ = k₁ξ₁ +k₂ξ₂ = k₁$[^{^1\_1}\_{^0\_{-3}}]$ + k₂ $[^{^5\_2}\_{^{-3}\_0}]$
-
Find the specific solution of the non-homogeneous equation system by letting all free variables be 0 and solving leading variables from bottom to top:
Take x3,x4 as 0, then x2=1/3, x1=7/3. So the specific solution is 𝛈=$[^{^{7/3}\_{1/3}}\_{^0\_0}]$ -
Add the above two parts together to get the final general solution of the non-homogeneous equation system. 𝐱 = 𝐱’ + 𝛈 = k₁$[^{^1\_1}\_{^0\_{-3}}]$ + k₂ $[^{^5\_2}\_{^{-3}\_0}]$ + $[^{^{7/3}\_{1/3}}\_{^0\_0}]$