Lecture 4c MTH 204 Algeria MATRIX
Lecture 4c MTH 204 Algeria MATRIX
Lecture 4c MTH 204 Algeria MATRIX
a12 a12 . . . a1n
a
21 a22 . . . a2n
. . . . .
am1 am2 . . . amn
The numbers a11 , ...amn are called the elements of the matrix. The horizontal lines are called
rows or row vectors, and the vertical lines are called columns or column vectors of the matrix.
Matrices will be denoted by capital letters A, B etc., or by [aij ], [bjk ], etc., that is, by writing the
In the double-subscript notation for the elements, the first subscript always denotes the row and
A matrix
a1 a2 . . . an
having only one row is called a row matrix or row vector. A matrix
1
b1
b2
.
.
.
bm
The elements of a matrix may be real or complex numbers. If all the elements of a matrix are real,
A matrix having the same number of rows and columns is called a square matrix, and the number
of rows is called its order. A square matrix of order n is also called an n × n amtrix (read ”n by
n matrix”).
Addition and subtraction of matrices are defined only for the matrices of the same order, and are
defined as follows. The sum of two m × n matrices A = [aij ] and B = [bij ] is the m × n matrix
and written as C = A ± B.
Example 1: If
−4 6 3 5 −1 0 1 5 3
A= , B= , then (i) A + B =
0 1 2 3 1 0 3 2 2
−9 7 3
(ii). A − B =
−3 0 2
2
Multiplication of Matrices by Scalars (numbers) is defined as follows. The product of
ka12 ka12 . . . ka1n
ka ka22 . . . ka2n
21
kA =
. . . . .
kam1 kam2 . . . kamn
Example 2: If
−4 6 3 −24 36 18
A= , 6A =
0 1 2 0 6 12
Transpose of a Matrix
interchanging the rows and columns in A, that is, the ith row of A becomes the ith column of AT .
a11 a21 . . . am1
a
T
12 a22 . . . am2
A = [aji ] =
. . . . .
a1n a2n . . . amn
NOTE
(1). (A + B)T = AT + B T .
(2). (AB)T = B T AT
3
A real square matrix A = [aij ] is said to be symmetric if it is equal to its transpose. i.e. A = AT
Matrix Multiplication
a11 a12 b11 b12
Let A = and B =
a21 a22 b21 b22
a11 b11 + a12 b21 a11 b12 + a12 b22 c11 c12
C = AB = =
a21 b11 + a22 b21 a21 b12 + a22 b22 c21 c22
Example: Let
1 0 2
3 2 −1
A= and B = 5 3 1 , then
0 4 6
6 4 2
1 0 2
3 2 −1
7 2 6
AB = 5 3 1 =
0 4 6
56 36 16
6 4 2
(a) Multiplication of matrix is associative and also distributive with respect to addition of ma-
A(BC) = (AB)C
4
(A + B)C = AC + BC
C(A + B) = CA + CB
(b) Matrix multiplication is not commutative; that is if A and B are two matrices such that both
AB ̸= BA in general.
a11 a12
, then the determinant of A denoted as Det(A) or |A| is given as
a21 a22
a11 a12
= a11 a22 − a21 a12
a21 a22
a11 a12 a13 a11 a12 a13
a22 a23 a21 a23 a21 a22
A = a21 a22 a23 , |A| = = a11 −a12 +a33
a21 a22 a23
a32 a33 a31 a33 a31 a32
a31 a32 a33 a31 a32 a33
5
Example: Find |A| if
1 2 −1
A= 0 4 7
2 1 4
Solution
1 2 −1
4 7 0 7 0 4
0 4 7 =1 −2 + (−1) = 9 + 28 + 8 = 45.
1 4 2 4 2 1
2 1 4
NOTE:
(a) A square matrix is said to be singular if its determinant is zero otherwise it is nonsingular.
Properties of Determinant
(i) If two rows are interchanged, their determinants will change sign. That is,
(ii) If two rows (or columns) are identical, the value of the determinant is zero. That is
a1 a2 a3 a1 a1 b1
a1 a2 a3 = a2 a2 b2 = 0.
b1 b2 b3 a3 a3 b3
6
(iii) The determinant of a matrix and that of its transpose is the same.
a1 a2 a3 a1 b1 c1
b1 b2 b3 = a2 b2 c2
c1 c2 c3 a3 b3 c3
(iv) If the elements of any row (or column) of a determinant be each multiplied by the same
|kA| = b1 b2 b3 =k b1 b2 b3 = k|A|
c1 c2 c3 c1 c2 c3
Inverse of Matrices
2 × 2 Matrices
a11 a12
A=
a21 a22
a22 −a21
Cofactor(A) =
−a12 a11
a22 −a12
Adjoint = (CofactorA)T =
−a21 a11
Adjoint A
A−1 =
|A|
7
1 a22 −a21
(a11 a22 − a12 a21 )
−a12 a11
1 0
AA−1 = I =
0 1
Example
3 2
A=
4 2
|A| = 6 − 8 = −2
1 2 −2
A−1 = −
2
−4 3
Checking:
1 3 2 2 −2
AA−1 = −
2
4 2 −4 3
1 6 − 8 −6 + 6
=−
2
8 − 8 −8 + 6
1 −2 0
=−
2
0 −2
1 0
I=
0 1
8
3 × 3 Matrices
a11 a12 a13
B = a21 a22 a23
a31 a32 a33
a a23 a21 a23 a21 a22
+ 22
− +
a32 a33 a31 a33 a31 a32
a12 a13 a11 a13 a11 a12
Cofactor B =
− + −
a32 a33 a31 a33 a31 a32
a12 a13 a11 a13 a11 a12
+ − +
a22 a23 a21 a23 a21 a22
a a23 a12 a13 a12 a13
+ 22
− +
a32 a33 a32 a33 a22 a23
a21 a23 a11 a13 a11 a13
T
Adjoint B = (Cofactor B) =
− + −
a31 a33 a31 a33 a21 a23
a21 a22 a11 a12 a11 a12
+ − +
a31 a32 a31 a32 a21 a22
Adjoint B
B −1 =
|B|
9
Example
3 2 1
B= 1 4 7
2 7 3
4 7 1 7 1 4
+
− +
7 3 2 3 2 7
2 1 3 1 3 2
Cofactor of B =
− + −
7 3 2 3 2 7
2 1 3 1 3 2
+ − +
4 7 1 7 1 4
21 − 49 −(3 − 14) 7−8
= −(6 − 7)
9−2 −(21 − 4)
14 − 4 −(21 − 1) 12 − 2
−37 11 −1
= 1
7 −17
10 −20 10
−37 1 10
Adjoint of B = 11
7 −20
−1 −17 10
10
−37 1 10
Adjoint B 1
B −1 = = − 11
|B| 90 7 −20
−1 −17 10
Checking:
3 2 1 −37 1 10
1
BB −1 = − 1 4 7 11
90 7 −20
2 7 3 −1 −17 10
3(−37) + 2(11) + 1(−1) 3(1) + 2(7) + 1(−17) 3(10) + 2(−20) + 1(10)
1
= − 1(−37) + 4(11) + 7(−1) 1(1) + 4(7) + 7(−17) 1(10) + 4(−20) + 7(10)
90
2(−37) + 7(11) + 3(−1) 2(1) + 7(7) + 3(−17) 2(10) + 7(−20) + 3(10)
−90 0 0
1
=− 0
90 −90 0
0 0 −90
1 0 0
= 0 1 0
0 0 1
11
Application of Matrices
a1 x + b1 y = c1
a2 x + b2 y = c2
a1 b1 x c1
=
a2 b2 y c2
i.e
A⃗x = C
⃗x = A−1 C
x 1 b2 −b1 c1
⃗x = =
(a1 b2 − a2 b1 )
y −a2 a1 c2
x b2 c1 −b1 c2
a1 b2 −a2 b1
=
a2 c1 −a2 c1
y a1 b2 −a2 b1
Example
x + 2y = 3
4x + 2y = 6
in Matrix form:
12
1 2 x 3
=
4 2 y 6
−1
x 1 2 3
=
y 4 2 6
x 1 2 −2 3
=−
6
y −4 1 6
x 1 −6 1
=− =
6
y −6 1
Crammer’s Method
a1 x + b1 y = c1
a2 x + b2 y = c2
a1 b1 x c1
=
a2 b2 y c2
i.e
A⃗x = C
If
|A| = ∆
13
|Ay | = ∆y
|Ax | = ∆x
Then
∆x ∆y
x= ; y=
∆ ∆
Example
x + 2y = 3
4x + 2y = 6
in Matrix form:
1 2 x 3
=
4 2 y 6
1 2
|A| = ∆ = = 2 − 8 = −6
4 2
3 2
|Ax | = ∆x = = 6 − 12 = −6
6 2
1 3
|Ay | = ∆y = = 6 − 12 = −6
4 6
Therefore,
14
∆x −6
x= = =1
∆ −6
∆y −6
y= = =1
∆ −6
NB: These methods be extended to an n × n matrix, obtained from n equations and n unknowns.
Example
2. Crammer’s rule
x−y−z =1
2x − 3y + z = 10
x + y − 2z = 0
Solution
In matrix form:
1 −1 −1 x 1
2 −3 1 y = 10
1 1 −2 z 0
1 −1 −1
|A| = 2 −3 1
1 1 −2
−3 1 2 1 2 −3
=1 − (−1) + (−1)
1 −2 1 −2 1 1
15
= 1(6 − 1) + 1(−4 − 1) − 1(2 + 3)
=5−5+5
= −5
1 −1 −1 x 1
2 −3 1 y = 10
1 1 −2 z 0
i.e
A⃗x = C
−3 1 2 1 2 −3
+
− +
1 −2 1 −2 1 1
−1 −1 1 −1 1 −1
Cofactor A = − + −
1 −2 1 −2 1 1
−1 −1 1 −1 1 −1
+ − +
−3 1 2 1 2 −3
6−1 −(−4 − 1) 2+3
= −(2 + 1)
−2 + 1 −(1 + 1)
−1 − 3 −(1 + 2) −3 + 2
16
5 5 5
= −3 −1 −2
−4 −3 −1
5 −3 −4
Adjoint A = 5 −1 −3
5 −2 −1
5 −3 −4
Adjoint A 1
A−1 = = − 5 −1 −3
|A| 5
5 −2 −1
x 5 −3 −4 1
1
y = − 5 −1 −3
10
5
z 5 −2 −1 0
x 5
y = 1
z 3
17
Eigenvalues and Eigenvectors
Eigen Values
Let A be a square matrix, a scalar λ is said to be an eigenvalue of A if there exist a non-zero column
AX = λX
matrix A.
Characteristic Roots: The roots of the equation |A − λI| = 0 are called the characteristic roots
or eigenvalues of a matrix A.
Properties of Eigenvalues
(2) The sum of the eigenvalues of a matrix is equal to the trace of the matrix. The trace of the
(3) The product of the eigenvalues of a matrix is equal to the determinant of the matrix.
18
Examples
1 1 3
A= 5
2 6
−2 −1 −3
Solution
1 1 3 1 0 0
−2 −1 −3 0 0 1
1−λ 1 3
=⇒ 5 2−λ 6 = 0 =⇒ λ3 = 0 =⇒ λ1 = λ2 = λ3 = 0.
−2 −1 −3 − λ
2 2 1
A= 1 3 1
1 2 2
Solution
The eigenvalues of the matrix A are 1, 1, 5. For λ = 1, f (1) = 3(1)3 + 5(1)2 − 6(1) + 2 = 4.
19
Cayley-Hamilton Theorem
This states that every square matrix satisfies its own characteristic equation.
i.e, if det(A − λI) = (−1)n (λn + a1 λn−1 + a2 λn−2 + ... + an ) is the characteristic polynomial of
n × n matrix A = (aij ), then the matrix equation X n + a1 X n−1 + a2 X n−2 + ... + an I = 0 is satisfies
2 1 0
A= 1 2 0
0 0 3
Solution
2−λ 1 0
0 0 3−λ
20
Eigenvectors
Properties of Eigenvectors
(2) If λ1 , λ2 , ...λn are distinct eigenvalues of an n×n matrix, then their corresponding eigenvectors
(3) If two or more eigenvalues are equal, it may or may not be possible to get linearly independent
(5) Eigenvectors of a symmetric matrix corresponding to different eigen values are orthogonal.
1 0 −1
A= 1 2 1
2 2 3
Solution
1−λ 0 −1
2 2 3−λ
21
=⇒ (1 − λ)(2 − λ)(3 − λ) = 0 =⇒ λ = 1, 2, 3. This shows that eigenvalues are distinct.
x
For the corresponding eigenvectors, (A − λI)X = 0, where X = y
z
0 0 −1 x1 0
When λ = 1, (A − I)X = 0 =⇒ 1 1 1 y1 = 0
2 2 2 z1 0
z1 = 0 (i)
x1 + y1 + z1 = 0 (ii)
22
x3 1
=⇒ y3 = −1
z3 2
2 1 1
A= 2 3 2
3 3 4
Solution
For eigenvectors;
2−λ 1 1 x 0
(A − λI)X = 0 =⇒ 2 y = 0
3−λ 2
3 3 4−λ z 0
1 1 1 x1 0
When λ = 1; 2 2 2 y1 = 0 =⇒ x1 + x2 + x3 = 0
3 3 3 z1 0
−1
Let x3 = 0, then x1 = −x2 . When x2 = 1, x1 = −1. Therefore; X1 = 1
0
23
−1
Also let x2 = 0, x1 = −x3 . When x3 = 1, x1 = −1 Therefore; X2 = 0
1
−5 1 1 x3 0
Also when λ = 7, 2 −4 2 y3 = 0
3 3 −3 z3 0
−5x3 + y3 + z3 = 0 (i)
From equation (iii), z3 = x3 + y3 . Substitute into (i) and (ii). For (i), we have −4x3 + 2y3 =
Example: Find the eigen values and the corresponding eigenvectors of the matrix
−2 5 4
A= 5 7 5
4 5 −2
24
Solution
For eigenvectors;
−2 − λ 5 4 x1 0
(A − λI)X = 0 =⇒ y1 = 0
5 7−λ 5
4 5 −2 − λ z1 0
1 5 4 x1 0
5 10 5 y1 = 0
4 5 1 z1 0
4 5 4 x2 0
5 13 5 y2 = 0
4 5 4 z2 0
25
4x2 + 5y2 + 4z2 = 0 (i)
−14 5 4 x3 0
y3 = 0
5
−5 5
4 5 −14 z3 0
26
Case IV: Symmetric Matrices with Repeated Eigenvalues
Example: Find the eigenvalues and the corresponding eigenvectors of the matrix
2 −1 1
A = −1 2 −1
1 −1 2
Solution
2−λ −1 1
1 −1 2−λ
2 − λ −1 1 x 0
(A − λI)X = 0 =⇒ −1 2 − λ −1 y = 0
1 −1 2 − λ z 0
When λ = 1, we have
1 −1 1 x1 0
= 0
−1 1 −1 y1
1 −1 1 z1 0
x1 − y1 + z1 = 0 (i)
−x1 + y1 − z1 = 0 (ii)
27
x1 − y1 + z1 = 0 (iii)
=⇒ y1 = x1 + z1 .
1
Let x1 = 1, z1 = −1, then y1 = 0 =⇒ X1 = 0
−1
1
Also, let x1 = 1, z1 = 1, then y1 = 2 =⇒ X2 = 2
1
When λ = 4, we have
−2 −1 1 x3 0
= 0
−1 −2 −1 y3
1 −1 −2 z3 0
−2x3 − y3 + z3 = 0 (i)
x3 − y3 − 2z3 = 0 (iii)
1
x3 = z3 = 1, y3 = −1 =⇒ X3 = −1
1
28