Professional Documents
Culture Documents
Chapter 8: Matrices
by
Dr.Adnan Daraghmeh
Department of Mathematics
An-Najah National University
2021-2022
1
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 2 of 66
If a matrix has m rows and n columns we say that its size is m by n (written m × n).
The entry in the ith row and j th column of an m × n matrix A is written aij .
For an n × n square matrix, the entries a11 , a22 , · · · , ann are called the main diagonal
entries.
a) The size of A.
solution:
b) The size of B.
solution:
2i ,i > j
Example 2: Find a matrix A = aij 3×4
such that aij = i + 2j ,i = j
3−j ,i < j
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 4 of 66
2
x 3 16 3
b) = .
y 2 −8 9 2x
solution:
Definition:
A − B = A + (−B)
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 5 of 66
1 3 4 −2 −1 6 7
Example 1: Given A = ,B = and C = . Find if possible
5 −3 7 8 2 −3 9
a) A + B and B + A
solution:
b) A − B and B − A.
solution:
c) A − C and C + B.
solution:
d) 3A − 2B
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 6 of 66
A + B = B + A and A − B 6= B − A
A+ B+C = A+B +C
k1 k2 A = k1 k2 A
1A = A
k1 A + B = k1 A + k1 B
k1 + k2 A = k1 A + k2 A
1 3 4 −2
Example 2: Find the matrix X such that 5X + =2 + 3X
5 −3 7 8
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 7 of 66
Matrix Multiplication:
a11 a12 ··· a1p b11 b12 · · · b1n
a21 a22 ··· a2p b21 b22 · · · b2n
AB = .
.. .. .. .. .. .. ..
.. . . . . . . .
am1 am2 · · · amp bp1 bp2 · · · bpn
a11 b11 + a12 b21 + ··· +a1p bp1 + ··· +a11 b1n + a12 b2n + ···
+a1p bpn
a21 b11 + a22 b21 + ··· +a2p bp1 + ··· +a21 b1n + a22 b2n + ···
+a2p bpn
=
.. ..
. .
am1 b11 + am2 b21 + · · · +amp bp1 + · · · +am1 b1n + am2 b2n + · · · +amp bpn
p
!
X
= aik bkj
k=1 m×n
a) AB and BA
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 8 of 66
b) AC and CA.
solution:
3 −8 4 −3
−3 7 5 −6 2
6 12
−8 9
0
Example 2: Let A = 4 9 10 11
and B = −3 5
. If C = AB, find the
3 −8 −5 4 4
10 6 −2
2 3 6 13
value of c42
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 9 of 66
A(B + C) = AB + AC
(B + C)A = BA + CA
An = AAA
| {z· · · A}
n−times
1 3 4 −2 −1 6
Example 1: Given A = ,B = and C = . Find if possible
5 −3 7 8 2 −3
a) A3
solution:
Transpose of a Matrix:
In other words, the rows of a matrix A become the columns of its transpose
AT .
Properties of Transpose: Suppose A and B are matrices and k a scalar.
Then
T
AT =A
T
A+B = AT + B T
T
A+B+C = AT + B T + C T
T
AB = B T AT
T
ABC = C T B T AT
T
kA = kAT
1 3 4 −2 −1 6
Example 1: Given A = ,B = and C = . Find
5 −3 7 8 2 −3
T
a) AT
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 11 of 66
T
b) A+B+C
solution:
T
c) 2CB
solution:
T
d) 3B
solution:
T
e) A2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 12 of 66
Special Matrices
Zero Matrix :
A matrix that consists of all zero entries and is denoted by 0. For example,
0 0 0
0
0 = 0 0 0 , 0 =
0
0 0 0
are zero matrices. If A and 0 are n × m matrices, then
A+0=A
A + (−A) = 0
Triangular Matrix :
A a square matrix A = (aij)n×n is said to be a triangular matrix if all its
entries above the main diagonal are zeros or if all its entries below the main
diagonal are zeros.
If aij = 0 whenever i < j, then the matrix is called lower triangular matrix
7 0 0 0 0
5 2 0 0 0
−6 4 9 0 0
3 1 8 −1 0
−5 7 −3 2 6
| {z }
lower triangular matrix
If aij = 0 whenever i > j, then the matrix is called upper triangular matrix
3 4 −6 1 9
0
2 −5 7 6
0
0 9 2 −1
0 0 0 −1 8
0 0 0 0 −6
| {z }
upper triangular matrix
Diagonal Matrix :
A a square matrix A = (aij)n×n is said to be a diagonal matrix if all its
entries not on the main diagonal are zeros.
If aij = 0 for i 6= j, then the matrix is called a diagonal matrix.
3 0 0
0 2 0
0 0 9
| {z }
diagonal matrix
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 13 of 66
Scalar Matrix:
A diagonal matrix A is called scalar matrix, when the entries aii are all
equal.
3 0 0
0 3 0
0 0 3
| {z }
scalar matrix
Identity Matrix:
A scalar matrix is called identity matrix, denoted by In , when the entries
of the main diagonal are all equal to one.
1 0 ··· 0
0 1 · · · 0
In = . . .
. . . ..
. . . .
0 0 ··· 1
| {z }
identity matrix
1 0 0
I3 = 0 1 0
0 0 1
is an identity matrix of order 3.
For any m × n matrix A it is readily verified that
Im A = AIn = A
2
b) A + B = A2 + 2AB + B 2 (T) (F)
solution:
1
d) If A is a square matrix, then C = 2 A−AT is a skew-symmetric matrix (T) (F)
solution:
f ) If AB defined and A has a row of zeros, then AB has a row of zeros (T) (F)
solution:
g) Symmetric and upper triangular matrix must be a diagonal matrix (T) (F)
solution:
2 1
j) Suppose A = 6 3 Verify that the matrix B = AAT is symmetric (T) (F)
2 5
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 16 of 66
Homogeneous Systems :
The system AX = b is called homogeneous system, if the matrix (vector)
b is zero.
The system AX = b is called non-homogeneous system, if the matrix (vector)
b is non-zero.
Augmented Matrix
The augmented matrix ( or the matrix of the system) of the system AX = b
is defined as
a11 a12 · · · a1n b1
a21 a22 · · · a2n b2
A |b = . .. .. ..
.. . ··· . .
am1 am2 · · · amn bm
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 17 of 66
x1 − 5x3 = −1
2x1 + 8x2 = 7
x2 + 9x3 = 1
solution:
2 −4
Example 1: Apply elementary row operations on the matrix: A =
5 1
1 1
a) 2 R1 c) 11 R2
b) −5R1 + R2 d) 2R2 + R1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 18 of 66
Elimination Methods:
We say that two matrices are row equivalent if one can be obtained from
the other through a sequence of elementary row operations.
Example 1: Determine whether the matrix is in row echelon form, reduced row echelon
form, both, or neither
1 5 0 2
a) 0 1 0 −1
0 0 0 0
1 0 0 7
b) 0 1 0 −1
0 0 1 0
0 0 1 −6 2 2
c)
0 0 0 0 1 4
0 0 1 −6 0 −6
d)
0 0 0 0 1 4
0 0 1 2 3 6
e) 0 1 0 0 0 4
0 0 1 0 0 7
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 19 of 66
a)
3x1 + 6x2 = 3
x1 − 4x2 = 7
solution:
b)
3x1 + 6x2 = 3
−x1 − 2x2 = −1
solution:
c)
3x1 + 6x2 = 3
−x1 − 2x2 = 2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 20 of 66
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 21 of 66
1. Gaussian elimination.
2. Gauss–Jordan elimination.
a)
2x1 + 6x2 + x3 = 7
x1 + 2x2 − x3 = −1
5x1 + 7x2 − 4x3 = 9
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 22 of 66
b)
x + 3y − 2z = −7
4x + y + 3z = 5
2x − 5y + 7z = 19
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 23 of 66
2 2 2 4
Example 4: Let A = 1 3 1 ,b = 0
−2 −4 −2 −2
a) Write A in REF.
solution:
i1 − i2 − i3 = 0
i1 R1 + i2 R2 = E
i2 R2 − i3 R3 = 0
Example 6: Solve
x1 + x2 = 1
4x1 − x2 = −6
2x1 − 3x2 = 8
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 26 of 66
Homogeneous Systems:
Example 1: Solve
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 27 of 66
Determinant of a 1 × 1 Matrix:
If A = (a)1×1 , then det(A) = a
Determinant
ofa 2 × 2 Matrix:
a11 a12 a a
If A = , then det(A) = 11 12 = a11 × a21 − a12 × a22
a22 a21 2×2 a22 a21
1 2 4 −2
Example 1: Given A = ,B = and C = −3 . Find
4 −3 −5 −1
a) det(A)
solution:
b) det(B)
solution:
c) det(C)
solution:
d) det(AT )
solution:
e) det A + B
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 29 of 66
f ) det 2A − 3B
solution:
g) det AB
solution:
x−2 x 3 −8
Example 2: Find the value(s) of x such that =
3 x 0 2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 30 of 66
Determinant of a n × n Matrix:
Let
a11 a12 ··· a1n
a21 a22 ··· a2n
A= . .. = aij n×n
.. ..
.. . . .
am1 am2 · · · amn
be an n × n matrix.
For each 1 ≤ i ≤ n, the cofactor expansion of det(A) along the ith row is
.
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 31 of 66
2 −4 7
Example 1: Given A = 6 2 3.
1 5 3
a) Find the matrix of cofactors corresponding to the entries of A ( find cof (A))
solution:
b) Evaluate the determinant of A using cofactor expansion along the first row.
solution:
c) Evaluate the determinant of A using cofactor expansion along the third column.
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 32 of 66
5 1 2 4
−1 0 2 3
b) B =
1
1 6 1
1 0 0 4
solution:
Example 2: Evaluate
2 2 0 0 −2
1 1 6 0 5
a) 1 4 2 −1 −1
2 0 1 −3 3
0 1 0 0 1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 33 of 66
0 0 0 3 0
−2 0 0 2 0
b) 8 −1 0 −7 2
−1 2 2 3 2
2 2 3 6 4
solution:
1−λ 0 −1
b) 1 2−λ 1 =0
3 3 −λ
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 34 of 66
Determinant of a Transpose
If AT is the transpose of the n × n matrix A, then
det(AT ) = det(A)
2 −4
Example: Given A = . Find det(A) and det(AT )
6 2
solution:
det(A) = 0
6 2 2
Example: Given A = 4 2 2. Find det(A)
9 2 2
solution:
det(A) = 0
6 2 0
Example: Given A = 4 3 0. Find det(A)
9 5 0
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 35 of 66
Interchanging Rows
If B is the matrix obtained by interchanging any two rows (columns) of an
n × n matrix A, , then
det(B) = −det(A)
a1 a2 a3
Example: Given that b1 b2 b3 = 5
c1 c2 c3
a3 a2 a1
a) Find b3 b2 b1
c3 c2 c1
solution:
a1 b1 c1
b) Find a2 b2 c2
a3 b3 c3
solution:
det(B) = kdet(A)
a1 a2 a3
Example: Given that b1 b2 b3 = 5
c1 c2 c3
2a1 a2 a3
a) Find 6b1 3b2 3b3
2c1 c2 c3
solution:
det(kA) = k n det(A)
Example: Let A and B are both 3 × 3 matrices such that |A| = −4 and |B| = 21 . Find
a) |2A|
solution:
b) |4B|
solution:
c) |(4B T )|
solution:
Example: Let A and B two 3 × 3 matrices such that |A| = −4 and |B| = 12 . Find
a) |AB|
solution:
b) |(4BA)T |
solution:
c) |A + B|
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 37 of 66
Determinant Is Unchanged
det(B) = det(A)
a b
Example: Given that =5
c d
a b
a) Find
2a + c 2b + d
solution:
a b − 3a
b) Find
c d − 3c
solution:
a1 a2 a3
Example: Given that b1 b2 b3 = 5
c1 c2 c3
, where a11 , a22 , · · · , ann are the entries on the main diagonal of A.
Example: Find
2 0 0 0 0
9 1 0 0 0
a) 3 4 2 0 0
2 −5 1 −3 0
4 1 7 0 1
solution:
2 0 0 0
0 6 0 0
b)
0 0 −2 0
0 0 0 −5
solution:
2 9 1 8
1 3 7 4
Example 1: Evaluate the determinant of the matrix A =
0
1 6 5
3 1 4 2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 39 of 66
a a+1 a+2
Example 2: Evaluate the determinant of the matrix A = b b + 1 b + 2
c c+1 c+2
solution:
1 1 1 1
a b c d
Example 3: Evaluate 2 2 2 2
a b c d
a3 b3 c3 d3
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 40 of 66
1 1 1
Example 4: Show that a b c = (b − a)(c − a)(c − b).
a2 b2 c2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 41 of 66
b) Suppose A is an n×n matrix such that A2 = A. Then |A| = 0 or |A| = 1 (T) (F)
solution:
1 −2 3
b) 5 4 7
2 −4 6
solution:
1 2 1 1
0 0 3 0
c)
3 2 1
0
1 1 1 0
solution:
2 −3 4
Example 2: Find all values of x ∈ R such that the matrix is non-singular 6 1 9
4 x 8
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 43 of 66
Inverse of a Matrix
Let A be an n × n matrix. If there exists an n × n matrix B such that
AB = BA = I
AA−1 = A−1 A = I
Note that the symbol −1 in the notation A−1 is not an exponent; in other
words, A−1 is not a reciprocal.
Adjoint Method:
Let A be an n × n matrix. The matrix that is the transpose of the matrix
of cofactors is called the adjoint of A and is denoted by adj(A).
T
adj(A) = cof (A)
Example 2:
4 3
a) If A−1 = , what is A ?
3 2
solution:
5 3
b) If (2A)−1 = , what is (3A) ?
−3 −2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 46 of 66
If the matrix to the left of the vertical bar has a row of zeros, we can stop
at this point and conclude that A is singular and has no inverse.
2 1 3 1
4 3 6 2
c) A =
2 1
4 1
0 1 2 1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 48 of 66
1 0 0 0
0 0 1 0
d) A =
0 0
0 1
0 1 0 0
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 49 of 66
X = A−1 b
Example 2: Use the inverse of the coefficient matrix to solve the system
2x1 − 9x2 = 15
3x1 + 6x2 = 16
solution:
Example 3: Use the inverse of the coefficient matrix to solve the system
2x1 + x3 = 2
−2x1 + 3x2 + 4x3 = 4
−5x1 + 5x2 + 6x3 = −1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 51 of 66
a) Find A−1 .
solution:
b) Find A.
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 52 of 66
Example 4: The 3 × 3 identity matrix was obtained by applying the following sequence
of elementary row operations on a 3 × 3 matrix A
1
R1 −→ R2 , R1 −2R2 −→ R1 , R1 +R3 −→ R1 , −6R3 −→ R3 , R3 +2R2 −→ R3 , −R2 +R1 −→ R2
2
.
a) Compute det(A).
solution:
4
b) Solve the system AX = b, where b = 11 .
3
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 53 of 66
Cramer’s Rule
Let A be the coefficient matrix of the system:
where Ak is the same as the matrix A except that the k th column of A has been
replaced by the entries of the column matrix
b1
b2
b=.
..
bn
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 54 of 66
2x1 − 9x2 = 15
3x1 + 6x2 = 16
solution:
3x1 + 2x2 + x3 = 7
x1 − x2 + 3x3 = 3
5x1 + 4x2 − 2x3 = 1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 55 of 66
(2 − k)x1 + kx2 = 4
kx1 + (3 − k)x2 = 3
AX = λX
Eigenvalues and eigenvectors are also called characteristic values and char-
acteristic vectors, respectively.
2 0 −1 −3
Example 2: If X = −2 is an eigenvector of the 3 × 3 matrix A = 2 3 3 , find
2 −2 1 1
the corresponding eigenvalue.
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 58 of 66
4 2
Example 3: Find the eigenvalues and eigenvectors of A =
5 1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 59 of 66
1 2 1
Example 4: Find the eigenvalues and eigenvectors of A = 6 −1 0
−1 −2 −1
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 60 of 66
9 1 1
Example 5: Find the eigenvalues and eigenvectors of A = 1 9 1
1 1 9
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 61 of 66
4 6 6
Example 6: Find the eigenvalues and eigenvectors of A = 1 3 2
−1 −5 −2
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 62 of 66
Example 7:
3 4
a) Find the eigenvalues and eigenvectors of A =
−1 7
solution:
6 −1
b) Find the eigenvalues of A =
5 4
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 63 of 66
1 2 1
Example 8: Given the matrix A = 6 −1 0
−1 −2 −1
3
b) Given that X = 3 is an eigenvectors of A, find the eigenvalue associated with
1
X.
solution:
σ(A) = {λ1 , λ2 , · · · , λn }
det(A) = λ1 λ2 · · · λn
σ(AT ) = {λ1 , λ2 , · · · , λn }
Example 1: Let λ1
= 3,
λ2 = 4are
the eigenvalues of a 2×2 matrix A with corresponding
1 0
eigenvectors X1 = ,X2 = . Find the eigenvalues of A−1 and the corresponding
2 1
eigenvectors.
solution:
Matrices, 2021 Dr.Adnan Daraghmeh Lecture Notes - Page 66 of 66
b) Find σ(AT ).
solution:
c) Find σ(A−1 ).
solution:
2 0 0
Example 3: Given the matrix A = 1 −3 0
1 1 4
a) Find the characteristic polynomial of A.
solution:
b) Find σ(AT ).
solution:
c) Find σ(A−1 ).
solution: