0% found this document useful (0 votes)
43 views

Linear Algebra

This document provides an introduction and overview of linear algebra concepts including: - Systems of linear equations can have a unique solution, infinite solutions, or no solution. - Determinants are values calculated from matrices that have many useful properties for studying vector spaces, matrices, and solving systems of equations. - Properties of determinants include that row/column swaps change the sign, identical rows/columns give a determinant of zero, and multiplying rows/columns by constants scales the determinant. - Techniques for solving systems of linear equations include using matrices, determinants, and iterative methods.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Linear Algebra

This document provides an introduction and overview of linear algebra concepts including: - Systems of linear equations can have a unique solution, infinite solutions, or no solution. - Determinants are values calculated from matrices that have many useful properties for studying vector spaces, matrices, and solving systems of equations. - Properties of determinants include that row/column swaps change the sign, identical rows/columns give a determinant of zero, and multiplying rows/columns by constants scales the determinant. - Techniques for solving systems of linear equations include using matrices, determinants, and iterative methods.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof.

Reda S Tantawi

Contents
Introduction 1
Determinants 3
Properties of Determinants 3
Value of a determinant 5
The upper triangular form of a determinant 8
Cramer’s Rule 11
Matrices 14
Special Matrices 15
Mathematical operations on Matrices 16
Invertible matrices 19
Systems of linear equations and matrix equation 21
The augmented matrix for a system of linear equations 21
Matrix Solution of Linear System of equations 23
Gauss-Elimination method 23
Gauss – Jordan Elimination method 28
Inverse of matrices 31
The inverse of a matrix using the elementary row operations 31
The inverse of a matrix and determinants 32
Invertible matrices method 35
LU - decomposition method 38
Iterative methods 47
Jaccobi method 47
Gauss - Seidel method 51
Eigenvalues and eigenvectors of a square matrix 56

0
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Introduction
Linear algebra is the branch of mathematics concerning linear equations and functions. Linear
algebra is one of the corner stones of computational mathematics. such as Almost all numerical
schemes such as the finite element and finite difference methods are in fact techniques that
transform, assemble, reduce, rearrange, and/or approximate the differential, integral, or other types
of equations to systems of linear algebraic equations.
Solving a system of linear algebraic equations is equivalent to finding the intersection point(s) of
all surfaces (lines), represented by these equations, in a space of dimension equals the number of
the given equations. If all surfaces happen to pass through a single point, then the solution is
unique. If the intersected part is a line or a surface, there are an infinite number of solutions.
Otherwise, the solution does not exist.
Systems of Linear Equations
A system of 𝑛 linear equations in 𝑛 unknowns 𝑥1 , 𝑥2 ,  ⋯ , 𝑥𝑛 is a set of equations of the form:
𝑎11 𝑥1   +  𝑎12 𝑥2   +   ⋯   +  𝑎1𝑛 𝑥𝑛   =  𝑏1  
𝑎21 𝑥1   + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛   =  𝑏2  
(1)
  ⋮      
𝑎𝑛1 𝑥1   +  𝑎𝑛2 𝑥2   +   ⋯   +  𝑎𝑛𝑛 𝑥𝑛   =  𝑏𝑛 }
where 𝑎𝑖𝑗 , 𝑏𝑗 are real numbers.
This system of equations is called homogeneous if 𝑏𝑗 = 0 for all 𝑗 = 1,2, ⋯ , 𝑛 and non-
homogeneous otherwise.
Possibility of solving a system of linear equations:
For a system of non-homogeneous linear equations:
(1) the system has a single (unique) solution.
(2) the system has an infinite number of solutions.
(3) the system has no solution at all.
For a system of homogeneous linear equations:
(1) the system has only the trivial solution (zeros);
(2) the system has an infinite number of solutions.
A system of linear equations is called consistent if it has at least one solution and inconsistent
if it has no solution.

1
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

There are two techniques for solving a system of linear algebraic equations: One of them
depends on the matrices and determinants algebra, and the other depends on iterations with starting
estimates for the solution.

2
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Determinants
A determinant consists of elements listed in rows and columns of the same number between
two vertical lines, the number of rows (or columns) is the order of the determinant. The
determinant is denoted by |𝐴|, |𝐵|, |𝐶|, ⋯. The determinants have many beneficial properties for
studying vector spaces, matrices, and systems of equations.
The determinant consists of n rows is of order 𝑛 × 𝑛 or simply we can say of order 𝑛.
For examples:
𝑎11 𝑎12 𝑎13
𝑎11 𝑎12
|𝐴| = |𝑎11 | of order 1, |𝐴| = | | of order 2, |𝐴| = |𝑎21 𝑎22 𝑎23 | of order
𝑎21 𝑎22
𝑎31 𝑎32 𝑎33
𝑎11 𝑎12 ⋯ 𝑎1𝑛

|𝑎21 𝑎22 ⋯ 𝑎2𝑛 |


3, |𝐴| = of order n .
| ⋮ ⋮ ⋱ ⋮ |
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛
The diagonal of the elements 𝑎11 , 𝑎22 , 𝑎33 , ⋯ , 𝑎𝑛𝑛 is called the main (principal) diagonal.

Determinants have many applications. In our present study we are going to use the determinants
to solve system of linear algebraic equations (Cramer’s Rule), to evaluate the eigenvalues and
eigenvectors of square matrix, and finally, to find the inverse of a square matrix.
Properties of Determinants
The properties of determinants can be very useful, they are complicated to prove.
(1) If we interchange all the rows and the columns, the value of the determinant does not change.
4 7 −1 4 2 −5
|2 −3 4 |=| 7 −3 1|
−5 1 −1 −1 4 −1
(2) If we interchange any two rows (or columns), then sign of the determinant changes.
4 7 −1 4 7 −1 7 4 −1
|2 −3 4 | = − |−5 1 −1| = − |−3 2 4|
−5 1 −1 2 −3 4 1 −5 −1
(3) If any two rows or any two columns in a determinant are identical (or proportional), then
the value of the determinant is zero.

3
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

2 −8 6 8 2 −8 6 8 2 4 6 4
|3 −9 5 10| |3 −9 5 10| |3 6 5 10|
= 0, = 0, =0
|2 −8 6 8| |0 4 1 2| |2 4 7 8|
1 −4 0 6 6 −24 18 24 1 2 0 6
(4) Multiplying a determinant by k means multiplying the elements of only one row (or one
column) by 𝑘.
4 7 −1 20 35 −5 4 7 −1 20 7 −1
5×| 2 −3 4 |=| 2 −3 4 | = | 10 −15 20 | = | 10 −3 4|
−5 1 −1 −5 1 −1 −5 1 −1 −25 1 −1
4 35 −1
=| 2 −13 4|
−5 5 −1
Similarly, we can take a common factor from elements of a row (or column):
4 12 20 1 3 5 2 12 4
|𝐴| = |2 −3 5 | = 4 × |2 −3 5 | = 2 × 5 × |1 −3 1|
0 1 10 0 1 10 0 1 2
1 6 2
= 2 × 5 × 2 |1 −3 1|
0 1 2
(5) If to each element of a row (or a column) of a determinant the equimultiples of corresponding
elements of other rows (columns) are added, then value of determinant remains same.
2 −8 6 8 2 −8 6 8
|3 −9 5 10| −𝑅1 + 𝑅2 |1 −1 −1 2|
|𝐴| = → |𝐴| =
|1 −2 2 0 | −𝑅1 + 𝑅4 |1 −2 2 0|
1 −4 0 6 −1 4 −6 −2
2 −8 6 8 2 −8 6 8
|3 −9 5 10| 𝑅1 + 𝑅2 |5 −17 11 18|
|𝐵| = → |𝐵| =
|1 −2 2 0 | 2𝑅1 + 𝑅3 |5 −18 14 16|
1 −4 0 6 1 −4 0 6

4
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Value of a determinant
- The value of a determinant of order 1 is given as: |𝐴| = |𝑎11 | = 𝑎11
∴ |𝐴| = |5| = 5, |𝐴| = |−5| = −5
- The value of a determinant of order 2 is given as:
𝑎11 𝑎12
|𝐴| = | | = 𝑎11 × 𝑎22 − 𝑎12 × 𝑎21
𝑎21 𝑎22
5 2 2 −4
∴ | | = 5 × 3 − 2 × 8 = −1, | | = 2 × 3 − (−4) × 6 = 30
8 3 6 3
- Evaluation of the value of a determinant of order ≥ 3 needs to know minors and cofactors of
the elements of a determinant.
Minor of the element 𝑎𝑖𝑗 of a determinant |𝐴| is the determinant obtained by deleting ith row
and jth column, and it is denoted by 𝑀𝑖𝑗 .
Cofactor of the element 𝑎𝑖𝑗 of a determinant |𝐴| is given by 𝐴𝑖𝑗 = (−1)𝑖+𝑗 𝑀𝑖𝑗 , the sign of
(−1)𝑖+𝑗 is called sign of the element 𝑎𝑖𝑗 (which is positive if the sum of the numbers of the row
and the column of the element is even, and negative if this sum is odd).
2 1 −2
For example, the minors of the determinant: |𝐴| = | 3 5 0 | are:
−4 8 3
5 0 3 0
𝑀11 = | | = 15 − 0 = 15, 𝑀12 = | | = 9 − 0 = 9,
8 3 −4 3
3 5 1 −2
𝑀13 = | | = 24 + 20 = 44, 𝑀21 = | | = 3 + 16 = 19,
−4 8 8 3
2 −2 2 1
𝑀22 = | | = 6 − 8 = −2, 𝑀23 = | | = 16 + 4 = 20,
−4 3 −4 8
1 −2 2 −2
𝑀31 = | | = 0 + 10 = 10, 𝑀32 = | | = 0 + 6 = 6,
5 0 3 0
2 1
𝑀33 = | | = 10 − 3 = 7.
3 5
The cofactors of |𝐴| are:
𝐴11 = (−1)2 𝑀11 = 15, 𝐴12 = (−1)3 𝑀12 = −9, 𝐴13 = (−1)4 𝑀13 = 44,
𝐴21 = (−1)3 𝑀21 = −19, 𝐴22 = (−1)4 𝑀22 = −2, 𝐴23 = (−1)5 𝑀23 = −20,

5
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝐴31 = (−1)4 𝑀31 = 10, 𝐴32 = (−1)5 𝑀32 = −6, 𝐴33 = (−1)6 𝑀33 = 7.

The value of a determinant of order ≥ 3 can be obtained by the sum of products of all elements of
a row (or a column) with the corresponding co-factors (we can use any row or any column). That
is,
|𝐴| = ∑𝑖 𝐴𝑖𝑗 for any row j, or
|𝐴| = ∑𝑗 𝐴𝑖𝑗 for any column j.
This method is called ‘expansion of the determinant’.
𝑎11 𝑎12 𝑎13
Therefore, the value of |𝐴| = |𝑎21 𝑎22 𝑎23 | is:
𝑎31 𝑎32 𝑎33
(a) Using the first row, we have
+ − +
𝑎11 𝑎12 𝑎13
𝑎22 𝑎23 𝑎21 𝑎23 𝑎21 𝑎22
|𝐴| = |𝑎21 𝑎22 |
𝑎23 = 𝑎11 | | − 𝑎12 | | + 𝑎13 | |
𝑎32 𝑎33 𝑎31 𝑎31 𝑎31 𝑎32
𝑎31 𝑎32 𝑎31
(b) Using the third column, we have
+
𝑎11 𝑎12 𝑎13

𝑎21 𝑎22 𝑎11 𝑎12 𝑎11 𝑎12
|𝐴| = |𝑎21 𝑎22 𝑎23 | = 𝑎13 | | − 𝑎23 | | + 𝑎33 | |
+
𝑎31 𝑎32 𝑎31 𝑎32 𝑎21 𝑎22
𝑎31 𝑎32 𝑎33
Note that the results we obtained by using the first row and the third column are the same.

Remarks:
1- If all the elements of a row (or column) are zeros, then we can use the co-factors of this row (or
column) foe which the value of the determinant must be zero.
2- When expanding by cofactors, you do not need to evaluate the cofactors of zero entries, because
a zero entry times its cofactor is zero. So that, the row (or column) containing the most zeros is
usually the best choice for expansion by cofactors.
2 1 −2
Example 1: Find the value of the determinant: |𝐴| = | 3 5 0|
−4 8 3

6
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Solution:
(a) Using the first row, we have:
+ − +
2 1 −2
5 0 3 0 3 5
|𝐴| = | 3 5 0 | = 2 | | − 1| | + (−2) | |
8 3 −4 3 −4 8
−4 8 3
= 2(5 × 3 − 0) − (9 − 0) + (−2)(24 + 20) = −67
(b) Using the third column, we have:
+
2 1 −2
− 3 5 2 1
|𝐴| = | 3 5 0 | = −2 | | − 0 + 3| |
+ −4 8 3 5
−4 8 3
= −2(24 + 20) + 3(10 − 3) = −67
Note that the results we obtained by using the first row and the third column are the same.

Example 2: Find the value of the determinants:


3 0 −4 0
1 2 3 4 7 −1
|0 8 1 2|
(𝑖)|𝐴| = | 2 −1 2| (ii)|𝐵| = | 2 −3 4| (iii)|𝐶| =
|6 1 8 2|
−1 4 5 −5 1 −1
0 3 −6 1
Solution:
(i) Expanding along the first row:
+ − +
1 2 3
−1 2 2 2 2 −1
∴ |𝐴| = | 2 −1 2| = | 4 | − 2| | + 3| |
5 −1 5 −1 4
−1 4 5
= (−5 − 8) − 2(10 + 2) + 3(8 − 1) = −16
(ii) Expanding along the second row:
4 7 −1
− + − 7 −1 4 −1 4 7
(ii)|𝐵| = | 2 −3 4 | = −2 | | − 3| |− 4| |
1 −1 −5 −1 −5 1
−5 1 −1
= −2(−7 + 1) − 3(−4 − 5) − 4(4 + 35) = −117

7
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

(iii) Expanding along the first column:


+
3 0 −4 0 + − + + − +

|0 8 1 2 0 −4 0
8 1 2| = 3 |
|𝐶| = + 1 8 2| + 6 | 8 1 2|
|6 1 8 2|
− 3 −6 1 3 −6 1
0 3 −6 1
8 2 1 2 1 8 8 2
= 3 {8 | |−| | + 2| |} + 6 × 4 | |
−6 1 3 1 3 −6 3 1
= 3{8 × 20 + 5 − 2 × 30} + 6 × 4 × 2 = 315 + 48

The upper triangular form of a determinant


The upper triangular form of a determinant is a determinant in which all the elements below the
main diagonal are zeros.
𝑎11 𝑎12 ⋯ ⋯ 𝑎1𝑛

| 0 𝑎22 ⋯ ⋯ 𝑎2𝑛 |
|𝐴| = 0 0 ⋱ ⋯ ⋮ = 𝑎11 × 𝑎22 × 𝑎33 × ⋯ × 𝑎𝑛𝑛
| ⋮ ⋮ ⋮ ⋱ ⋮ |
0 0 ⋯ ⋯ 𝑎𝑛𝑛
We can obtain the triangular form of a determinant by applying the properties of the determinants,
as we will see in the following.
We will use a symbolic shorthand to describe these row operations:
1. 𝑅𝑖 ↔ 𝑅𝑗 : Interchanging the rows 𝑖 and 𝑗, then sign of the determinant changes.
2. 𝛼 cf 𝑅𝑖 : Taking 𝛼 as common factor from row 𝑖.
3. 𝛼𝑅𝑖 + 𝑅𝑗 : Multiply row 𝑖 by the scalar 𝛼 and add to row 𝑗.
The above statements are called elementary row operations.

Example 1:
Find the upper triangular form of the determinant, and then find its value:
4 2 3
|𝐴| = | 2 0 2|
−1 4 5

8
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Solution:
4 2 3 −1 4 5 −1 4 5
𝑅1 ↔ 𝑅3 2𝑅1 + 𝑅2 → 𝑅2
|𝐴| = | 2 0 2| → −| 2 0 2| → −| 0 8 12|
4𝑅1 + 𝑅3 → 𝑅3
−1 4 5 4 2 3 0 18 23
18 −1 4 5
− 𝑅2 + 𝑅3 → 𝑅3
8
→ −| 0 8 12 | = −(−1)(8)(−4) = −32
0 0 −4
Example 2:
Find the upper triangular form of the determinant, then find its value.
2 3 1 0 −5 6 0 0
|1 4 4 6| |0 1 −1 2|
(𝑖)|𝐴| = (ii)|𝐵| =
|3 1 0 3| |−3 4 −5 1|
5 8 2 6 1 6 0 3
Solution:
We apply the operations on the determinant as follows:
2 3 1 0 1 4 4 6
−2𝑅1 +𝑅2
|1 4 4 6| 𝑅1 ↔ 𝑅2 |2 3 1 0| −3𝑅1+𝑅3
(𝑖)|𝐴| = → − →
|3 1 0 3| |3 1 0 3| −5𝑅1+𝑅4
5 8 2 6 5 8 2 6
1 4 4 6
1 4 4 6
11
−12| 5 𝑅2 + 𝑅3 → 𝑅3
− |0 −5 −7 −12|
|0 −5 −7 17 57
− → − 0 0
|0 −11 −12 −15| − 12 𝑅2 + 𝑅4 → 𝑅4 5 5 |
5 |
6 24
0 −12 −18 −24 0 0 −
5 5
1 4 4 6
6
𝑅 + 𝑅4 → 𝑅4 |0 −5 −7 −12|
17 3 17 57
→ − 0 0 = 150
| 5 5 |
150
0 0 0
17

9
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

−5 6 0 0
−5 6 0 0
3 1
− 𝑅1 + 𝑅3 → 𝑅3 |0 1 −1 2| 𝑐𝑓 𝑅3
|0 1 −1 2| 5 2 5
(ii) |𝐵| = → 0 −5 1 →
|−3 4 −5 1| 1
𝑅1 + 𝑅4 → 𝑅4 5 1
𝑐𝑓𝑅4
5 | | 5
36
1 6 0 3 0 0 3
5
−5 6 0 0 −5 6 0 0
1 |0 1 −1 2 | −2𝑅2 + 𝑅3 → 𝑅3 1 | 0 1 −1 2 |

25 | 0 2 −25 5 | −36𝑅2 + 𝑅4 → 𝑅4 25 | 0 0 −23 1 |
0 36 0 15 0 0 36 −57
−5 6 0 0
36
𝑅 + 𝑅4 → 𝑅4 1 |0 1 −1 2 |
23 3

25 | 0 0 −23 1 |
−1275
0 0 0
23
1 −1275
= [−5 × 1 × (−23) × ( )] = −255
25 23
Example 3:
Find the upper triangular form of the determinant, and then find its value:
1 2 1 4
|4 2 5 0|
|𝐴| =
|3 0 3 3|
1 4 1 5
Solution:
1 2 1 4 1 2 1 4
−4𝑅1 +𝑅2
|4 2 5 0| −3𝑅1 +𝑅3 |0 −6 1 −16|
|𝐴| = →
|3 0 3 3| −𝑅1+𝑅4 |0 −6 0 −9 |
1 4 1 5 0 2 0 1
1 2 1 4 1 2 1 4
1
−𝑅2 + 𝑅3 |0 −6 1 −16| 𝑅3 + 𝑅4 0 −6 1 −16|
3 |
→ → = −12
1
𝑅2 + 𝑅4 |0 0 −1 7 | |0 0 −1 7 |
3 1 −13
0 0 0 0 0 −2
3 3

10
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Cramer’s Rule:
Cramer’s rule, named after Gabriel Cramer (1704–1752), is a formula that uses determinants to
solve a system of algebraic linear equations. According to Cramer’s rule, if the system of n linear
equations (1) has a nonzero coefficient determinant, that is the determinant Δ of coefficient of the
unknowns 𝑥1 , 𝑥2 , … , 𝑥𝑛 , i.e.,
𝑎11 𝑎12 ⋯ 𝑎1𝑛

|𝑎21 𝑎22 ⋯ 𝑎2𝑛 |


Δ= ≠0
| ⋮ ⋮ ⋱ ⋮ |
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛
The value of each variable is the quotient of two determinants. The denominator is the coefficient
determinant, and the numerator is the determinant formed by replacing the column corresponding
Δ𝑥𝑘
to the variable being solved for with the column representing the constants. That is 𝑥𝑘 =
Δ

where:
𝑏1 𝑎12 ⋯ 𝑎1𝑛 𝑎11 𝑏1 ⋯ 𝑎1𝑛
| 𝑏2 𝑎22 ⋯ 𝑎2𝑛 | |𝑎21 𝑏2 ⋯ 𝑎2𝑛 |
Δ𝑥1 = , Δ𝑥2 = , and so on.
|⋮ ⋮ ⋱ ⋮ | | ⋮ ⋮ ⋱ ⋮ |
𝑏𝑛 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑎𝑛1 𝑏𝑛 ⋯ 𝑎𝑛𝑛

Possibility of solving a system of linear equations


For a system of homogeneous linear equations (𝑏𝑘 = 0 for all 𝑘 = 1,2, ⋯ , 𝑛):
(1) if Δ ≠ 0, the system has only trivial solution (zeros).
(2) if Δ = 0 , the system has an infinite number of solutions, including the zero solution. In this
case Cramer’s rule does not work.

For a system of non-homogeneous linear equations:


(1) If Δ ≠ 0, the system has a single solution.
(2) If Δ = 0, Δ𝑥𝑘 = 0 for all 𝑘 = 1,2, ⋯ , 𝑛 , the system has an infinite number of solutions
Cramer’s rule does not work.
(3) If Δ = 0, Δ𝑥𝑘 ≠ 0 for some values of k , the system has no solution at all.

Example 1: Using Cramer’s rule, discuss the possibility of solving the equations.
𝑥 + 𝑦 = 3, 4𝑥 − 𝑦 = 2
11
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Solution: We have non-homogeneous system of two equations.


1 1 3 1 1 3
Δ=| | = −5 ≠ 0, Δx = | | = −5, Δy = | | = −10
4 −1 2 −1 4 2
Thus, the given system has a unique solution,
Δ𝑥 −5 Δ𝑦 −10
𝑥= = = 1, 𝑦= = = 2.
Δ −5 Δ −5
Example 2:
Using Cramer’s rule, discuss the possibility of solving the equations.
𝑥 + 2𝑦 + 2𝑧 = 6, 2𝑥 + 4𝑦 + 𝑧 = 7, 3𝑥 + 2𝑦 + 9𝑧 = 14
Solution: We have a non-homogeneous system of three equations.
1 2 2
Δ = |2 4 1| = (36 − 2) − 2(18 − 3) + 2(4 − 12) = −12 ≠ 0
3 2 9
6 2 2
Δx = | 7 4 1| = 6(36 − 2) − 2(63 − 14) + 2(14 − 56) = 22
14 2 9
1 6 2
Δy = |2 7 1| = (63 − 14) − 6(18 − 3) + 2(28 − 21) = −27
3 14 9
1 2 6
Δz = |2 4 7 | = (56 − 14) − 2(28 − 21) + 6(4 − 12) = −20
3 2 14
Thus, the given system has a unique solution,
Δ𝑥 22 11 Δ𝑦 27 Δ𝑧 20 5
𝑥= =− =− , 𝑦= = , 𝑧= = =
Δ 12 6 Δ 12 Δ 12 3
Example 3:
Using Cramer’s rule, discuss the possibility of solving the equations.
2𝑥 + 5𝑦 − 3𝑧 = 3, 𝑥 − 2𝑦 + 𝑧 = 2, 7𝑥 + 4𝑦 − 3𝑧 = −4
Solution: We have a non-homogeneous system of three equations.
2 5 −3
Δ = |1 −2 1 | = 2(6 − 4) − 5(−3 − 7) − 3(4 + 14) = 0
7 4 −3

12
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

3 5 −3
Δ𝑥 = | 2 −2 1 | = 3(6 − 4) − 5(−6 + 4) − 3(8 − 8) = 16 ≠ 0
−4 4 −3
Thus, the given system has no solution.

Example 4:
Using Cramer’s rule, discuss the possibility of solving the equations.
2𝑥 + 𝑦 + 5𝑧 = 0, − 2𝑥 + 𝑦 − 3𝑧 = 0, 2𝑥 − 𝑦 = 0
Solution: We have a homogeneous system of three equations.
2 1 5
Δ = |−2 1 −3| = 2(0 − 3) − (0 + 6) + 5(2 − 2) = −12 ≠ 0
2 −1 0
Thus, the given system has only trivial solution, 𝑥 = 0, 𝑦 = 0, 𝑧 = 0

Exercise:
1. Expand each of the following determinants (Find the value of the determinant):
3 0 −4 0
2 3 −2 −4 7 1
|0 8 1 2|
(𝑖)|𝐴| = |0 1 2| (𝑖𝑖)|𝐵| = | 5 0 3| (𝑖𝑖𝑖)|𝐶| =
|6 1 8 0|
1 0 −1 2 0 −1
0 0 0 1
2. Find the upper triangular formula of each of the following determinants, then find its value.
1 0 1 4 2 2 1 4
|4 2 6 2| |4 2 0 2|
(𝑖)|𝐴| = (ii)|𝐵| =
|3 0 3 9| |0 0 3 4|
1 4 1 5 1 4 1 5
3. Using Cramer’s rule, find the solution of the following equations:
i) − 2 𝑥 + 3𝑦 − 5𝑧 = −11, 4𝑥 − 𝑦 + 𝑧 = −3, − 𝑥 − 4𝑦 + 6𝑧 = 15
ii) 5 𝑥 − 2𝑦 + 𝑧 = 15, 3 𝑥 − 3𝑦 − 𝑧 = −7, 2 𝑥 − 𝑦 − 7𝑧 = 3
iii) 3 𝑥 + 2𝑦 + 8𝑧 = 38, 𝑥 + 3𝑦 + 9𝑧 = 37, 2 𝑥 + 𝑦 + 𝑧 = 15
iv) 𝑥 + 2𝑧 = 1, 3𝑥 − 𝑦 + 𝑧 = 2, 4𝑦 + 5𝑧 = −1
v) 4𝑥 + 2𝑦 − 𝑧 = 5, 3𝑥 − 𝑦 + 𝑧 = −2, 𝑥 + 𝑦 − 𝑧 = 0

13
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Matrices
The importance of matrices has increased because of the human need to display and classify data
and store information, as well as to deal with that data in the form of tables, and that organizing
the information in a specific way facilitates quick memory and comparison between them. The
importance of arrays increased with the use of the computer and its ability to perform long
mathematical operations in a short time. The important role of matrices is not limited to
mathematics only, but also plays a large role in other sciences such as engineering, physics,
chemistry, and others.
A matrix is an array of elements arranged in rows and columns. The numbers that make up a
matrix are called the elements of a matrix, and these elements are written in parentheses on the
figure   or on the figure ( ) . A matrix having m rows and n columns is said to have the
order 𝑚 × 𝑛. Usually, we denote the matrix by one of the capital letters, such as A, B, C, ⋯ and
we denote the elements of a matrix A by the symbol 𝑎𝑖𝑗 where i denotes the row number the
element is in and j refers to the column number.
Hence a matrix 𝐴 of order 𝑚 × 𝑛 can be represented in the following forms:

𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑎11 𝑎12 ⋯ 𝑎1𝑛


𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑎21 𝑎22 ⋯ 𝑎2𝑛
𝐴  =   or 𝐴  =   ,
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
[𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 ] (𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 )

A matrix having only one column is called a column vector; and a matrix with only one row is
called a row vector and are often written in Boldface lowercase letters.
A (general) row vector is of the form 𝒂 = [𝑎1 𝑎1 ⋯ 𝑎𝑛 ] and a column vector is of the
form
𝑏1
𝑏2
𝒃=   

[ 𝑏𝑛 ]
Equality of two Matrices: Two matrices A and B having the same order 𝑚 × 𝑛 are equal if 𝑎𝑖𝑗 =
𝑏𝑖𝑗 for each 𝑖 = 1, 2, ⋯ , 𝑚 and 𝑗 = 1, 2, ⋯ , 𝑛. In other words, two matrices are said to be equal if

14
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

they have the same order and their corresponding elements are equal.

Special Matrices:
1. A matrix in which all elements are zeros is called a zero-matrix, denoted by [0]. For example,
0 0
0 0 0 0 0
[0]2×2 = [ ], [0]2×3 = [ ], [0]3×2 = [0 0]
0 0 0 0 0
0 0
2. A matrix having the number of rows equal to the number of columns is called a square matrix.
Thus, its order is 𝑛 × 𝑛 or 𝑛 only. That is,
𝑎11 𝑎12 ⋯ 𝑎1𝑛
𝑎21 𝑎22 ⋯ 𝑎2𝑛
𝐴=
⋮ ⋮ ⋱ ⋮
[𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 ]
where the elements 𝑎11 , 𝑎22 , 𝑎33 , ⋯ , 𝑎𝑛𝑛 are called the diagonal elements and form the principal
(main) diagonal of 𝐴. The sum of the diagonal elements is called trace of the matrix;
𝑇𝑟(𝐴)  =  𝑎11   +  𝑎22   +  𝑎33   +   ⋯   +  𝑎𝑛𝑛
3. A square matrix 𝐴 is said to be a diagonal matrix if aij = 0 for all 𝑖 ≠ 𝑗 but non-zero

elements appear on the principal diagonal. That is,


𝑎11 0 0 0
0 𝑎22 0 0
𝐴=
0 0 ⋱ 0
[ 0 0 0 𝑎𝑛𝑛 ]
4. A diagonal matrix of order 𝑛 with 𝑎𝑘𝑘 = 1, 𝑘 = 1,2, ⋯ , 𝑛 is called ‘Identity matrix’, denoted
by 𝐼𝑛 (simply we can write 𝐼). For example,
1 0 0 0
1 0 0
1 0 0 1 0 0
𝐼2 = [ ], 𝐼3 = [0 1 0] , ⋯, 𝐼𝑛 =
0 1 0 0 ⋱ 0
0 0 1
[0 0 0 1]
5. A square matrix is said to be an upper triangular matrix if 𝑎𝑖𝑗 = 0 for all 𝑖 > 𝑗, and it is
said to be a lower triangular matrix if 𝑎𝑖𝑗 = 0 for all 𝑖 < 𝑗.

15
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑎11 𝑎12 ⋯ ⋯ 𝑎1𝑛 𝑎11 0 0 ⋯ 0


0 𝑎22 ⋯ ⋯ 𝑎2𝑛 𝑎21 𝑎22 0 ⋯ 0
𝐴= 0 0 ⋱ ⋯ ⋮ 𝐴= ⋮ ⋮ ⋱ ⋯ ⋮
⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋮ ⋱ 0
[ 0 0 ⋯ ⋯ 𝑎𝑛𝑛 ] [𝑎𝑛1 𝑎𝑛2 ⋯ ⋯ 𝑎𝑛𝑛 ]
Upper triangular matrix Lower triangular matrix

Mathematical operations on matrices


1. Multiplying a scalar to a matrix: If a scalar (number) is multiplied to a matrix, we multiply it
to all the elements of the matrix, we can take a common factor from all the elements of a matrix.
For example
1 0 4 0
If 𝐴 = [4 2 ] ⇒ 4𝐴 = [16 8 ],
3 −1 12 −4
2 4 0 1 2 0
𝐵 = [6 12 20] = 2 [3 6 10]
8 2 10 4 1 5

2. Addition and subtraction of matrices: To add (or subtract) two matrices A and B, they must
be of the same order. If A and B are two matrices of the same order 𝑚 × 𝑛, then 𝐶 = 𝐴 ± 𝐵 gives
a matrix of the same order 𝑚 × 𝑛 such that each element of 𝐶 is the sum of the corresponding
elements of A and B. For examples:
1 0 3 0
i) If 𝐴 = [−3 2] , 𝐵 = [ 5 7]
5 1 −5 6
1 0 3 0 4 0
∴ 𝐴 + 𝐵 = [−3 2] + [ 5 7] = [ 2 9],
5 1 −5 6 0 7
1 0 3 0 −2 0
𝐴 − 𝐵 = [−3 2] − [ 5 7] = [−8 −5]
5 1 −5 6 10 −5

16
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

2 3 0 3 0 0
ii) If 𝐴 = [−1 4 0] , 𝐵 = [2 0 −1], then
3 2 1 4 2 1
2 3 0 3 0 0 1 0 0 4 3 0
𝐴 + 𝐵 − 𝐼 = [−1 4 0] + [2 0 −1] − [0 1 0] = [1 3 −1]
3 2 1 4 2 1 0 0 1 7 4 1
2 3 0 6 0 0 3 0 0 −1 3 0
𝐴 − 2𝐵 + 3𝐼 = [−1 4 0] − [4 0 −2] − [0 3 0] = [−5 7 2]
3 2 1 8 4 2 0 0 3 −5 −2 2

3. Multiplication of matrices: The product AB of two matrices A and B is defined if and only if
the number of columns of A = the number of rows of B. Consider a matrix A of order 𝑚 × 𝑟 and
a matrix B of order 𝑟 × 𝑛, then If 𝐶 = 𝐴𝐵
𝑟

∴ 𝑐𝑖𝑗 = ∑ 𝑎𝑖𝑘 𝑏𝑘𝑗


𝑘=1

Remarks:
(a) Suppose that the matrix product AB is defined (available). Then the product BA need not be
defined.
(b) Suppose that the matrix products 𝐴𝐵 and 𝐵𝐴 are defined, it is not necessary that 𝐴𝐵 = 𝐵𝐴.
For examples:
1
i). If 𝒂 = [3] , 𝒃 = [2 3 4]
2
1 1×2 1×3 1×4 2 3 4
∴ 𝒂𝒃 = [3] [2 3 4] = [ 3 × 2 3×3 3 × 4] = [6 9 12] ,
2 2×2 2×3 2×4 4 6 8
1
𝒃𝒂 = [2 3 4] [3] = [ 2 × 1 + 3 × 3 + 4 × 2] = [19]
2
Note that even the products ab and ba are available, the results of the product are different.

17
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 6 3
1 3 4
ii). If 𝐴 = [ ] , 𝐵 = [0 3 5]
2 0 8
2 1 1
1 6 3
1 3 4
∴ 𝐴𝐵 = [ ] [0 3 5]
2 0 8
2 1 1
1×1+3×0+4×2 1×6+3×3+4×1 1×3+3×5+4×1
=[ ]
2×1+0×0+8×2 2×6+0×3+8×1 2×3+0×5+8×1
9 19 22
=[ ]
18 20 14
Note that the product 𝐵𝐴 is not available (defined).
1 −1
−1 0
iii) If 𝐴 = [0 3 ] and 𝐵 = [ ], then
2 1
2 4
1 −1 1 × (−1) − 1 × 2 −1 × 0 − 1 × 1 −3 −1
−1 0
𝐴𝐵 = [0 3 ][ ] = [0 × (−1) + 3 × 2 0×0+3×1 ]= [ 6 3]
2 1
2 4 2 × (−1) + 4 × 2 2×0+4×1 6 4
Note that the product 𝐵𝐴 is not available (defined).

4. Transpose of a matrix: The transpose of an 𝑚 × 𝑛 matrix 𝐴 is denoted by 𝐴𝑇 and is obtained


by letting the rows to be the columns or vice-versa. Thus, the transpose of a row vector is a column
vector and vice-versa. For examples:
1
𝒂 = [ 0] ⇒ 𝒂 𝑇 = [1 0 5],
5
1 0
1 −3 5
𝐴 = [−3 2] ⇒ 𝐴𝑇 = [ ]
0 2 1
5 1
1 2 0 1 3 0
𝐴 = [3 1 0] ⇒ 𝐴𝑇 = [2 1 5]
0 5 1 0 0 1

18
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

5. Determinant of a square matrix: The determinant is a function that takes a square matrix as
an input and produces a scalar as an output. The determinant of a square matrix A is denoted by
det(A) or |𝐴| (note that |𝐴| is read as determinant of A and not, as modulus of A). The elements
of |𝐴| are the same elements of the matrix A with the same order, that is:
𝑎11 𝑎12 ⋯ 𝑎1𝑚 𝑎11 𝑎12 ⋯ 𝑎1𝑚
𝑎21 𝑎22 ⋯ 𝑎2𝑚 | 𝑎21 𝑎22 ⋯ 𝑎2𝑚 |
If 𝐴= then |𝐴| =
⋮ ⋮ ⋱ ⋮ | ⋮ ⋮ ⋱ ⋮ |
[𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑚 ] 𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑚

Invertible matrices
A square matrix 𝐴 of order 𝑛 is called invertible (or nonsingular) if there exists a square matrix 𝐵
of the same order such that 𝐴𝐵 = 𝐵𝐴 = 𝐼. The matrix 𝐵 is called a multiplicative inverse of 𝐴
and is denoted by 𝐴−1 . A matrix that does not have an inverse is called noninvertible (or singular).
If 𝐴 is invertible its inverse is also invertible and gives the matrix 𝐴 itself. Moreover, if 𝐴 and 𝐵
are two invertible matrices, their product 𝐴𝐵 is also invertible, with (𝐴𝐵)−1 = 𝐵−1 𝐴−1 . It is
worth to mention that not all matrices have inverses. Non-square matrices, for example, do not
have inverses by definition. The square matrix 𝐴 has inverse if |𝐴| ≠ 0.
For examples:
4 3 −2 3
1. The matrices 𝐴 = [ ] and 𝐵 =[ ] are invertible, because,
3 2 3 −4
4 3 −2 3 1 0 −2 3
4 3 1 0
𝐴𝐵 = [ ][ ]=[ ], 𝐵𝐴 = [ ][ ]=[ ].
3 2 3 −4 0 1 3 −4 3 2 0 1
12 6 1
− −
1 2 3 11 11 11
5 3 5
2. The matrices 𝐴 = [0 4 5] and 𝐵= −
22 22 22
1 0 6 2 1 2

[ 11 11 11 ]
are invertible, because:
12 6 1
− −
1 2 3 11 11 11 1 0 0
5 3 5
𝐴𝐵 = [0 4 5] − = [0 1 0],
22 22 22
1 0 6 2 1 2 0 0 1

[ 11 11 11 ]
19
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

12 6 1
− −
11 11 11 1 2 3 1 0 0
5 3 5
𝐵𝐴 = − [0 4 5] = [0 1 0]
22 22 22
2 1 2 1 0 6 0 0 1

[ 11 11 11 ]

In the following subjects we will show how to find the inverse of a square matrix.

Exercises
2 −13 −3 0
1. Find 2𝐴 + 3𝐵, 𝐴 − 2𝐵 for the matrices: 𝐴=[ ], 𝐵 = [ ]
0 −12 8 5
2. Find 2𝐴 + 3𝐵 − 5𝐼, −𝐵 + 𝐼 for the matrices:
2 5 0 0 1 0
𝐴 = [1 3 1] , 𝐵 = [1 2 4]
7 −2 4 5 4 2
3. Find the product of the matrices:
3 2 1 3 1 2 1
1 3 −1 0
(𝑖) [ ][ ], (𝑖𝑖) [−2] [2 1 3], (𝑖𝑖𝑖) [−1 3 0 ] [−3 0 1]
2 4 2 1
1 4 2 −1 1 3 3
1 2 2 −1 0 3
(iv) [ ][ ]
0 1 0 3 2 −1
1 2 −1 2
3. Show that matrices 𝐴 = [ ] and 𝐵 = [ ] are invertible.
1 1 1 −1
2 −1 3 −7 −9 10
4. Show that matrices 𝐴 = [−5 3 1] and 𝐵 = [−12 −15 17 ] are invertible.
−3 2 3 1 1 −1

20
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Systems of linear equations and matrix equation


As we know, system of 𝑛 linear equations in 𝑛 unknowns 𝑥1 , 𝑥2 ,  ⋯ , 𝑥𝑛 is a set of equations of the
form:
𝑎11 𝑥1   +  𝑎12 𝑥2   +   ⋯   +  𝑎1𝑛 𝑥𝑛   =  𝑏1  
𝑎21 𝑥1   + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛   =  𝑏2  

                                           ⋮      
𝑎𝑛1 𝑥1   +  𝑎𝑛2 𝑥2   +   ⋯   +  𝑎𝑛𝑛 𝑥𝑛   =  𝑏𝑛
where 𝑎𝑖𝑗 , 𝑏𝑗 are real numbers.
The above system of equations can be written in a matrix equation as:
𝐴𝐱  =  𝐛                                                                                                       (2)
Where:
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑏1 𝑥1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑏2 𝑥2
𝐴= , 𝒃= , 𝒙=
⋮ ⋮ ⋱ ⋮ ⋮ ⋮
[𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 ] [𝑏𝑛 ] [𝑥𝑛 ]
The matrix 𝐴 is the coefficient matrix, 𝒃 is the column representing the constants (constants
matrix), and 𝒙 is the column representing the unknowns.

The augmented matrix for a system of linear equations


The augmented matrix corresponding to the system of 𝑛 linear algebraic equations (1) is given by
the 𝑛 × (𝑛 + 1) matrix:
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑏1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 | 𝑏2
[𝐴\𝒃] = (3)
⋮ ⋮ ⋱ ⋮ | ⋮
[𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑏𝑛 ]
Each row of the augmented matrix represents one equation of the system. In each row, the
coefficient of 𝑥1 is in the first column, the coefficient of 𝑥2 is in the second column, the coefficient
of 𝑥𝑘 is in the 𝑘 𝑡ℎ column, and the constants are in the last column.
Elementary matrix row operations:
For an augmented matrix, there are three kinds of elementary row operations on matrices:
a) Interchanging two rows.

21
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

b) Multiplying all (elements) of one row by a nonzero constant.


c) Adding a multiple of one row to another row.
We will use a symbolic shorthand to describe these row operations:
1. 𝑅𝑖 ↔ 𝑅𝑗 : Interchanging the rows 𝑖 and 𝑗.
2. 𝛼𝑅𝑖 : Multiply row 𝑖 by the nonzero scalar 𝛼.
3. 𝛼𝑅𝑖 + 𝑅𝑗 : Multiply row 𝑖 by the scalar 𝛼 and add to row 𝑗.
An elementary row operation on an augmented matrix produces a new augmented matrix
corresponding to a new (but equivalent to the original linear system) system of linear equations.
Two equivalent systems have the same set of solutions. Whenever a linear system has an infinite
number of solutions, it is possible to obtain a parametric description of the solution set by row
reducing the associated augmented matrix.

Remember that: Possibility of solving a system of linear equations can be recognized as:
For a homogeneous system of linear equations either
(1) the system has only the trivial solution (zeros);
(2) the system has an infinite number of solutions.
For a non-homogeneous system either
(1) the system has a single (unique) solution.
(2) the system has an infinite number of solutions.
(3) the system has no solution at all.

22
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Matrix solution of linear system of equations


We now come to one of the most important use of matrices, that is, using matrices to solve linear
systems of equations. If the coefficient matrix 𝐴 is invertible, we can use its inverse to solve the
system (1) as we will see after below. Many of the matrix solution methods depend on what we
call augmented matrices and the elementary matrix row operations.

Gauss Elimination method


This method is based on transforming the augmented matrix [𝐴\𝒃] into a triangular one; write
down the corresponding linear system of equations, which can be easily solved by back
substitution. In the present approach, we use the upper triangular matrix. The element we use to
make the elements below, in the same column, zeros is called pivot element (or leading for that
row) and its row is called pivot row. If the pivot element is zero, we must interchange that pivot
row with one below to obtain non-zero pivot. So that all rows consisting entirely of zeros occur at
the bottom of the matrix.
Suppose that, applying the elementary row operation on the augmented matrix [𝐴\𝒃] gives the
matrix [𝐶\𝒅] such that:
𝑐11 𝑐12 ⋯ 𝑐1𝑛 𝑑1
0 𝑐22 ⋯ 𝑐2𝑛 | 𝑑2
[𝐶\𝒅] = (4)
⋮ ⋮ ⋱ ⋮ | ⋮
[0 0 ⋯ 𝑐𝑛𝑛 𝑑𝑛 ]
Important remarks:
1. If no one of the pivots 𝑐11 , 𝑐22 , 𝑐33 , ⋯ , 𝑐𝑛𝑛 equals zero, we say that: rank of the coefficient
matrix 𝐴 = rank of augmented matrix [𝐴\𝒃] = number of unknowns. In this case, the system of
equation has unique solution which is the zero solutions for the homogeneous system and is the
solution of the equivalent linear system:
𝑐11 𝑥1 + 𝑐12 𝑥2 + 𝑐13 𝑥3 + ⋯ + 𝑐1𝑛 𝑥𝑛 = 𝑑1
𝑐22 𝑥2 + 𝑐23 𝑥3 + ⋯ + 𝑐2𝑛 𝑥𝑛 = 𝑑2
(5)
⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯
𝑐𝑛𝑛 𝑥𝑛 = 𝑑𝑛 }
which can be easily solved by back substitution in which we evaluate xn from the last equation,
and then evaluate 𝑥𝑛−1 using 𝑥𝑛 and so on. Practically, it is better to begin with the equation
23
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

corresponding to the last row in the row reduced form.


2. If the values of all elements (entries) of the last row(s) of the equivalent augmented matrix
[𝐶\𝒅] are zeros, we say that: rank of the coefficient matrix 𝐴 = rank of augmented matrix [𝐴\𝒃]
< number of unknowns, and the system has an infinite number of solutions and the variable(s)
associated to the zero pivot is (are) a free variable(s), so it (they) can be set arbitrarily.
3. If the values of all elements (entries) of the last row(s) of the reduced matrix 𝐶 are zeros but
the associated element in 𝒅 is nonzero (is a false statement), we say that: rank of the coefficient
matrix 𝐴 < rank of augmented matrix [𝐴\𝒃], and the system has no solution.

Example 1:
Using Gauss Elimination method, discuss the solution of the system of equations:
 𝑥  +  𝑦  −  𝑧  = −2,         2𝑥  −  𝑦  +  𝑧  =  5,        − 𝑥  +  2𝑦  +  2𝑧  =  1
Solution: The augmented matrix corresponding to the system is:
1 1 −1 −2
[𝐴|𝒃] = [ 2 −1 1|5]
−1 2 2 1
Now we want zeros for the elements in the first column below the pivot 1. The first zero can be
obtained by multiplying the first row by (−2) and adding the results to the second row. The second
zero can be obtained by adding the first row to the third row, note that the first row is unchanged.
We use elementary row operations to obtain the reduced form as follows:
1 1 −1 −2 1 1 −1 −2
2𝑅1 + 𝑅2 → 𝑅2
[𝐴|𝒃] = [ 2 −1 1 | 5 ]→ [0 −3 3|9]
𝑅1 + 𝑅3 → 𝑅3
−1 2 2 1 0 3 1 −1
1 1 −1 −2
𝑅2 + 𝑅3 → 𝑅3
→ [0 −3 3|9]
0 0 4 8
Thus, the system has a unique solution:
4𝑧 = 8    ⇒    𝑧 = 2,      − 3𝑦 + 3𝑧 =  9      ⇒     𝑦  =   − 1,     𝑥 + 𝑦 − 𝑧 = −2     ⇒    𝑥  =  1

Example 2:
Using Gauss Elimination method, discuss the solution of the system of equations:
3𝑥  +  4𝑦  +  4𝑧  =  7,     𝑥  −  𝑦  −  2𝑧  =  2,        2𝑥  −  3𝑦  +  6𝑧  =  5
24
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Solution: It is better to rearrange the given equations to be


 𝑥  −  𝑦  −  2𝑧  =  2,            3𝑥  +  4𝑦  +  4𝑧  =  7,            2𝑥  −  3𝑦  +  6𝑧  =  5
The augmented matrix corresponding to the system is:
1 −1 −2 2 1 −1 −2 2
−3𝑅1 + 𝑅2 → 𝑅2
[𝐴|𝒃] = [3 4 4 |7] → [0 7 10 | 1]
−2𝑅1 + 𝑅3 → 𝑅3
2 −3 6 5 0 −1 10 1
1 1 −1 −2 2
𝑅2 + 𝑅3 → 𝑅3 10 1
7 0 1
→ 7 |7
80 5
[0 0
7 7]

Thus, the system has a unique solution:


1 10 1 3 61
𝑧= ,      𝑦 + 𝑧 =       ⇒     𝑦  = ,     𝑥 − 𝑦 − 2𝑧 = 2     ⇒    𝑥  =  
16 7 7 56 28
Example 3:
Using Gauss Elimination method, discuss the solution of the system of equations:
  𝑥  −  3𝑦  +  𝑧  =  1,      2𝑥  −  𝑦  −  2𝑧  =  2,       𝑥  + 2 𝑦  −  3𝑧  =   − 1 
Solution:
The augmented matrix corresponding to the system is:
1 −3 1 1 1 −3 1 1
−2𝑅1 + 𝑅2
[𝐴|𝒃] = [2 −1 −2| 2 ] → [0 5 −4| 0 ]
−𝑅1 + 𝑅3
1 2 −3 −1 0 5 −4 −2
1 −3 1 1
−𝑅2 + 𝑅3
→ [0 5 −4| 0 ]
0 0 0 −2
Because the third equation is a false statement, the system has no solution.
Example 4:
Using Gauss Elimination method, discuss the solution of the system of equations:
𝑦  −  𝑧  =  0,    𝑥  −  3𝑧  =   − 1,      − 𝑥  +  3𝑦  =  1
Solution: The augmented matrix corresponding to the system is:
0 1 −1 0 1 0 −3 −1
𝑅1 ↔ 𝑅2
[𝐴|𝒃] = [ 1 0 −3|−1] → [0 1 −1| 0 ]
−1 3 0 1 −1 3 0 1

25
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 0 −3 −1 1 0 −3 −1
𝑅1 + 𝑅3 −3𝑅2 + 𝑅3
→ [0 1 −1| 0 ] → [0 1 −1| 0 ]
0 3 −3 0 0 0 0 0
We see that the elements of the third row are zeros, then the system has an infinite number of
solutions. Since the pivot of the third column is zero, then we choose 𝑧 to be the free variable
(arbitrary) and represent it by the parameter 𝑧  =  𝑐. The first and second rows give:
𝑧  =  𝑐,         𝑦  −  𝑧  =  0      ⇒    𝑦  =  𝑐,       𝑥  −  3𝑧  =   − 1,      𝑥  =  3𝑐  −  1,
where 𝑐 is any real number.
Example 5:
Using Gauss Elimination method, discuss the solution of the system of equations:
4𝑥  +  2𝑦  −  𝑧  =  5  ,      3𝑥  −  𝑦  +  𝑧  =   − 2,      𝑥  +  𝑦  −  𝑧  =  0 
Solution: It is better to rearrange the given equations and the augmented matrix becomes:
1 1 −1 0 1 1 −1 0
−4𝑅1 + 𝑅2
[𝐴|𝒃] = [4 2 −1| 5 ] → [0 −2 3|5]
−3𝑅1 + 𝑅3
3 −1 1 −2 0 −4 4 −2
1 1 −1 0
−2𝑅2 + 𝑅3
→ [0 −2 3| 5 ]
0 0
−2 −12
13 1
∴ −2𝑧 = −12     ⇒    𝑧 = 6,   − 2𝑦 + 3𝑧 = 5    ⇒    𝑦 =   ,     𝑥 + 𝑦 − 𝑧 = 0    ⇒   𝑥 = −
2 2
Example 6:
Using Gauss Elimination method, discuss the solution of the system of equations:
5𝑥  −  2𝑦   + 𝑧  =  5 ,      𝑥  −  𝑦  −  𝑧  =  0,    2𝑥  −  𝑦  +  3𝑧  =   − 1 
Solution: It is better to rearrange the given equations and the augmented matrix becomes:
1 −1 −1 0 1 −1 −1 0
−5𝑅1 + 𝑅2
[𝐴|𝒃] = [5 −2 1 | 5 ]→ [0 3 6|5]
−2𝑅1 + 𝑅3
2 −1 3 −1 0 1 5 −1
1 0
− 𝑅2 + 𝑅3 1 −1 −1
3
→ [0 3 6| 5 ]
3 −8/3 0 0
8 8 31 23
∴ 3𝑧 = − ⇒ 𝑧 = − , 3𝑦 + 6𝑧 = 5 ⇒ 𝑦 = , 𝑥−𝑦−𝑧 =0 ⇒ 𝑥 =
3 9 9 9
26
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Example 7:
Using Gauss Elimination method, discuss the solution of the system of equations:
−𝑥  +  𝑦   + 𝑧  =  0 ,      3𝑥  −  𝑦  =  0,    2𝑥  −  4𝑦  −  5𝑧  =  0
Solution: The augmented matrix corresponding to the homogenous system is:
−1 1 1 0 −1 1 1 0
3𝑅1 + 𝑅2
[𝐴|𝒃] = [ 3 −1 0 |0] → [0 2 3 |0]
2𝑅1 + 𝑅3
2 −4 −5 0 0 −2 −3 0
−1 1 10
𝑅2 + 𝑅3
→ [0 2 3|0]
0 0 00
We see that the elements of the third row are zeros, then the system has an infinite number of
solutions. Since the pivot of the third column is zero and there is no rows below to interchange,
then we choose 𝑧 to be the free variable (arbitrary) and represent it by the parameter 𝑧  =  𝑐. The
first and second rows give:
3 1
𝑧  =  𝑐,         2𝑦  +  3𝑧  =  0      ⇒    𝑦  =   − 𝑐,        − 𝑥  +  𝑦  +  𝑧  =  0,      𝑥  =   − 𝑐
2 2
Example 8:
Using Gauss Elimination method, discuss the solution of the system of equations:
𝑥  +  𝑦   + 𝑧  =  0 ,      𝑥  −  𝑦  +  2𝑧  =  0,      2𝑥  −  𝑦  −  𝑧  =  0
Solution:
The augmented matrix corresponding to the homogenous system is:
1 1 1 0 1 1 1 0
−𝑅1 + 𝑅2
[𝐴|𝒃] = [1 −1 2 |0] → [0 −2 1 |0]
−2𝑅1 + 𝑅3
2 −1 −1 0 0 −3 −3 0
3 1 1 1 0
− 𝑅2 + 𝑅3
2
→ [0 −2 1 |0]
0 0 −9/2 0
Then, the system has the zero solution as a unique solution: 𝑥  =  𝑦  =  𝑧  =  0

27
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Gauss–Jordan Elimination method


Another version of Gauss-Elimination method is Gauss–Jordan Elimination method. In this
method, we use the matrix row operations to convert the augmented matrix into the form
[𝐶\𝒅] where 𝐶 is a diagonal matrix (may be the identity matrix 𝐼), and 𝒅 = [𝑑1 , 𝑑2 , ⋯ , 𝑑𝑛 ]𝑇 .
That is;
𝑐11 0 ⋯ 0 𝑑1
0 𝑐22 ⋯ 0 | 𝑑2
[𝐶\𝒅] =
⋮ ⋮ ⋱ ⋮ | ⋮
[ 0 0 ⋯ 𝑐𝑛𝑛 𝑑𝑛 ]
𝑑𝑘
Then we obtain the solution directly as 𝑥𝑘 = , 𝑘 = 1, 2, ⋯ , 𝑛.
𝑐𝑘𝑘

Remark:
If 𝑐𝑘𝑘 ≠ 0, 𝑘 = 1,2, ⋯ , 𝑛 the system of equations has unique solution. Otherwise, the system
may have an infinite number of solutions or has no solution according to the zero rows in the
matrices 𝐶 and [𝐶\𝒅], by the same manner in Gauss-Elimination method.
Example 1:
Using Gauss – Jordan Elimination method, discuss the solution of the system of equations:
𝑥  +  𝑦  +  𝑧  =  0,    𝑥  −  2𝑦  +  2𝑧  =  4,     𝑥  +  2𝑦  −  𝑧  =  2 
Solution:
We begin by writing the system as an augmented matrix:
1 1 1 0 1 1 1 0
−𝑅1 + 𝑅2
[𝐴|𝒃] = [1 −2 2 |4] → [0 −3 1 |4]
−𝑅1 + 𝑅3
1 2 −1 2 0 1 −2 2
1 1 1 0 1 0 3 −2
𝑅2 ↔ 𝑅3 −𝑅2 + 𝑅1
→ [0 1 −2|2] → [0 1 −2| 2 ]
3𝑅2 + 𝑅3
0 −3 1 4 0 0 −5 10
1
− 𝑅3 1 0 3 −2
−3𝑅3 + 𝑅1
1 0 0 4
5
→ [0 1 −2| 2 ] → [0 1 0|−2]
2𝑅3 + 𝑅2
0 0 1 −2 0 0 1 −2
Thus, the solution is: 𝑥  =  4,   𝑦  =   − 2,    𝑧  =   − 2

28
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Example 2:
Using Gauss – Jordan Elimination method, discuss the solution of the system of equations:
4𝑥  +  3𝑦  +  5𝑧  =  3,         2𝑥  +  𝑦  +  3𝑧  =  1,           𝑥  +  5𝑦  +  6𝑧  =  4
Solution:
It is better to rearrange the given equations and the augmented matrix becomes:
1 5 64 1 5 6 4
−2𝑅1 + 𝑅2
[𝐴|𝒃] = [2 1 3|1] → [0 −9 −9 | −7 ]
−4𝑅1 + 𝑅3
4 3 53 0 −17 −19 −13
1
−1 1 5 6 4 1 0 1 9
𝑅2 −5𝑅2 + 𝑅1 7
9 7
→ [0 1 1 | ]→ 0 1 1 || 9
9 17𝑅2 + 𝑅3
2
0 −17 −19 −13 [0 0 −2 ]
9
2
1 1 0 0
𝑅 + 𝑅1 9
2 3 8

1
0 1 0 || 9
𝑅3 + 𝑅2 2
[0 0 −2
2
9 ]
Thus, the solution is: 𝑥  =  2/9,   𝑦  =  8/9,    𝑧  =   − 1/9

Example 3:
Using Gauss – Jordan Elimination method, discuss the solution of the system of equations:
 𝑥  −  11𝑦  +  4𝑧  =  3,  2𝑥  +  4𝑦  −  𝑧  =  7,          5𝑥  −  3𝑦  + 2 𝑧  =  3
Solution: We begin by writing the system as an augmented matrix:
1 −11 4 3 1 −11 4 3
−2𝑅1 + 𝑅2
[𝐴|𝒃] = [2 4 −1|7] → [0 26 −9 | 1 ]
−5𝑅1 + 𝑅3
5 −3 2 3 0 52 −18 −12
5 89
11
𝑅2 + 𝑅1 1 0 26
26
26
→ [0 26 −9| 1 ]
−2𝑅2 + 𝑅3
0 0 0 −14
Because the third “equation” is a false statement, the system has no solution.

Example 4:
Using Gauss – Jordan Elimination method, discuss the solution of the system of equations:
2𝑥  +  3𝑧  =  0,        4𝑥  −  3𝑦  +  7𝑧  = 0,       8𝑥  −  9𝑦  +  15𝑧  =  0 

29
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Solution:
We begin by writing the system as an augmented matrix:
2 0 3 0 2 0 30
−2𝑅1 + 𝑅2
[𝐴|𝒃] = [4 −3 7 |0] → [0 −3 1|0]
−4𝑅1 + 𝑅3
8 −9 15 0 0 −9 30
2 0 30
−3𝑅2 + 𝑅3
→ [0 −3 1|0]
0 0 00
We see that the elements of the third row are zeros, then the system has an infinite number of
solutions. Since the pivot of the third column is zero and there is no rows below to interchange,
then we choose 𝑧 to be the free variable (arbitrary) and represent it by the parameter 𝑧  =  𝑐. The
first and second rows give:
𝑐 3𝑐
𝑧  =  𝑐,          − 3𝑦  +  𝑧  =  0      ⇒    𝑦  =   ,       2𝑥  +  3𝑧  =  0,      𝑥  =   −
3 2
where 𝑐 is any real number.

30
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Inverse of Matrices
There are two ways to obtain the inverse of a square matrix. The first depends on using the
elementary row operations to determine the inverse of a matrix, and the second depends on using
the determinants and the adjoint on the matrix. Note that the inverse of a matrix is unique. which
means that there is only one inverse matrix (if exists). That’s why we say “the” inverse matrix of
𝐴 and denote it by 𝐴−1 .

The inverse of a matrix using the elementary row operations


Starting with the augmented matrix [𝐴|𝐼] and using the elementary row operations to obtain the
equivalent matrix [𝐼|𝐴−1 ], where 𝐼 is the identity matrix of the same order of the matrix 𝐴.
Remember that that the inverse of a matrix is unique. which means that there is only one inverse
matrix (if exists).
1 3 3
Example 1: Find the inverse of the matrix (if it exists): 𝐴 = [1 4 3]
1 3 4
Solution: The augmented matrix is
1 3 31 0 0 1 3 3 1 0 0
−𝑅1 + 𝑅2
[𝐴|𝐼] = [1 4 3|0 1 0] → [0 1 0|−1 1 0]
−𝑅1 + 𝑅3
1 3 40 0 1 0 0 1 −1 0 1
1 0 3 4 −3 0 1 0 0 7 −3 −3
−3𝑅2 + 𝑅1 −3𝑅3 + 𝑅1
→ [0 1 0|−1 1 0] → [0 1 0|−1 1 0]
0 0 1 −1 0 1 0 0 1 −1 0 1
7 −3 −3
∴ 𝐴−1 = [−1 1 0]
−1 0 1
2 0 3
Example 2: Find the inverse of the matrix (if it exists): 𝐴 = [4 −3 7]
8 −9 15
Solution: The augmented matrix is
2 0 3 1 0 0 2 0 3 1 0 0
−2𝑅1 + 𝑅2
[𝐴|𝐼] = [4 −3 7 |0 1 0] → [0 −3 1|−2 1 0]
−4𝑅1 + 𝑅3
8 −9 15 0 0 1 0 −9 3 −4 0 1
31
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

2 0 3 1 0 0
−3𝑅2 + 𝑅3
→ [0 −3 1|−2 1 0]
0 0 0 2 −3 1
Thus, the given matrix has no inverse.

The inverse of a matrix and determinants


If the determinant of the matrix is zero, then it will not have an inverse, and the matrix is said to
be singular. Only non-singular matrices have inverses. Given any non-singular matrix 𝐴, its
inverse can be found from the formula:
𝑎𝑑𝑗𝐴
𝐴−1 = , |𝐴| ≠ 0 (6)
|𝐴|
where 𝑎𝑑𝑗𝐴 is the adjoint matrix and |𝐴| is the determinant of the matrix 𝐴. The procedure for
finding the adjoint matrix is given below.

Finding the adjoint matrix:


The adjoint of a matrix 𝐴 is the transpose of the cofactor matrix of 𝐴. The cofactor matrix [𝐴𝑖𝑗 ] of
𝐴 is the matrix formed by replacing each element of 𝐴 by its cofactor. The cofactor of any element
is found by taking its minor and imposing a place sign (−1)𝑖+𝑗 . The minor of any element is found
by covering up the elements in its row and column and finding the determinant of the remaining
𝑇
matrix. Therefor, 𝐴𝑑𝑗𝐴 = [𝐴𝑖𝑗 ] .

Example 3:
Using the determinants, find the inverse of the matrices:
4 0 0 4 2 3
2 1
(𝑖) 𝐴 = [ ] (𝑖𝑖) 𝐵 = [0 6 2] (𝑖𝑖𝑖)𝐶 = [7 5 4]
0 4
2 0 1 9 2 6
Solution:
2 1
(𝑖) |𝐴| = | |=8≠0
0 4
4 0 𝑇 4 −1
[𝐴𝑖𝑗 ] = [ ] ⇒ 𝐴𝑑𝑗𝐴 = [𝐴𝑖𝑗 ] = [ ]
−1 2 0 2

32
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 1
𝐴𝑑𝑗𝐴 1 4 −1 −
∴ 𝐴−1 = = [ ] = [2 8]
|𝐴| 8 0 2 1
0
4
4 0 0
(𝑖𝑖)|𝐵| = |0 6 2| = 24 ≠ 0
2 0 1
6 2 0 2 0 6
+| | −| | +| |
0 1 2 1 2 0 6 4 −12
0 0 4 0 4 0
[𝐵𝑖𝑗 ] = − | | +| | −| | = [0 4 0 ]
0 1 2 1 2 0
0 0 4 0 4 0 0 −8 24
+| | −| | +| |
[ 6 2 0 2 0 6]
6 0 0
⇒ 𝐴𝑑𝑗𝐵 = [ 4 4 −8]
−12 0 24
1
0 0
6 0 0 4
𝐴𝑑𝑗𝐵 1 1 1 −1
∴ 𝐵−1 = = [ 4 4 −8] =
|𝐵| 24 6 6 3
−12 0 24 −1
[2 0 1]

4 2 3
5 4 7 4 7 5
(𝑖𝑖𝑖) |𝐶| = |7 5 4| = 4 | | − 2| | + 3| | = −17 ≠ 0
2 6 9 6 9 2
9 2 6
5 4 7 4 7 5
+| | −| | +| |
2 6 9 6 9 2 22 −6 −31
2 3 4 3 4 2
[𝐶𝑖𝑗 ] = − | | +| | −| | = [−6 −3 10 ]
2 6 9 6 9 2
2 3 4 3 4 2 −7 5 6
+| | −| | +| |
[ 5 4 7 4 7 5]
22 −6 −7
⇒ 𝐴𝑑𝑗𝐶 = [ −6 −3 5]
−31 10 6

33
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

22 6 7

22 −6 −7 17 17 17
𝐴𝑑𝑗𝐶 −1 6 3 5
∴ 𝐶 −1 = = [ −6 −3 5 ]= −
|𝐶| 17 17 17 17
−31 10 6 31 10 6
[ 17 − − ]
17 17

Exercise:
Using determinants, find the inverse of the matrices:
1 −2 0 1 3 2
3 2
(i) 𝐴 = [ ] (ii) 𝐵 = [ 3 1 5] (iii) 𝐶 = [ 0 5 1]
−1 4
−1 2 3 −1 3 0

Invertible matrices method


If we write the system of equations (1) in a matrix equation 𝐴𝒙 = 𝒃 then we multiply both sides
by 𝐴−1 , where 𝐴−1 𝐴 = 𝐼, 𝐼𝐴−1 𝒙 = 𝒙, we obtain:
𝒙 = 𝐴−1 𝒃 (7)
The system has a single solution (which is the trivial solution, zeros, for a homogeneous system
of linear equations) if 𝐴−1 exists. Otherwise, the system may have an infinite number of solutions
or has no solution at all, which may be verified by using Gauss-Elimination method.

Example 4:
Use inverse of matrices method to solve the following equations (if it is possible):
  2𝑥  +  𝑦  +  5𝑧  =  4,       − 2𝑥  +  𝑦  −  3𝑧  =   − 2,       2𝑥  −  𝑦  =   − 1 
Solution: The augmented matrix is
2 1 5 1 0 0 2 1 5 1 0 0
𝑅1 + 𝑅2
[𝐴|𝐼] = [−2 1 −3|0 1 0] → [0 2 2|1 1 0]
−𝑅1 + 𝑅3
2 −1 0 0 0 1 0 −2 −5 −1 0 1

1 2 0 4 1

1
0 4
− 𝑅2 + 𝑅1 2 2 𝑅 + 𝑅1
2 3 3
→ [0 2 2 |1 1 0] →
𝑅2 + 𝑅3 2
𝑅3 + 𝑅2
0 0 −3 0 1 1 3

34
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 5 2
2 0 0 1 5 4 1 1
2 6 3 𝑅1 , 𝑅2 1 0 0 4 12 3
2 2 1 5 1
0 2 0 |1 5 2 →
1
0 1 0|| 2 6 3
3 3 − 𝑅3 0 0 1 1 1
[0 0 −3 0 1 1] 3
[ 0 −
3
− ]
3

1 5 2
4 12 3
1 5 1
∴ 𝐴−1 =
2 6 3
1 1
[0 −
3
− ]
3
1 𝑥 5 2 4 1
4 12 3 −
2
1 5 1
⇒ 𝑦 = −2 = 0
2 6 3
1 1
[𝑧] [ 0 − − ] [−1] [ 1 ]
3 3
−1
   ∴   𝑥  =   ,    𝑦  =  0,    𝑧  =  1
2
Example 5:
Use inverse of matrices method to solve the following equations (if it is possible):
𝑥  +  𝑦  +  𝑧  =  1,    𝑥  −  2𝑦  +  2𝑧  =  4,     𝑥  +  2𝑦  −  𝑧  =  2 
Solution: The augmented matrix is
1 1 1 1 0 0 1 1 1 1 0 0
−𝑅1 + 𝑅2
[𝐴|𝐼] = [1 −2 2 |0 1 0] → [0 −3 1 |−1 1 0]
−𝑅1 + 𝑅3
1 2 −1 0 0 1 0 1 −2 −1 0 1
4 2 1
1 1 0 0 4
𝑅 + 𝑅1 3 3 3 𝑅 + 𝑅1
3 2 5 3
→ 0 −3 1 ||−1 1 0 →
1 3
𝑅2 + 𝑅3 5 4 1 𝑅3 + 𝑅3
3
[0 0 − −
3 3 3
1] 5

2 3 4 2 3 4
1 0 0 − 1 1 0 0 −5
5 5 5 − 𝑅2 5 5
0 ||− 9 6 3 3 3 2 1
0 −3
5 5 5

3
0 1 0|| 5 −
5

5
0 0
5
− −4 1 − 𝑅3 4 1 3
[0 0 1
1] 5 − − ]
[ 3 3 3 5 5 5

35
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

2 3 4

5 5 5
3 2 1
∴ 𝐴−1 = − −
5 5 5
4 1 3
[ 5 − −
5 5]
𝑥 2 3 4 1 18

5 5 5 5
3 2 1 7
⇒ 𝑦 = − − 4 = −
5 5 5 5
4 1 3 6
[𝑧 ] [ − − ] [2] [ − ]
5 5 5 5
18 7 6
   ∴   𝑥  =   ,     𝑦  =   −   ,       𝑧  =   −  
5 5 5
Example 6:
Use inverse of matrices method to solve the following equations (if it is possible):
4𝑥  +  2𝑦  + 3 𝑧  =  2  ,      7𝑥  + 5𝑦  + 4 𝑧  =  1,     9 𝑥  + 2 𝑦  + 6 𝑧  =  0 
Solution: First, we have to obtain the inverse of the coefficient matrix:
4 2 3
𝐴 = [7 5 4]
9 2 6
Using the determinants technique, we have:
4 2 3
5 4 7 4 7 5
|𝐴| = |7 5 4| = 4 | | − 2| |+3| | = −17 ≠ 0
2 6 9 6 9 2
9 2 6
5 4 7 4 7 5
+| | −| | +| |
2 6 9 6 9 2 22 −6 −31
2 3 4 3 4 2
[𝐴𝑖𝑗 ] = − | | +| | −| | = [−6 −3 10 ]
2 6 9 6 9 2
2 3 4 3 4 2 −7 5 6
+| | −| | +| |
[ 5 4 7 4 7 5]

22 −6 −7
⇒ 𝐴𝑑𝑗𝐴 = [ −6 −3 5]
−31 10 6

36
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

22 −6 −7
𝐴𝑑𝑗𝐶 −1
∴ 𝐴−1 = = [ −6 −3 5]
|𝐶| 17
−31 10 6
𝑥 22 6 7 2 38
− −
17 17 17 17
6 3 5 15
⇒ 𝑦 = − 1 =
17 17 17 17
31 10 6 52
[𝑧 ] [ − − ][ 0 ] [
17 17 17 17 ]
38 15 52
   ∴    𝑥  =   − ,       𝑦  =    ,        𝑧  =
17 17 17

Exercises
Using Gauss elimination, Gauss - Jordan elimination methods, and inverse of matrices find all
solutions of each of the following systems or indicate that no solution exists.
1) 𝑥 + 𝑦 + 𝑧 = 1, 𝑥 − 2𝑦 + 2𝑧 = 4, 𝑥 + 2𝑦 − 𝑧 = 2
2) 2𝑥 + 𝑦 + 5𝑧 = 10, 𝑥 − 3𝑦 − 𝑧 = −2, 2𝑥 − 𝑦 + 3𝑧 = 6
3) 12𝑥 + 7𝑦 + 3𝑧 = 2, 𝑥 + 5𝑦 + 2𝑧 = −5, 2𝑥 + 7𝑦 − 11𝑧 = 6
4) 𝑥 + 𝑦 − 𝑧 = −1, 𝑥 + 𝑧 = 3, 3𝑥 + 2𝑦 − 𝑧 = 1
5) 3𝑥 − 𝑦 + 2𝑧 = 1, 2𝑥 − 2𝑦 + 3𝑧 = 2, 𝑥 + 2𝑦 − 𝑧 = 3
6) 2𝑥 − 𝑦 + 5𝑧 = 4, − 6𝑥 + 3𝑦 − 9𝑧 = −6, 4𝑥 − 2𝑦 = −2
7) 2𝑥 − 𝑦 + 5𝑧 = 4, − 2𝑥 + 𝑦 − 3𝑧 = −2, 2𝑥 − 𝑦 = −1
8) 4𝑥 − 𝑦 + 2𝑧 = 0, 2𝑥 + 3𝑦 − 𝑧 = 0, 3𝑥 + 𝑦 + 𝑧 = 0
9) 2𝑥 − 𝑦 + 5𝑧 = 0, − 2𝑥 + 𝑦 − 3𝑧 = 0, 2𝑥 − 𝑦 = 0
10) 2𝑥 + 3𝑧 = 3, 4𝑥 − 3𝑦 + 7𝑧 = 5, 8𝑥 − 9𝑦 + 15 = 10

37
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

LU - decomposition method
The system of equations (1) can be written in the matrix equation 𝐴𝒙 = 𝒃, where:
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1 𝑏1
𝑎21 𝑎22 ... 𝑎2𝑛 𝑥2 𝑏2
𝐴= , 𝒙= , 𝒃=
⋮ ⋮ ⋱ ⋮ ⋮ ⋮
[𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 ] [𝑥𝑛 ] [𝑏𝑛 ]
In the LU decomposition method the coefficient matrix 𝐴 (a non-singular matrix) is decomposed
into a product of a lower triangular matrix 𝐿 and an upper triangular matrix 𝑈, i.e., 𝐴 = 𝐿𝑈.
A version of expressing the LU matrices explicitly, they look like:
1 0 ⋯ 0 𝑢11 𝑢12 ⋯ 𝑢1𝑛
𝑙21 1 ... 0 0 𝑢22 ... 𝑢2𝑛
𝐿= , 𝑈=
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
[𝑙𝑛1 𝑙𝑛2 ⋯ 1] [ 0 0 ⋯ 𝑢𝑛𝑛 ]
The LU decomposition is not always guaranteed. It is guaranteed only when the leading principal
minors of the coefficient matrix are not zeros.
Leading Principal Minors of A square Matrix
Each square 𝑛 × 𝑛 matrix has 𝑛 leading principal minors. A leading principal minor is the
determinant of the leading principal submatrix obtained by deleting the last 𝑛 − 𝑘 rows and
columns of the matrix, 𝑘 = 1, 2, 3, ⋯ , 𝑛. The leading principal minors of a matrix 𝐴 starts by |𝑎11 |
and ends by |𝐴|.
7 6 3
For example: the matrix 𝐴 = [−5 4 5 ] has three leading principal minors:
1 0 6
1. |7| formed by deleting the last two rows and columns of 𝐴.
7 6
2. | | formed by deleting the last row and column of 𝐴.
−5 4
7 6 3
3. |−5 4 5 | formed by the determinant of the matrix, which is |𝐴|.
1 0 6
Hint: Sometimes it is needed to rearrange the given equations to guarantee the nonzero leading
principal minors of the coefficient matrix, which makes the LU decomposition method applicable.

38
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Decomposing the coefficient matrix into LU matrices gives:

𝑎11 𝑎12 ⋯ 𝑎1𝑛 1 0 ⋯ 0 𝑢11 𝑢12 ⋯ 𝑢1𝑛


𝑎21 𝑎22 ... 𝑎2𝑛 𝑙21 1 ... 0 0 𝑢22 ... 𝑢2𝑛
= (8)
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
[𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 ] [𝑙𝑛1 𝑙𝑛2 ⋯ 1] [ 0 0 ⋯ 𝑢𝑛𝑛 ]

However, to perform the calculations of the 𝐿 and 𝑈 matrices. First, we obtain the product matrix
𝐿𝑈 and equating the elements of its first row by those of the first row in the 𝑈 matrix to get the
first row in the upper matrix 𝑈. Equating the second rows in both sides yields the second row in
each of the matrices 𝐿 and 𝑈. By the same way we can find all the elements of the matrices 𝐿 and
𝑈.
However, we can write the results of the process of equating the two matrices in both sides of (8)
as the following equations:
𝑎11 = 𝑢11 , 𝑎12 = 𝑢12 ⇒ 𝑢1𝑘 = 𝑎1𝑘 , 𝑘 = 1,2, ⋯ , 𝑛 (9. 𝑎)
𝑗

𝑢𝑗𝑘 = 𝑎𝑗𝑘 − ∑ 𝑙𝑗𝑠 𝑢𝑠𝑘 , 𝑘 = 𝑗, 𝑗 + 1, ⋯ , 𝑛; 𝑗 ≥ 2 (9. 𝑏)


𝑠=1
𝑎𝑗1
𝑎21 = 𝑙21 𝑢11 , 𝑎31 = 𝑙31 𝑢11 ⇒ 𝑙𝑗1 = 𝑗 = 2,3, ⋯ , 𝑛 (9. 𝑐)
𝑢11
𝑘−1
1
𝑙𝑗𝑘 = (𝑎 − ∑ 𝑙𝑗𝑠 𝑢𝑠𝑘 ) , 𝑗 = 𝑘 + 1, 𝑘 + 2, ⋯ , 𝑛; 𝑘 ≥ 2 (9. 𝑑)
𝑢𝑘𝑘 𝑗𝑘
𝑠=1

Equations (9. 𝑎 − 9. 𝑑) can be used to perform computer code to determine the 𝐿 and 𝑈 matrices.
First, we use the equations (9. 𝑎), (9. 𝑐) to find the first row 𝑢1𝑘 and the first column 𝑙𝑗1 , then
apply for (9. 𝑏), (9. 𝑑) in parallel.
Thus, the system of linear algebraic equations can be decomposed to two systems of linear
algebraic equations which can be solved directly.
𝐴𝒙 = 𝒃 ⇒ 𝐿𝑈𝒙 = 𝒃
Consider 𝒚 = 𝑈𝒙 then 𝐿𝒚 = 𝒃.
Therefore, we must obtain y by solving the equation 𝐿𝒚 = 𝒃, that is:

39
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 0 ⋯ 0 𝑦1 𝑏1
𝑙21 1 ... 0 𝑦2 𝑏2
= (10)
⋮ ⋮ ⋱ ⋮ ⋮ ⋮
[𝑙𝑛1 𝑙𝑛2 ⋯ 1] [𝑦𝑛 ] [𝑏𝑛 ]
Then we can obtain the solution 𝒙 by solving the equation 𝑈𝒙 = 𝒚, that is:
𝑢11 𝑢12 ⋯ 𝑢1𝑛 𝑥1 𝑦1
0 𝑢22 ... 𝑢2𝑛 𝑥2 𝑦2
= (11)
⋮ ⋮ ⋱ ⋮ ⋮ ⋮
[ 0 0 ⋯ 𝑢𝑛𝑛 ] [𝑥𝑛 ] [𝑦𝑛 ]
Example 1:
Using the LU decomposition method solve the equations (if it is possible):
𝑥 + 2𝑦 + 4𝑧 = 2, 2𝑥 + 3𝑦 − 5𝑧 = 1, 4𝑥 − 5𝑦 + 8𝑧 = 5
Solution: We have
1 2 4 𝑥 2
𝐴 = [2 3 −5] , 𝒙 = [𝑦] , 𝒃 = [ 1]
4 −5 8 𝑧 5

The leading principal minors of the matrix 𝐴 are:


1 2 4
1 2
1. |1| = 1 ≠ 0, 2. | | = −15 ≠ 0, 3. |2 3 −5 | = −161 ≠ 0
2 3
4 −5 8
Decomposing the coefficient matrix as:
1 2 4 1 0 0 𝑢11 𝑢12 𝑢13
[2 3 −5] = [𝑙21 1 0] [ 0 𝑢22 𝑢23 ]
4 −5 8 𝑙31 𝑙32 1 0 0 𝑢33
𝑢11 𝑢12 𝑢13
= [𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 ]
𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33
Then we have
𝑢11 = 1, 𝑢12 = 2, 𝑢13 = 4 𝑙21 𝑢11 = 2 → 𝑙21 = 2,
𝑙21 𝑢12 + 𝑢22 = 3 → 𝑢22 = −1,

40
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑙21 𝑢13 + 𝑢23 = −5 → 𝑢23 = −13,


𝑙31 𝑢11 = 4 → 𝑙31 = 4,
𝑙31 𝑢12 + 𝑙32 𝑢22 = −5 → 𝑙32 = 13,
𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33 = 8 → 𝑢33 = 161
Solving the equation 𝐿𝒚 = 𝒃, i.e.
1 0 0 𝑦1 2
[2 1 0] [𝑦2 ] = [1]
4 13 1 𝑦3 5
gives (forward substitution)
𝑦1 = 2, 2𝑦1 + 𝑦2 = 1 ⇒ 𝑦2 = −3, 4𝑦1 + 13𝑦2 + 𝑦3 = 5 ⇒ 𝑦3 = 36
Applying back substitution to the equation 𝒚 = 𝑈𝒙 gives
1 2 4 𝑥 2
[0 −1 −13] [𝑦] = [−3],
0 0 161 𝑧 36
from which we obtain the equations:
161𝑧 = 36, − 𝑦 − 13𝑧 = −3, 𝑥 + 2𝑦 + 4𝑧 = 2
Therefore, the solution is:
36 15 148
𝑧= ,𝑦 = ,𝑥 =
161 161 161
Example 2: Using the LU decomposition method solve the equations (if it is possible):
𝑥 + 𝑦 + 𝑧 = 1, 2𝑥 − 3𝑦 − 𝑧 = 1, 𝑥 − 𝑦 + 𝑧 = 0
Solution: We have
1 1 1 𝑥 1
𝐴 = [2 −3 −1] , 𝒙 = [ 𝑦 ] , 𝒃 = [ 1]
1 −1 1 𝑧 0
The leading principal minors of the matrix 𝐴 are:
1 1 1
1 1
1. |1| = 1 ≠ 0, 2. | | = −5 ≠ 0, 3. |2 −3 −1| = −6 ≠ 0
2 −3
1 −1 1
Decomposing the coefficient matrix as:

41
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 1 1 1 0 0 𝑢11 𝑢12 𝑢13


[2 −3 −1] = [𝑙21 1 0] [ 0 𝑢22 𝑢23 ]
1 −1 1 𝑙31 𝑙32 1 0 0 𝑢33
𝑢11 𝑢12 𝑢13
= [𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 ]
𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33
Then we have
𝑢11 = 1, 𝑢12 = 1, 𝑢13 = 1
𝑙21 𝑢11 = 2 → 𝑙21 = 2,
𝑙21 𝑢12 + 𝑢22 = −3 → 𝑢22 = −5,
𝑙21 𝑢13 + 𝑢23 = −1 → 𝑢23 = −3,
𝑙31 𝑢11 = 1 → 𝑙31 = 1,
𝑙31 𝑢12 + 𝑙32 𝑢22 = −1 → 𝑙32 = 2/5,
𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33 = 1 → 𝑢33 = 6/5
1 0 0 𝑦1 1
Solving the equation 𝐿𝒚 = 𝒃, i.e. 2 1 0 [𝑦2 ] = [1]
2
[1 5
1] 𝑦3 0
gives (forward substitution)
2 3
𝑦1 = 1, 2𝑦1 + 𝑦2 = 1 ⇒ 𝑦2 = −1, 𝑦1 + 𝑦2 + 𝑦3 = 0 ⇒ 𝑦3 = −
5 5

Applying back substitution to the equation 𝒚 = 𝑈𝒙 gives


1 1 1 𝑥 1
0 −5 −3 𝑦 = −1 ,
6 3
[0 0
5 ] [𝑧] [− 5]
from which we obtain the equations:
6 3
𝑧=− , − 5𝑦 − 3𝑧 = −1, 𝑥+𝑦+𝑧 =1
5 5
Therefore, the solution is:
1 1
𝑧=− , 𝑦= , 𝑥=1
2 2

42
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Example 3:
Using the LU decomposition method solve the equations (if it is possible):
𝑦 + 𝑧 = 3, 2𝑥 − 3𝑦 − 𝑧 = 1, 𝑥 − 𝑦 + 2𝑧 = 2
Solution: We have
0 1 1 𝑥 3
𝐴 = [2 −3 −1] , 𝒙 = [𝑦] , 𝒃 = [1]
1 −1 2 𝑧 2
The first leading principal minor of the matrix 𝐴 is: |0| = 0 .
0 1 1
Since |𝐴| = |2 −3 −1| = −4 ≠ 0, then it is needed to rearrange the given equations. We
1 −1 2
may rearrange these equations as:
2𝑥 − 3𝑦 − 𝑧 = 1, 𝑦 + 𝑧 = 3, 𝑥 − 𝑦 + 2𝑧 = 2
2 −3 −1 𝑥 1
∴ 𝐴 = [0 1 1 ], 𝒙 = [𝑦 ] , 𝒃 = [3]
1 −1 2 𝑧 2
The leading principal minors of the matrix 𝐴 becomes:
2 −3 −1
2 −3
1. |2| = 2 ≠ 0, 2. | | = 2 ≠ 0, 3. |0 1 1 |=4≠0
0 1
1 −1 2
Decomposing the coefficient matrix as:
2 −3 −1 1 0 0 𝑢11 𝑢12 𝑢13
[0 1 1 ] = [𝑙21 1 0] [ 0 𝑢22 𝑢23 ]
1 −1 2 𝑙31 𝑙32 1 0 0 𝑢33
𝑢11 𝑢12 𝑢13
= [𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 ]
𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33
Then we have:
𝑢11 = 2, 𝑢12 = −3, 𝑢13 = −1
𝑙21 𝑢11 = 0 → 𝑙21 = 0,
𝑙21 𝑢12 + 𝑢22 = 1 → 𝑢22 = 1,

43
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑙21 𝑢13 + 𝑢23 = 1 → 𝑢23 = −1,


1
𝑙31 𝑢11 = 1 → 𝑙31 = ,
2
1
𝑙31 𝑢12 + 𝑙32 𝑢22 = −1 → 𝑙32 = ,
2
𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33 = 2 → 𝑢33 = 3
1 0 0 𝑦1 1
The equation 𝐿𝒚 = 𝒃 gives: 0 1 0 [𝑦2 ] = [3]
1 1
[2 1] 𝑦3 2
2

Applying forward substitutions gives:


1 1 1
𝑦1 = 1, 𝑦2 = 3 ⇒ 𝑦2 = , 𝑦1 + 𝑦2 + 𝑦3 = 2 ⇒ 𝑦3 = 0
2 2 2
The equation 𝒚 = 𝑈𝒙 gives:
2 −3 −1 𝑥 1
[0 1 −1] [𝑦] = [3],
0 0 3 𝑧 0
from which we obtain the equations:
3𝑧 = 0, 𝑦 − 𝑧 = 3, 2𝑥 − 3𝑦 − 𝑧 = 1
Therefore, the solution is:
𝑥 = 5, 𝑦 = 3, 𝑧=0
Example 4: Using the LU decomposition method, solve the equations (if it is possible):
2𝑥 + 5𝑦 − 3𝑧 = 3, 𝑥 − 2𝑦 + 𝑧 = 2, 2𝑥 + 4𝑦 − 3𝑧 = −4
Solution: We have
2 5 −3 𝑥 3
𝐴 = [1 −2 1 ] , 𝒙 = [𝑦 ] , 𝒃 = [ 2 ]
2 4 −3 𝑧 −4
The leading principal minors of the matrix 𝐴 becomes:
2 5 −3
2 5
1. |2| = 2 ≠ 0, 2. | | = −9 ≠ 0, 3. |1 −2 1 |=5≠0
1 −2
2 4 −3
Decomposing the coefficient matrix as:

44
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

2 5 −3 1 0 0 𝑢11 𝑢12 𝑢13


[1 −2 1 ] = [𝑙21 1 0] [ 0 𝑢22 𝑢23 ]
2 4 −3 𝑙31 𝑙32 1 0 0 𝑢33
2 5 −3 𝑢11 𝑢12 𝑢13
∴ [1 −2 1 ] = [𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 ]
2 4 −3 𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33
Then we have:
𝑢11 = 2, 𝑢12 = 5, 𝑢13 = −3
𝑙21 𝑢11 = 1 → 𝑙21 = 1/2,
𝑙21 𝑢12 + 𝑢22 = −2 → 𝑢22 = −9/2,
𝑙21 𝑢13 + 𝑢23 = 1 → 𝑢23 = 5/2,
𝑙31 𝑢11 = 2 → 𝑙31 = 1,
𝑙31 𝑢12 + 𝑙32 𝑢22 = 4 → 𝑙32 = 2/9,
𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33 = −3 → 𝑢33 = −5/9
1 0 0 𝑦1 3
1
The equation 𝐿𝒚 = 𝒃 gives: 1 0 [𝑦2 ] = [ 2 ]
2
2
[1 9
1] 𝑦3 −4
Applying forward substitutions gives:
1 1 2
𝑦1 = 3, 𝑦1 + 𝑦2 = 2 ⇒ 𝑦2 = , 𝑦1 + 𝑦2 + 𝑦3 = −4 ⇒ 𝑦3 = −64/9
2 2 9
The equation 𝒚 = 𝑈𝒙 gives:
2 5 −3 𝑥 3
9 5 1
0 − 𝑦 = 2 ,
2 2
5 64
[0 0 − ][ ]
9 𝑧 [− 9 ]
from which we obtain the equations:
5 64 9 5 1
− 𝑧=− , − 𝑦+ 𝑧= ,2𝑥 + 5𝑦 − 3𝑧 = 3
9 9 2 2 2
Therefore, the solution is:
64 16
𝑧= = 12.8, 𝑦 = 7, 𝑥= = 3.2
5 5

45
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Example 5: Using the LU decomposition method, solve the equations (if it is possible):
2𝑥 + 5𝑦 − 3𝑧 = 3, 𝑥 − 2𝑦 + 𝑧 = 2, 7𝑥 + 4𝑦 − 3𝑧 = −4
Solution: We have
2 5 −3 𝑥 3
𝐴 = [1 −2 1 ], 𝒙 = [𝑦 ] , 𝒃=[ 2 ]
7 4 −3 𝑧 −4
The leading principal minors of the matrix 𝐴 are:
2 5 −3
2 5
1. |2| = 2 ≠ 0, 2. | | = −9 ≠ 0, 3. |1 −2 1 |=0
1 −2
7 4 −3
Therefore, the coefficient matrix cannot be decomposed into LU form, and the LU decomposition
method is not applicable and the given system of equation does not have unique solution.

Exercises
Using the LU decomposition method solve the equations:
1)𝑥 + 2𝑧 = 1, 3𝑥 − 𝑦 + 𝑧 = 2, 4𝑦 + 5𝑧 = −1
2)3𝑥 + 𝑦 − 2𝑧 = 4, 2𝑥 + 3𝑦 + 𝑧 = 2, 𝑥 − 3𝑦 + 2𝑧 = 8
3)4𝑥 + 2𝑦 − 𝑧 = 0, 6𝑥 + 3𝑦 + 2𝑧 = −16, 𝑥 + 2𝑦 + 9𝑧 = −4
4)4𝑥 + 10𝑦 + 8𝑧 = 44, 10𝑥 + 26𝑦 + 26𝑧 = 128, 8𝑥 + 26𝑦 + 61𝑧 = 214

46
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Iterative methods
If we have a system of large number of linear equations, the above direct methods need many
operations which may affect the result due to the round off error. To avoid this problem, we use
the iterative methods, in which we start from an approximation to the solution. We apply the
iterative methods if the convergence is rapid or there are many zeros coefficients in the system.
Consider the system of equations (2.1) and rewrite them is the fixed-point form as

1
𝑥𝑘 = (𝑏𝑘 − ∑𝑛𝑗=1 𝑎𝑘𝑗 𝑥𝑗 ) (8)
𝑎𝑘𝑘
𝑗≠𝑘

Explicitly, we obtain:
1
𝑥1 = {𝑏1 − (𝑎12 𝑥2 + 𝑎13 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 )}
𝑎11
1
𝑥2 = {𝑏2 − (𝑎21 𝑥1 + 𝑎23 𝑥3 + ⋯ + 𝑎2𝑛 𝑥𝑛 )}
𝑎22 (9)

1
𝑥𝑛 = {𝑏𝑛 − (𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛,𝑛−1 𝑥𝑛−1 )} }
𝑎𝑛𝑛

The numbers 𝑎𝑘𝑘 are the leading coefficients.


The sufficient conditions for which it is guaranteed that the iterative methods will converge are:
𝑛

|𝑎𝑘𝑘 | ≥ ∑|𝑎𝑘𝑖 | , 𝑘 = 1,2,3, ⋯ , 𝑛 (10)


𝑖≠𝑘

If (10) is satisfied, then the system of linear equations has a unique solution to which the iterative
methods will converge for any initial approximation.
Remark:
Sometimes, it is needed to interchange equations (rearrange the equations) of the given system to
obtain convergence of the solution.
Below are two of the most important iterative methods.

Jaccobi method
This method uses the starting approximate solution 𝑥𝑘0 , 𝑘 = 1,2, ⋯ , 𝑛 to obtain 𝑥𝑘1 , then uses 𝑥𝑘1
to find 𝑥𝑘2 and so on until the solution converges, i.e., |𝑥𝑘𝑚+1 − 𝑥𝑘𝑚 | ≤ 𝜀 .
The iteration of Jaccobi method is written as

(𝑚+1) 1 𝑛 (𝑚)
𝑥𝑘 = (𝑏𝑘 − ∑𝑗=1 𝑎𝑘𝑗 𝑥𝑗 ) , 𝑘 = 1,2,3, ⋯ , 𝑛, 𝑚 = 0,1,2, ⋯ (11)
𝑎𝑘𝑘
𝑗≠𝑘

47
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Example 1:
Using Jaccobi method, solve the equations:
4𝑥  +  . 24𝑦  −  . 08𝑧  =  8,     . 04𝑥  −  . 08𝑦  +  4𝑧  =  20,    . 09𝑥  +  3𝑦  −   . 15𝑧  =  9
using 𝑥0   =  0,  𝑦0   =  0,  𝑧0   =  0
Solution:
We should rearrange the equations to be:
4𝑥 + 0.24𝑦 − 0.08𝑧 = 8,          0 . 09𝑥 +  3𝑦 −  0.15𝑧 = 9,         0 . 04𝑥  −  0.08𝑦  +  4𝑧 = 20
Then we have the iterative formula:
1
𝑥𝑖+1 = {8 − (0.24𝑦𝑖 − 0.08𝑧𝑖 )},
4
1
𝑦𝑖+1 = {9 − (0.09𝑥𝑖 − 0.15𝑧𝑖 )},
3
1
𝑧𝑖+1 = {20 − (0.04𝑥𝑖 − 0.08𝑦𝑖 )}.
4
The iterations give
𝑖 = 0:
1
𝑥1 = {8 − (0.24𝑦0 − 0.08𝑧0 )} = 2.0,
4
1
𝑦1 = {9 − (0.09𝑥0 − 0.15𝑧0 )} = 3.0,
3
1
𝑧1 = {20 − (0.04𝑥0 − 0.08𝑦0 )} = 5.0
4
𝑖 = 1:
1 1
𝑥2 = {8 − (0.24𝑦1 − 0.08𝑧1 )} = {8 − (.24 × 3 − .08 × 5)} = 1.92000000178,
4 4
1 1
𝑦2 = {9 − (0.09𝑥1 − 0.15𝑧1 )} = {9 − (.09 × 2 − .15 × 5 )} = 3.19000000754,
3 3
1 1
𝑧2 = {20 − (0.04𝑥1 − 0.08𝑦1 )} = {20 − (.04 × 2 − .08 × 3)} = 5.03999999910
4 4
𝑖 = 2:
1 1
𝑥3 = {8 − (0.24𝑦2 − 0.08𝑧2 )} = {8 − (.24 × 3.19 − .08 × 5.04)} = 1.90940000155
4 4
1 1
𝑦3 = {9 − (0.09𝑥2 − 0.15𝑧2 )} = {9 − (.09 × 1.92 − .15 × 5.04 )} = 3.19440000762
3 3
1 1
𝑧3 = {20 − (0.04𝑥2 − 0.08𝑦2 )} = {20 − (.04 × 1.92 − .08 × 3.19)} = 5.04459999913
4 4
48
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

The following table contains more results:


i xi +1 yi +1 zi +1
0 2.000000000000000 3.000000000000000 5.000000000000000
1 1.920000001788139 3.190000007549922 5.039999999105930
2 1.909400001554191 3.194400007626415 5.044599999136230
3 1.909228001554052 3.194948007656723 5.044793999135763
4 1.909199001552872 3.194962867657294 5.044806679136087
5 1.909198363552859 3.194964371657406 5.044807266336097
6 1.909198285056854 3.194964420157409 5.044807302796098
7 1.909198282876054 3.194964424335289 5.044807304551058
8 1.909198282660480 3.194964424488461 5.044807304656424
9 1.909198282653398 3.194964424500197 5.044807304661643
10 1.909198282652798 3.194964424500670 5.044807304661949

Example 2:
Using six iterations of Jaccobi method, solve the equations:
12𝑥 + 7𝑦 + 3𝑧 = 1, 𝑥 + 8𝑦 + 2𝑧 = 2, − 2𝑥 − 7𝑦 + 25𝑧 = 1
with 𝑥0 = 0, 𝑦0 = 0, 𝑧0 = 0:
Solution: The Jaccobi iterative formula is:
𝑥𝑖+1 = (1 − 7𝑦𝑖 − 3𝑧𝑖 )/12,
𝑦𝑖+1 = (2 − 𝑥𝑖 − 2𝑧𝑖 )/8,
𝑧𝑖+1 = (1 + 2𝑥𝑖 + 7𝑦𝑖 )/25
The iterations give:
𝑖 = 0:
𝑥1 = (1 − 7𝑦0 − 3𝑧0 )/12 = 0.08.333334,
𝑦1 = (2 − 𝑥0 − 2𝑧0 )/8 = 0.25,
𝑧1 = (1 + 2𝑥0 + 7𝑦0 )/25 = 0.04
𝑖 = 1:
𝑥2 = (1 − 7𝑦1 − 3𝑧1 )/12 = −0.0725,
𝑦2 = (2 − 𝑥1 − 2𝑧1 )/8 = 0.2295833,

49
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑧2 = (1 + 2𝑥1 + 7𝑦1 )/25 = 0.1166667


𝑖 = 2:
𝑥3 = (1 − 7𝑦2 − 3𝑧2 )/12 = −0.07975695,
𝑦3 = (2 − 𝑥2 − 2𝑧2 )/8 = 0.2298958,
𝑧3 = (1 + 2𝑥2 + 7𝑦2 )/25 = 0.09848333
The following table contains more results:
𝑖 𝑥𝑖+1 𝑦𝑖+1 𝑧𝑖+1
3 − 0.07539340 0.2353488 0.09799027
4 − 0.07845103 0.2349266 0.09986619
5 − 0.07867374 0.2348398 0.09950337

Example 3:
Using five iterations of Jaccobi method, solve the system equations:
𝑥 + 2𝑦 − 𝑧 = 5, 3𝑥 − 𝑦 + 𝑧 = −2, 𝑥 + 𝑦 + 2𝑧 = 1
with 𝑥0 = 1, 𝑦0 = 0, 𝑧0 = 1.
Solution:
We must rearrange the equations as:
3𝑥 − 𝑦 + 𝑧 = −2, 𝑥 + 2𝑦 − 𝑧 = 5, 𝑥 + 𝑦 + 2𝑧 = 1
and the iterative formula becomes:
𝑥𝑖+1 = (−2 + 𝑦𝑖 − 𝑧𝑖 )/3,
𝑦𝑖+1 = (5 − 𝑥𝑖 + 𝑧𝑖 )/2,
𝑧𝑖+1 = (1 − 𝑥𝑖 − 𝑦𝑖 )/2
The iterations give:
𝑖 = 0:
𝑥1 = (−2 + 𝑦0 − 𝑧0 )/3 = −1
𝑦1 = (5 − 𝑥1 + 𝑧0 )/2 = 2.5
𝑧1 = (1 − 𝑥1 − 𝑦1 )/2 = 0.0
𝑖 = 1:
𝑥2 = (−2 + 𝑦1 − 𝑧1 )/3 = 1.66667
𝑦2 = (5 − 𝑥1 + 𝑧1 )/2 = 3
𝑧2 = (1 − 𝑥1 − 𝑦1 )/2 = -0.25
50
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑖 = 2:
𝑥3 = (−2 + 𝑦2 − 𝑧2 )/3 = 0.4166667
𝑦3 = (5 − 𝑥2 + 𝑧2 )/2 = 2.291667
𝑧3 = −(1 − 𝑥2 − 𝑦2 )/2 = −1.08333
The following table contains more results:
i xi +1 yi +1 zi +1
3 4.583334 E − 01 1.750000 −8.541667 E − 01
4 2.013889 E − 01 1.843750 −6.041667 E − 01
5 1.493056 E − 01 2.097222 −5.225694 E − 01

Gauss - Seidel method


This method is a modification of Jaccobi method as it uses the result reached in calculation. It uses
𝑥𝑗𝑚+1 , 𝑗 < 𝑘 and 𝑥𝑗𝑚 , 𝑗 > 𝑘 to calculate 𝑥𝑘𝑚+1 until the solution converges, i.e., |𝑥𝑘𝑚+1 − 𝑥𝑘𝑚 | ≤
𝜀. The iteration of Gauss - Seidel method is written as
𝑘−1 𝑛
1
𝑥𝑘𝑚+1 = (𝑏 − ∑ 𝑎𝑘𝑗 𝑥𝑗𝑚+1 − ∑ 𝑎𝑘𝑗 𝑥𝑗𝑚 ) , 𝑚 = 0,1,2, ⋯ (12)
𝑎𝑘𝑘 𝑘
𝑗=1 𝑗=𝑘+1

Example 1:
Using ten iterations of Gauss - Seidel method, solve the system equations:
𝑥 + 2𝑦 + 𝑧 = 1, 3𝑥 − 2𝑦 + 2𝑧 = 4, 𝑥 + 𝑦 − 5𝑧 = 2
with 𝑥0 = 1, 𝑦0 = 1, 𝑧0 = 1.
Solution:
We must rearrange the equations and the iterative formula becomes:
𝑥𝑖+1 = (4 + 2𝑦𝑖 − 2𝑧𝑖 )/3
𝑦𝑖+1 = (1 − 𝑥𝑖+1 − 𝑧𝑖 )/2
𝑧𝑖+1 = −(2 − 𝑥𝑖+1 − 𝑦𝑖+1 )/5
The iterations give:
𝑖 = 0:
𝑥1 = (4 + 2𝑦0 − 2𝑧0 )/3 = 1.33333
𝑦1 = (1 − 𝑥1 − 𝑧0 )/2 = −0.666666
𝑧1 = −(2 − 𝑥1 − 𝑦1 )/5 = −0.266666

51
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑖 = 1:
𝑥2 = (4 + 2𝑦1 − 2𝑧1 )/3 = 1.066667
𝑦2 = (1 − 𝑥2 − 𝑧1 )/2 = 0.1
𝑧2 = −(2 − 𝑥2 − 𝑦2 )/5 = −0.1666667
𝑖 = 2:
𝑥3 = (4 + 2𝑦2 − 2𝑧2 )/3 = 1.51111
𝑦3 = (1 − 𝑥3 − 𝑧2 )/2 = −0.172222
𝑧3 = −(2 − 𝑥3 − 𝑦3 )/5 = −0.132222
The following table contains more results:
i xi +1 yi +1 zi +1
3 1.306667 − 0.8722220 −0.1561111
4 1.379259 − 0.1115741 −0.1464630
5 1.356593 − 0.1050648 −0.1496944
6 1.363086 − 0.1066960 −0.1487219
7 1.361351 − 0.1063144 −0.1489927
8 1.361786 −0.1063964 −0.1489222
9 1.361684 − 0.1063808 −0.1489394

Example 2:
Using six iterations of Gauss - Seidel method, solve the system equations:
𝑥 + 𝑦 + 5𝑧 = 4, 2𝑥 − 3𝑦 + 𝑧 = 2, 5𝑥 − 4𝑦 + 𝑧 = 0
with 𝑥0 = 1, 𝑦0 = 0, 𝑧0 = 0.
Solution:
We must rearrange the equations and the iterative formula becomes:
𝑥𝑖+1 = (4𝑦𝑖 − 𝑧𝑖 )/5,
𝑦𝑖+1 = −(2 − 2𝑥𝑖+1 − 𝑧𝑖 )/3,
𝑧𝑖+1 = (4 − 𝑥𝑖+1 − 𝑦𝑖+1 )/5
The iterations give:
𝑖 = 0:
𝑥1 = (4𝑦0 − 𝑧0 )/5 = 0

52
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑦1 = −(2 − 2𝑥1 − 𝑧0 )/3 = −0.666666


𝑧1 = (4 − 𝑥1 − 𝑦1 )/5 = 0.9333333
𝑖 = 1:
𝑥2 = (4𝑦1 − 𝑧1 )/5 = −0.72
𝑦2 = −(2 − 2𝑥2 − 𝑧1 )/3 = −0.8355556
𝑧2 = (4 − 𝑥2 − 𝑦2 )/5 = 1.11111
𝑖 = 2:
𝑥3 = (4𝑦2 − 𝑧2 )/5 = −0.890666
𝑦3 = −(2 − 2𝑥3 − 𝑧2 )/3 = −0.890074
𝑧3 = (4 − 𝑥3 − 𝑦3 )/5 = 1.156148
The following table contains more results:
i xi +1 yi +1 zi +1
3 - 9.432889 E - 01 - 9.101432E - 01 1.170686
4 - 9.622518E - 01 - 9.179391E - 01 1.176038
5 - 9.695589 E - 01 - 9.210265E - 01 1.178117
Example 3:
Using five iterations of Gauss - Seidel method, solve the system equations:
4𝑥 + 0.24𝑦 − 0.08𝑧 = 8, 0.09𝑥 + 3𝑦 − 0.15𝑧 = 9, 0.04𝑥 − 0.08𝑦 + 4𝑧 = 20
with 𝑥0 = 0, 𝑦0 = 0, 𝑧0 = 0.
Solution:
The iterative formula is:
𝑥𝑖+1 = {8 − (0.24𝑦𝑖 – 0.08𝑧𝑖 )}/4,
𝑦𝑖+1 = {9 − (0.09 𝑥𝑖+1 − 0.15 𝑧𝑖 )}/3,
𝑧𝑖+1 = {20 − (0.04 𝑥𝑖+1 − 0.08 𝑦𝑖+1 )}/4.
Then we have
𝑖 = 0:
𝑥1 = {8 − (0.24 𝑦0 − 0.08 𝑧0 )}/4 = {8 − (0.24 × 0 − 0.08 × 0)}/4 = 2.0,
𝑦1 = {9 − (0.09𝑥1 − 0.15𝑧0 )}/3 = {9 − (0.09 × 2 − 0.15 × 0 )}/3 = 2.940,
𝑧1 = {20 − (0.04𝑥1 − 0.08𝑦1 )}/4 = {20 − (0.04 × 2 − 0.08 × 2.94)}/4 = 5.0388
𝑖 = 1:

53
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

𝑥2 = {8 − (.24 × 2.94 − .08 × 5.0388)}/4 = 1.924276,


𝑦2 = {9 − (.09 × 1.924276 − .15 × 5.0388 )}/3 = 3.194209,
𝑧2 = {20 − (.04 × 1.924276 − .08 × 3.194209)}/4 = 5.044641
𝑖 = 2:
𝑥3 = {8 − (.24 × 3.194209 − .08 × 5.044641)}/4 = 1.909240,
𝑦3 = {9 − (.09 × 1.909240 − .15 × 5.044641)}/3 = 3.194955,
𝑧3 = {20 − (.04 × 1.909240 − .08 × 3.194955)}/4 = 5.044806
Repeating the iteration yields
i xi +1 yi +1 zi +1
3 1.909199 3.194964 5.044807
4 1.909198 3.194964 5.044807
Example 4:
Using eight iterations of Gauss - Seidel method, solve the system equations:
12𝑥 + 7𝑦 + 3𝑧 = 2, 𝑥 + 5𝑦 + 2𝑧 = −5, 2𝑥 + 7𝑦 − 11𝑧 = 6
Solution: The iterative formula is:
𝑥𝑖+1 = (2 − 7𝑦𝑖 − 3𝑧𝑖 )/12,
𝑦𝑖+1 = (−5 − 𝑥𝑖+1 − 2𝑧𝑖 )/5,
𝑧𝑖+1 = −(6 − 2𝑥𝑖+1 − 7𝑦𝑖+1 )/11
The iterations yield:
i xi +1 yi +1 zi +1
0 0.1666667 -1.033333 -1.172727
1 1.062626 -1.681616 -1.422369
2 1.503202 -1.869588 -1.461883
3 1.622730 -1.909299 -1.465421
4 1.646780 -1.915524 -1.465010
5 1.650308 -1.916066 -1.464713
6 1.650550 -1.915995 -1.464624
7 1.650487 -1.915947 -1.464605

54
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Exercises
Using Jaccobi and Gauss - Seidel methods to solve following the equations:
1) 9𝑥 − 5𝑧 = 10, 20𝑦 − 12𝑧 = −2, − 5𝑥 − 12𝑦 + 20𝑧 = 0
where 𝑥0 = 0, 𝑦0 = 0, 𝑧0 = 0
2) 2𝑥 + 10𝑦 − 𝑧 = −32, − 𝑥 + 2𝑦 + 15𝑧 = 17, 10𝑥 − 𝑦 + 2𝑧 = 58
where 𝑥0 = 1, 𝑦0 = 1, 𝑧0 = 1
3) 4𝑥 + 2𝑦 + 𝑧 = 14, 𝑥 + 5𝑦 − 𝑧 = 10, 𝑥 + 𝑦 + 8𝑧 = 20
where 𝑥0 = 1, 𝑦0 = 1, 𝑧0 = 1
4) 6𝑥 + 𝑦 + 𝑧 = 107, 𝑥 + 9𝑦 − 2𝑧 = 36, 2𝑥 − 𝑦 + 8𝑧 = 121
where 𝑥0 = 1, 𝑦0 = 1, 𝑧0 = 1

55
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Eigenvalues and eigenvectors of a square matrix

This section presents one of the most important problems in linear algebra, the eigenvalue
problem. Its central question can be stated as follows. If 𝐴 is a square matrix of order 𝑛, do nonzero
𝒙 vectors exist such that 𝐴𝒙 is a scalar multiple of 𝒙?. The scalar, denoted by the Greek letter
lambda (λ), is called an eigenvalue of the matrix A and the nonzero vector 𝒙 is called an
eigenvector of 𝐴 corresponding to λ. The terms eigenvalue and eigenvector are derived from the
German word Eigenwert, meaning “proper value.” So, we have 𝐴𝒙 = 𝜆𝒙.
To find the eigenvalues and eigenvectors of a square matrix 𝐴 of order 𝑛, let I be the identity
matrix of order 𝑛. Writing the equation 𝐴𝒙 = 𝜆𝒙 in the form 𝐴𝒙 = 𝜆𝐼𝒙 then produces the system
of equations:
(𝐴 − 𝜆𝐼)𝒙 = 0 (1)
This homogeneous system of equations has nonzero solutions if and only if the coefficient matrix
(𝐴 − 𝜆𝐼) is not invertible, that is;
𝑑𝑒𝑡( 𝐴 − 𝜆𝐼) = 0 (2)
The equation (2) is called the characteristic equation of A and it gives a polynomial of degree 𝑛 in
λ, its n roots are the eigenvalues of the matrix A. For each eigenvalue there exist a corresponding
eigenvector (nonzero vector) which can be obtained by solving the homogeneous system (1).
Since the eigenvectors are nonzero vectors, then the homogeneous system (1) has an infinite
number of solutions for each value of λ. So that we consider the value 1 for the free variable. This
requires row reducing of a matrix where the resulting row reduced form must have at least one
row of zeros.
Example 1:
Verify that which of the vectors 𝒙1𝑇 = [4 1], 𝒙𝑇2 = [3 1] , and 𝒙𝑇3 = [1 1] is an eigenvector
2 −12
of the matrix 𝐴 = [ ] and find the corresponding eigenvalue.
1 −5
Solution:
2 −12 4 −4 4
𝐴𝒙1 = [ ] [ ] = [ ] = − [ ] = −𝒙1 ,
1 −5 1 −1 1
then 𝒙1 is an eigenvector of the matrix 𝐴 and the corresponding eigenvalue is 𝜆 = −1 .

56
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

2 −12 3 −6 3
𝐴𝒙2 = [ ] [ ] = [ ] = −2 [ ] = −2𝒙2 ,
1 −5 1 −2 1
then 𝒙2 is an eigenvector of the matrix 𝐴 , and the corresponding eigenvalue is 𝜆 = −2 .
2 −12 1 −10
𝐴𝒙3 = [ ][ ] = [ ] ≠ 𝜆𝒙3 ,
1 −5 1 −4
then 𝒙3 is not an eigenvector of the matrix 𝐴.
Example 2:
Verify that which of the vectors 𝒙1𝑇 = [−2 1 0], 𝒙𝑇2 = [−10 3 1], and
3 6 −8
𝒙𝑇3 = [0 2 3] is an eigenvector of the matrix 𝐴 = [0 0 6 ] and find the corresponding
0 0 2
eigenvalue.
Solution:
3 6 −8 −2 0
𝐴𝒙1 = [0 0 6 ] [ 1 ] = [0] ≠ 𝜆𝒙1 ,
0 0 2 0 0
then 𝒙1 is not an eigenvector of the matrix 𝐴.
3 6 −8 −10 −20 −10
𝐴𝒙2 = [0 0 6 ] [ 3 ] = [ 6 ] = 2 [ 3 ] = 2𝒙2 ,
0 0 2 1 2 1
then 𝒙2 is an eigenvector of the matrix 𝐴 and the corresponding eigenvalue is 𝜆 = 2 .
3 6 −8 0 −12
𝐴𝒙3 = [0 0 6 ] [2] = [ 18 ] ≠ 𝜆𝒙3 ,
0 0 2 3 6
then 𝒙3 is not an eigenvector of the matrix 𝐴.
Example 3:
Verify that which of the vectors 𝒙1𝑇 = [1 0 1], xT2 = −1 1 0 , and xT3 =1 1 2 is an
1 −3 3
eigenvector of the matrix 𝐴 = [3 −5 3] and find the corresponding eigenvalue.
6 −6 4
Solution:

57
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 −3 3 1 4 1
𝐴𝒙1 = [3 −5 3] [0] = [ 6 ] ≠ 𝜆 [0] ≠ 𝜆𝒙1
6 −6 4 1 10 1
Then 𝒙1 is not an eigenvector of the matrix 𝐴.
1 −3 3 −1 −4 −1
𝐴𝒙2 = [3 −5 3] [ 1 ] = [ −8 ] ≠ 𝜆 [ 1 ] ≠ 𝜆𝒙2
6 −6 4 0 −12 0
Then 𝒙2 is not an eigenvector of the matrix 𝐴.
1 −3 3 1 4 1
𝐴𝒙3 = [3 −5 3] [1] = [4] = 4 [1] = 4𝒙3
6 −6 4 2 8 2
Then 𝒙3 is an eigenvector of the matrix 𝐴 and the corresponding eigenvalue is 𝜆 = 4.
Example 4:
2 −12
Find the eigenvalues and eigenvectors of the matrix 𝐴 = [ ]
1 −5
Solution:
The eigenvalues 𝜆 of the matrix 𝐴 are given by solving the characteristic equation:
2−𝜆 −12
𝑑𝑒𝑡( 𝐴 − 𝜆𝐼) = 0 ⇒ | |=0
1 −5 − 𝜆
∴ 𝜆2 + 3𝜆 + 2 = 0 ⇒ (𝜆 + 1)(𝜆 + 2) = 0 ⇒ 𝜆 = −1, −2
Consider 𝒙1𝑇 = [𝑥1 𝑥2 ] to be the eigenvector corresponding to the eigenvalue 𝜆1 = −1
3 −12 𝑥1 0
∴ (𝐴 − 𝜆1 𝐼)𝒙1 = 0 ⇒ [ ][ ] = [ ]
1 −4 𝑥2 0
Using Gauss-Elimination method gives the augmented matrix:
1
3 −12 0 3 𝑅1 + 𝑅2 3
− −12 0
[ | ]→ [ | ]
1 −4 0 0 0 0
∴ 3𝑥1 − 12𝑥2 = 0.
Letting the free variable 𝑥2 = 𝑘 = 1 gives 𝑥1 = 4 ⇒ 𝒙1𝑇 = [4 1]
Consider 𝒙𝑇2 = [𝑥1 𝑥2 ] to be the eigenvector corresponding to the eigenvalue 𝜆2 = −2
4 −12 𝑥1 0
∴ (𝐴 − 𝜆2 𝐼)𝒙2 = 0 ⇒ [ ][ ] = [ ]
1 −3 𝑥2 0
58
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Using Gauss-Elimination method gives the augmented matrix:


1
4 −12 0 4 𝑅1 + 𝑅2 4
− −12 0
[ | ]→ [ | ]
1 −3 0 0 0 0
∴ 4𝑥1 − 12𝑥2 = 0.
Letting the free variable 𝑥2 = 𝑘 = 1 gives 𝑥1 = 3 ⇒ 𝒙𝑇2 = [3 1]
Example 5:
1 −1 0
Find the eigenvalues and eigenvectors of the matrix 𝐴 = [−1 2 −1].
0 −1 1
Solution:
The eigenvalues 𝜆 of the matrix 𝐴 are given by solving the equation:
1−𝜆 −1 0
𝑑𝑒𝑡( 𝐴 − 𝜆𝐼) = 0 ⇒ | −1 2−𝜆 −1 | = 0
0 −1 1−𝜆
∴ (1 − 𝜆)[(2 − 𝜆)(1 − 𝜆) − 1] + (𝜆 − 1) = 0
⇒ (1 − 𝜆)(𝜆2 − 3𝜆) = 0 ⇒ 𝜆 = 0, 1, 3
The eigenvector 𝒙1𝑇 = [𝑥1 𝑥2 𝑥3 ] corresponding to the eigenvalue 𝜆1 = 0 satisfies:
1 −1 0 𝑥1 0
(𝐴 − 𝜆1 𝐼)𝒙1 = 0 ⇒ [−1 2 −1] [𝑥2 ] = [0]
0 −1 1 𝑥3 0
Using Gauss-Elimination method gives the augmented matrix:
1 −1 0 0 1 −1 0 0 1 −1 0 0
𝑅1 + 𝑅2 𝑅2 + 𝑅3
[−1 2 −1|0] → [0 1 −1|0] → [0 1 −1|0]
0 −1 1 0 0 −1 1 0 0 0 0 0
∴ 𝑥1 = 𝑥2 , 𝑥2 = 𝑥3 .
Letting the free variable 𝑥3 = 𝑘 = 1 gives 𝑥1 = 1, 𝑥2 = 1 ⇒ 𝒙1𝑇 = [1 1 1].
Consider 𝒙𝑇2 = [𝑥1 𝑥2 𝑥3 ] to be the eigenvector corresponding to the eigenvalue 𝜆2 = 1
0 −1 0 𝑥1 0
∴ (𝐴 − 𝜆2 𝐼)𝒙2 = 0 ⇒ [−1 1 −1] [𝑥2 ] = [0]
0 −1 0 𝑥3 0
Using Gauss-Elimination method gives the augmented matrix:
59
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

0 −1 0 0 −1 1 −1 0 −1 1 −1 0
𝑅1 ↔ 𝑅2 𝑅2 + 𝑅3
[−1 1 −1|0] → [0 −1 0 |0] → [0 −1 0 |0]
0 −1 0 0 0 −1 0 0 0 0 0 0
∴ 𝑥2 = 0, 𝑥3 = 𝑘, 𝑥1 = −𝑥3 .
Letting the free variable 𝑥3 = 𝑘 = 1 gives 𝑥1 = −1, 𝑥2 = 0 ⇒ 𝒙𝑇3 = [−1 0 1].
Consider 𝒙𝑇3 = [𝑥1 𝑥2 𝑥3 ] to be the eigenvector corresponding to the eigenvalue 𝜆3 = 3
−2 −1 0 𝑥1 0
∴ (𝐴 − 𝜆3 𝐼)𝒙3 = 0 ⇒ [−1 −1 −1] [𝑥2 ] = [0]
0 −1 −2 𝑥3 0
Using Gauss-Elimination method gives the augmented matrix:
−2 −1 0 0 − 1 𝑅 + 𝑅 −2 −1 0 0 −2 −1 0 0
2 1 2 −2𝑅2 + 𝑅3
[−1 −1 −1|0] → [0 −1/2 −1|0] → [0 −1/2 −1|0]
0 −1 −2 0 0 −1 −2 0 0 0 0 0
∴ 2𝑥1 = −𝑥2 , 𝑥2 = −2𝑥3 .
Letting the free variable 𝑥3 = 𝑘 = 1 gives 𝑥1 = 1, 𝑥2 = −2 ⇒ 𝒙𝑇3 = [1 −2 1].
Example 6:
3 0 0
Find the eigenvalues and eigenvectors of the matrix 𝐴 = [0 2 0]
0 0 4
Solution:
The eigenvalues  of the matrix A are given by solving the equation:
3−𝜆 0 0
𝑑𝑒𝑡( 𝐴 − 𝜆𝐼) = 0 ⇒ | 0 2−𝜆 0 |=0
0 0 4−𝜆
∴ (3 − 𝜆)(2 − 𝜆)(4 − 𝜆) = 0 ⇒ 𝜆 = 3, 2, 4
If the eigenvector corresponding to the eigenvalue 𝜆1 = 3 is 𝒙1𝑇 = [𝑥1 𝑥2 𝑥3 ], then,
0 0 0 𝑥1 0
(𝐴 − 𝜆1 𝐼)𝒙1 = 0 ⇒ [0 −1 0] [𝑥2 ] = [0]
0 0 1 𝑥3 0
It is easy to see that 𝑥2 = 0, 𝑥3 = 0, consider the free variable 𝑥1 = 𝑘 = 1 ⇒ 𝒙1𝑇 = [1 0 0]
Consider 𝒙𝑇2 = [𝑥1 𝑥2 𝑥3 ] to be the eigenvector corresponding to the eigenvalue 𝜆2 = 2

60
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

1 0 0 𝑥1 0
∴ (𝐴 − 𝜆2 𝐼)𝒙2 = 0 ⇒ [0 0 0] [𝑥2 ] = [0]
0 0 2 𝑥3 0
It is easy to see that 𝑥1 = 0, 𝑥3 = 0, consider the free variable 𝑥2 = 𝑘 = 1
⇒ 𝒙𝑇2 = [0 1 0]
Consider 𝒙𝑇3 = [𝑥1 𝑥2 𝑥3 ] to be the eigenvector corresponding to the eigenvalue 𝜆3 = 4
−1 0 0 𝑥1 0
∴ (𝐴 − 𝜆3 𝐼)𝒙3 = 0 ⇒ [0 −2 0] [𝑥2 ] = [0]
0 0 0 𝑥3 0
It is easy to see that 𝑥1 = 0, 𝑥2 = 0, consider the free variable 𝑥3 = 𝑘 = 1
⇒ 𝒙𝑇3 = [0 0 1]
Example 7:
1 0 0 0
0 1 5 −10
Find the eigenvalues and eigenvectors of the matrix 𝐴 =
1 0 2 0
[1 0 0 3 ]
Solution:
The eigenvalues 𝜆 of the matrix 𝐴 are given by solving the equation:
1−𝜆 0 0 0
| 0 1−𝜆 5 −10 |
𝑑𝑒𝑡( 𝐴 − 𝜆𝐼) = 0 ⇒ =0
| 1 0 2−𝜆 0 |
1 0 0 3−𝜆
∴ (1 − 𝜆)2 (2 − 𝜆)(3 − 𝜆) = 0 ⇒ 𝜆 = 1,2,3
Note that 𝜆 = 1 is repeated root.
The eigenvector corresponding to the eigenvalue 𝜆1 = 1 is 𝒙1𝑇 = [𝑥1 𝑥2 𝑥3 𝑥4 ] such that:
0 0 0 0 𝑥1 0
0 0 5 −10 𝑥2 0
(𝐴 − 𝜆1 𝐼)𝒙1 = 0 ⇒ =
1 0 1 0 𝑥3 0
[1 0 0 2 ] [𝑥4 ] [0]
Using Gauss-Elimination method gives the augmented matrix:

61
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

0 0 0 0 0 1 0 0 2 0
0 0 5 −10|0 𝑅1 ↔ 𝑅4 0 0 5 −10|0 −𝑅1 + 𝑅3
→ →
1 0 1 0 |0 1 0 1 0 |0
[1 0 0 2 0] [0 0 0 0 0]
1 0 0 2 0 1 0 0 2 0
1
0 0 5 −10|0 − 𝑅 + 𝑅3 0 0 5 −10|0
5 2

0 0 1 −2 |0 0 0 0 0 |0
[0 0 0 0 0] [0 0 0 0 0]
∴ 𝑥1 = −2𝑥4 , 𝑥3 = 2𝑥4
Since we have two rows of zeros, then we have two eigenvectors corresponding to the eigenvalue
𝜆1 = 1. There are two free variables, one of those two variables must be x2 and the
other may be 𝑥3 or 𝑥4 .
Letting 𝑥2 = 𝑘 = 1, 𝑥4 = 0 gives 𝑥1 = 0, 𝑥2 = 1, 𝑥3 = 0, 𝑥4 = 0 ⇒ 𝒙1𝑇 = [0 1 0 0].
Letting 𝑥2 = 0, 𝑥4 = 1 gives 𝑥1 = −2, 𝑥2 = 0, 𝑥3 = 2, 𝑥4 = 1 ⇒ 𝒙𝑇2 = [−2 0 2 1].
The eigenvector corresponding to the eigenvalue 𝜆2 = 2 is 𝒙𝑇3 = [𝑥1 𝑥2 𝑥3 𝑥4 ] such that:
−1 0 0 0 𝑥1 0
0 −1 5 −10 𝑥2 0
(𝐴 − 𝜆2 𝐼)𝒙3 = 0 ⇒ =
1 0 0 0 𝑥3 0
[1 0 0 1 ] [𝑥4 ] [0 ]
Using Gauss-Elimination method gives the augmented matrix:
−1 0 0 0 0 −1 0 0 0 0
0 −1 5 −10|0 𝑅1 + 𝑅3 0 −1 5 −10|0

1 0 0 0 |0 𝑅1 + 𝑅4 0 0 0 0 |0
[1 0 0 1 0] [0 0 0 1 0]
∴ 𝑥1 = 0, 𝑥4 = 0, 𝑥2 = 5𝑥3 .
Letting the free variable 𝑥3 = 𝑘 = 1 gives 𝑥2 = 5 ⇒ 𝒙𝑇3 = [0 5 1 0]
The eigenvector corresponding to the eigenvalue 𝜆3 = 4 is 𝒙𝑇4 = [𝑥1 𝑥2 𝑥3 𝑥4 ] such that:
−2 0 0 0 𝑥1 0
0 −2 5 −10 𝑥2 0
(𝐴 − 𝜆3 𝐼)𝒙4 = 0 ⇒ =
1 0 −1 0 𝑥3 0
[1 0 0 0 ] [𝑥4 ] [0 ]

62
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Using Gauss-Elimination method gives the augmented matrix:


−2 0 0 0 0 −2 0 0 0 0
1
0 −2 5 −10|0 𝑅 + 𝑅3 0 −2 5 −10|0
2 1

1 0 −1 |
0 0 1
𝑅1 + 𝑅4 0 0 −1 0 |0
2
[1 0 0 0 0] [0 0 0 0 0]
∴ 𝑥1 = 0, 𝑥3 = 0, 𝑥2 = −5𝑥4 .
Letting the free variable 𝑥4 = 𝑘 = 1 gives 𝑥2 = −5 ⇒ 𝒙𝑇4 = [0 −5 0 1]

63
Sinai University, Faculty of IT &CS === Linear Algebra (MA 110) === Prof. Reda S Tantawi

Exercise
1. Verify that which of the vectors 𝒙1𝑇 = [1 0 0], 𝒙𝑇2 = [0 −1 0], and 𝒙𝑇3 = [5 1 2] is
2 3 1
an eigenvector of the matrix 𝐴 = [0 −1 2] and find the corresponding eigenvalue.
0 0 3
2. Verify that which of the vectors 𝒙1 = [1 2 −1], 𝒙𝑇2 = [−2 1 0], and 𝒙𝑇3 = [3 0 0]
−2 2 −3
is an eigenvector of the matrix 𝐴 = [ 2 1 −6] and find the corresponding eigenvalue.
−1 −2 0
3. Verify that which of the vectors 𝒙1𝑇 = [1 0 −1], 𝒙𝑇2 = [1 2 0], and 𝒙𝑇3 = [−2 1 1]
4 −1 3
is an eigenvector of the matrix 𝐴 = [0 2 1] and find the corresponding eigenvalue.
0 0 3
4. Find the eigenvalues and corresponding eigenvectors of the matrices
2 1 0 2 0 0
4 −5
(𝑖)𝐴 = [ ] (ii)𝐴 = [0 2 0] (iii)𝐴 = [−1 1 0]
2 3
0 0 2 5 3 −3
1 3 0 2 1 0
(iv)𝐴 = [3 1 0] (𝑣) 𝐴 = [0 2 0]
0 0 −2 0 0 2

64

You might also like