Matrices 1
Matrices 1
FOR ND II
Outline
Definition of matrix
Order of a matrix
Types of matrices
Addition and Subtraction of Matrices
Multiplication of Matrices
Transpose of a matrix
Determinants
Adjoint of a Matrix
Inverse of a matrix
Solutions of Linear Equations using Matrices
Definition of matrix
A matrix is a set of numbers either real or complex (or elements) arranged in rows and columns to
form a rectangular array. A matrix having m rows and n columns is called an m × n matrix. A
general way of representing a matrix is
𝑎11 𝑎12 𝑎13 … … … … . 𝑎1𝑛
A = [ 𝑎21 𝑎22 𝑎23 … … … … . 𝑎2𝑛 ]
𝑎𝑚1 𝑎𝑚2 𝑎𝑚3 … … … . . 𝑎𝑚𝑛
Matrices are usually denoted by capital letter A, B, C etc and its elements by small letters a, b, c
etc.
Order of a matrix
The order (or dimension) of a matrix is the number of rows by its number of columns. In describing
a matrix, the number of rows (m) is stated first and then the number of columns (n) second. If there
are 4 rows and 3 columns in a matrix, its order is 4 × 3 and is read as four by three.
For example
3 5 1
A= [ ]
0 2 −4
The order of matrix A above is a 2×3 matrix.
Types of matrices
1. Row matrix: a row matrix consists of 1 row only. It is also called a row vector.
e.g: [2 3 7] is a row matrix of order 1 × 3.
2. Column matrix: a column matrix consists of 1 column only. It is also called a column
3
vector. For example: [4]is a column matrix of order 3 × 1.
6
3. Null or zero matrix: is a matrix in which each element is “0”. Zero matrices are denoted by
the symbol O. A zero matrix 𝑂𝑚𝑛 has the property that for every matrix 𝐴𝑚𝑛 ,
𝐴+ 0=𝑂+𝐴=𝐴
4. Square matrix: a matrix with the same number of rows and columns is called a square
matrix. A square matrix is of order m × m or n × n. for example:
1 2
A=[ ] is a square matrix of order 2× 2
4 1
5. Diagonal matrix: is a square matrix with all its elements zero except the leading diagonal.
5 0 0
For example B = [0 4 0]
0 0 7
6. Scaler matrix: is a matrix in which all the diagonal elements are the same.
5 0 0
For example A = [0 5 0]
0 0 5
7. Identity or Unit matrix: is a diagonal matrix in which the elements on the leading diagonal
are all unity. The unit matrix is denoted by I.
1 0 0
For example B = [0 1 0]
0 0 1
8 1 6 2
𝐵= [ ] and 𝐴 = [ ]
3 4 7 −3
8−6 1−2
B–A=[ ]
3 − 7 4 − (−3)
2 −1
=[ ]
−4 7
AB = [17 ]
Step 3:
3
[1 2 3] and [2]= 1×3 + 2×2 + 3×7=3+4+21=28
7
17 28
AB = [ ]
Step 4:
4
[4 5 6] and [5] = 4×4 + 5×5 + 6×1 = 16+25+6=47
1
17 28
AB = [ ]
47
Step 5:
3
[4 5 ]
6 and [2] = 4×3 + 5×2 + 6×7 = 12+10+42=64
7
17 28
AB = [ ]
47 64
Note:
1. Multiplication of matrices is not commutative i.e., AB ≠ BA in general.
2. For matrices A and B if AB = BA then A and B commute to each other
3. A matrix A can be multiplied by itself if and only if it is a square matrix. The product A.A in
such cases is written as A2. Similarly, we may define higher powers of a square matrix i.e.,
A. A2 = A3, A2. A2 = A4
4. In the product AB, A is said to be pre multiple of B and B is said
to be post multiple of A.
Properties of Matrix Multiplication
1. 0𝐴 = 0; 𝐴0 = 0 0 is a scalar or compatible matrix
2. 𝐼𝐴 = 𝐴; 𝐴𝐼 = 𝐴
3. (𝐴𝐵)𝐶 = 𝐴(𝐵𝐶)
4. ∝ (𝐴𝐵) = (∝ 𝐴)𝐵 where ∝ is a scalar
5. 𝐴(𝐵 + 𝐶) = 𝐴𝐵 + 𝐵𝐶, (𝐴 + 𝐵)𝐶 = 𝐴𝐶 + 𝐵𝐶
6. (𝐴𝐵)𝑇 = 𝐴𝑇 𝐵 𝑇
Transpose of a matrix
The transpose of a matrix is obtained by interchanging the rows with columns and columns with
rows. The transpose of a matrix A is denoted by AT. The transpose of an 𝑚 × 𝑛 matrix A is the
𝑛 × 𝑚 matrix. Transposing a matrix converts a row vector to column vector and column vector to
row vector.
Properties of transpose
1. (𝐴𝑇 )𝑇 = 𝐴
2. (𝐴 + 𝐵)𝑇 = 𝐴𝑇 + 𝐵 𝑇
3. For a scalar c, (𝑐𝐴)𝑇 = 𝑐𝐴𝑇
4. (𝐴𝐵)𝑇 = 𝐵 𝑇 𝐴𝑇
Example
0 7 3
𝐵=[ ] Find the transpose.
4 0 1
Matrix B is a 2 × 3, so the transpose is a 3 × 2
0 4
𝐵 𝑇 = [7 0]
3 1
Symmetric Matrix
A square matrix A is said to be symmetric if 𝐴 = 𝐴𝑇 . It is a matrix which remains unchanged
when the transpose is taken.
𝑎 𝑏 𝑐 𝑎 𝑏 𝑐
𝐴 = [𝑏 𝑑 𝑒 ] then 𝐴𝑇 = [ 𝑐 𝑑 𝑒]
𝑐 𝑒 𝑓 𝑐 𝑒 𝑓
Skew Symmetric
A square matrix is said to be skew symmetric if 𝐴 = −𝐴𝑇 . It is a matrix whose transpose is equal
to the matrix obtained by multiplying each entry of the matrix by -1.
For example
0 −4 1
𝐵=[ 4 0 −3]
−1 3 0
0 4 −1 0 −4 1
𝐵 𝑇 = [−4 0 3 ] = (−1) [4 0 −3]
−1 3 0 1 −3 0
𝐵 𝑇 = −𝐵
Singular and Non-singular Matrices
A square matrix A is called a singular matrix if the determinant |𝐴| = 0 and non-singular if |𝐴| ≠
0.
DETERMINANTS
The determinant of an 𝑛 × 𝑛 square matrix, written as 𝑑𝑒𝑡 𝐴 is an important scalar quantity that is
a function of the elements of the matrix. When written using the elements of the matrix the
determinant is enclosed between vertical bars |𝐴|. The determinant is obtained from the elements
of a matrix by specified operations which is the characteristics of the matrix. Determinants are
defined only for square matrices.
The determinant of a 2 × 2 matrix
𝑎11 𝑎12
𝐴 = [𝑎 𝑎22 ] is given by det A=|𝐴|
21
𝑎 𝑎12
|𝐴| = |𝑎11 𝑎22 | = 𝑎11 𝑎22 − 𝑎12 𝑎21
21
|𝐴| = 𝑎11 (𝑎22 𝑎33 − 𝑎23 𝑎32 ) − 𝑎12 (𝑎21 𝑎33 − 𝑎23 𝑎31 ) + 𝑎13 (𝑎21 𝑎32 − 𝑎22 𝑎31 )
Each determinant in the sum is the determinant of a sub matrix of a 𝐴 obtained by deleting a
particular row and column of 𝐴. These determinants are called minors. We use the sign + or –,
according to (−1)𝑖+𝑗 𝑎𝑖𝑗
The cofactors 𝐶𝑖𝑗 of an element 𝑎𝑖𝑗 in a determinant is simply its minor 𝑀𝑖𝑗 multiplied by either +1
or –1 depending on its position.
𝐶𝑖𝑗 = (−1)𝑖+𝑗 𝑀𝑖𝑗
The value of the determinant can be found by using its minor elements or cofactors using this
𝑎11 𝑀11 − 𝑎12 𝑀12 + 𝑎13 𝑀13 OR 𝑎11 𝐶11 + 𝑎12 𝐶12 + 𝑎13 𝐶13
Each element gives rise to a cofactor, which is simply the minor of the element in the determinant
together with its place sign. The appropriate place signs are given by
+ − +
[− + −] for a 3 × 3 matrix
+ − +
Properties of determinants
1. Let 𝐴 & 𝐵 be two square matrices of same size. Then the following holds:
a. det(𝐴𝐵) = (det 𝐴)(det 𝐵)
b. det 𝐼 = 1
c. det 𝐴𝑇 = det 𝐴
2. Let 𝐸 be an elementary matrix and let 𝑘 be a non-zero real number:
a. If 𝐸 results from interchanging two rows of I, then 𝑑𝑒𝑡𝐸 = −1.
b. If E results from multiplying a row of 𝐼 by 𝑘, then 𝑑𝑒𝑡𝐸 = 𝑘.
c. If E results from adding k times one row of I to another row, then 𝑑𝑒𝑡𝐸 = 1.
3. Let 𝐴 be a square matrix, then det 𝐴 = 0 if any of the following holds:
a. A has an entire row (or column) of zeros;
b. A has two equal rows (or columns);
c. A has two proportional rows (or columns).
4. A square matrix has an inverse if and only if det 𝐴 ≠ 0.
5. Let 𝐴 and 𝐵 be square matrices of the same size, then 𝐴𝐵 = 𝐼 if and only if 𝐵𝐴 = 𝐼.
6. Let A be an n×n matrix then the following holds
a. 𝐴 is invertible.
b. 𝑑𝑒𝑡𝐴 ≠ 0.
c. The row-reduced form of 𝐴 = 𝐼𝑛.
d. The system 𝐴𝑥 = 𝑏 has precisely one solution for each 𝑛 × 1 matrix b.
e. The system 𝐴𝑥 = 0 has only the trivial solution.
Summary of properties of matrices
Let 𝐴 𝑎𝑛𝑑 𝐵 be two square matrices of the same size. Then
𝑑𝑒𝑡(𝐴𝐵) = (𝑑𝑒𝑡𝐴)(𝑑𝑒𝑡𝐵),
(𝐴𝐵)𝑇 = 𝐵 𝑇 𝐴𝑇 ,
𝑑𝑒𝑡𝐴𝑇 = 𝑑𝑒𝑡𝐴.
If 𝐴 𝑎𝑛𝑑 𝐵 are invertible, then
(𝐴𝐵)−1 = 𝐵 −1 𝐴−1,
1
𝑑𝑒𝑡𝐴−1 = det 𝐴
Adjoint of a Matrix
To find the adjoint of a square matrix, we form the matrix of cofactors, then we write the transpose
of it. The adjoint of a matrix is denoted by
𝑎𝑑𝑗 𝐴 = 𝐶 𝑇
The adjoint of a 2 × 2 matrix
𝑎 𝑏
𝐴=[ ]
𝑐 𝑑
𝑑 −𝑏
𝐴𝑑𝑗 𝐴 = [ ]
−𝑐 𝑎
Examples
Find the determinant of the following Matrices.
2 3 5
7 2
𝐴= [ ] 𝐷 = [4 1 6]
3 1
1 4 0
Solution
7 2
𝐴= [ ]
3 1
7 2
Det A = |𝐴| = | |
3 1
=7×1−3×2=7−6=1
Det A = 1
2 3 5
𝐷 = [4 1 6]
1 4 0
2 3 5
det 𝐷 = |𝐷| = [4 1 6]
1 4 0
= 2(1 × 0 − 4 × 6) − 3(4 × 0 − 1 × 6) + 5(4 × 4 − 1 × 1)
= 2 × −24 − 3 × −6 + 5 × 15 = −48 + 18 + 75 = 45
det 𝐷 = |𝐷| = 45
Find the adjoint of matrix D.
𝐷11 𝐷12 𝐷13
𝐶 = [𝐷21 𝐷22 𝐷23 ]
𝐷31 𝐷32 𝐷33
1 6 4 6 4 1
𝐷11 = + | | = −24 𝐷12 = − | |=6 𝐷13 = + | | = 15
4 0 1 0 1 4
3 5 2 5 2 3
𝐷21 = − | | = 20 𝐷22 = + | | = −5 𝐷23 = − | | = −5
4 0 1 0 1 4
3 5 2 5 2 3
𝐷31 = + | | = 13 𝐷32 = − | |=8 𝐷33 = + | | = −10
1 6 4 6 4 1
Inverse of a Matrix
The adjoint of a square matrix is important because it enables us to form the inverse of the matrix.
If each element of the adjoint of A is divided by the value of the determinant of A provided |𝐴| ≠
0, the resulting matrix is called the inverse of A. Inverse of a matrix is denoted by 𝐴−1 .
𝐴𝑑𝑗 𝐴
𝐴−1 =
|𝐴|
Note
For a non-singular matrix A of order (𝑛 𝑥 𝑛), if there exist another matrix B of order (𝑛 𝑥 𝑛) such
that their product is the identity matrix I of order (𝑛 𝑥 𝑛) 𝑖. 𝑒. , 𝐴𝐵 = 𝐵𝐴 = 𝐼. Then B is said to
be the inverse of A and is written as B = A-1. In order words, the product of a square matrix and
its inverse, in whatever order the factors are written, is the unit matrix of the same order.
Steps to obtain the inverse of a matrix:
i. Evaluate the determinant of the matrix A.
ii. Form a matrix C of the cofactors of the elements of |𝐴|.
iii. Write the transpose of C to obtain the adjoint of A.
iv. Divide each element of CT by |𝐴|.
v. The resulting matrix is the inverse of A-1.
|𝐴| = |3 4
|=3×2−1×4 =6−4=2
1 2
2 −4
𝑎𝑑𝑗 𝐴 = [ ]
−1 3
𝑎𝑑𝑗 𝐴 1 2 −4
𝐴−1 = = [ ]
|𝐴| 2 −1 3
0 −2 −3
2. Find the inverse if it exists, of the matrix 𝐴 = [ 1 3 3]
−1 −2 −2
Soln
First, find |𝐴|
|𝐴| = 0(3 × −2 + 2 × 3) − (−2)(1 × −2 + 1 × 3) + (−3)(−1 × 2 + 1 × 3)
= 0(0) + 2(−2 + 3) + (−3)(−2 + 3) = 0 + 2 × 1 − 3 × 1 = 0 + 2 − 3
|𝐴| = −1 𝑖𝑛𝑣𝑒𝑟𝑠𝑒 𝑒𝑥𝑖𝑠𝑡
Cofactors of A are
3 3 1 3 1 3
𝐴11 = + | |=0 𝐴12 = − | | = −1 𝐴13 = + | |=1
−2 −2 −1 −2 −1 −2
−2 −3 0 −3 0 −2
𝐴21 = − | |=2 𝐴22 = + | | = −3 𝐴23 = − | |=2
−2 −2 −1 −2 −1 −2
−2 −3 0 −3 0 −2
𝐴31 = + | |= 3 𝐴32 = − | | = −3 𝐴33 = + | |=2
3 3 1 3 1 3
0 −1 1
𝐶 = [2 −3 2]
3 −3 2
0 2 3
𝑎𝑑𝑗 𝐴 = 𝐶 𝑇 = [−1 −3 −3]
1 2 2
0 2 3
𝑎𝑑𝑗 𝐴 1
So 𝐴−1 = |𝐴|
= [ −1 −3 −3]
−1
1 2 2
0 −2 −3
𝐴−1 = [ 1 3 3]
−1 −2 −2
Exercises
Find the determinant of the following matrices
1 −6 5
1. 𝑀 = [ 2 2 5]
−1 −4 1
1 1 2
2. 𝑀 = [2 3 1 ]
3 4 −5
1 2 4
3. 𝑀 = [2 7 3 ]
3 1 −5
3 4
4. 𝐵 = [ ]
2 −5
15 10
5. 𝐵 = [ ]
3 2
0 −2
6. 𝐵 = [ ]
6 30
3 6
7. 𝐵 = [ ]
3 3
Solve the following equations given by determinants
6 2
1. | |=0
3 𝑥
𝑥−1 4
2. | |=0
1 𝑥+2
6−𝛼 5
3. | |=0
6 5−𝛼
3 4 5
4. |7 7 7| = 0
𝑥 𝑥+1 9
𝑥 4 5
5. |3 −1 𝑥 | = 0
3 𝑥 −1
4−𝜆 1 0
6. | 2 6−𝜆 1 |=0
0 1 4−𝜆
5 𝑥 3
7. | 𝑥 3 4| = 58
−2 −2 𝑥
Examples
1. −4𝑥1 + 2𝑥2 − 9𝑥3 = 2
3𝑥1 + 4𝑥2 + 𝑥3 = 5
𝑥1 − 3𝑥2 + 2𝑥3 = 8
Solution
Defining the matrix 𝐴, 𝑋 𝑎𝑛𝑑 𝐵.
−4 2 −9 𝑥1 2
𝐴= [3 4 1] 𝑥
𝑋 = [ 2] 𝐵 = [5]
1 −3 2 𝑥3 8
𝑋 = 𝐴−1 𝐵
Find 𝐴−1 .
−4 2 −9
|𝐴| = | 3 4 1|
1 −3 2
|𝐴| = −4(8 + 3) − 2(6 − 1) + (−9)(−9 − 4)
|𝐴| = −44 + 10 + 117 = 63
|𝐴| = 63
Cofactors of A are
4 1 3 1 3 4
𝐴11 = + | | = 11 𝐴12 = − | | = −5 𝐴13 = + | | = −13
−3 2 1 2 1 −3
2 −9 −4 −9 −4 2
𝐴21 = − | | = 23 𝐴22 = + | |=1 𝐴23 = − | | = −10
−3 2 1 2 1 −3
2 −9 −4 −9 −4 2
𝐴31 = + | | = 38 𝐴32 = − | | = −23 𝐴33 = + | | = −22
4 1 3 1 3 4
the matrix of cofactors is
11 −5 −13
𝐶 = [23 1 −10]
38 −23 −22
The transpose of C is the adjoint of the matrix
11 23 38
𝑇
𝑎𝑑𝑗 = 𝐶 = [ −5 1 −23]
−13 −10 −22
𝑎𝑑𝑗 𝐴 1 11 23 38
𝐴−1 = = [ −5 1 −23]
|𝐴| 63
−13 −10 −22
𝑋 = 𝐴−1 𝐵
11 23 38 2
1
𝑋 = 63 [ −5 1 −23] × [5]
−13 −10 −22 8
1 11 × 2 + 23 × 5 + 38 × 8
𝑋= [ −5 × 2 + 1 × 5 − 23 × 8 ]
63
−13 × 2 − 10 × 5 − 22 × 8
1 441
𝑋= [−189]
63
−252
7
𝑋 = [−3]
−4
Therefore 𝑥1 = 7, 𝑥2 = −3, 𝑎𝑛𝑑 𝑥3 = −4.
2. 𝑥1 + 2𝑥2 + 𝑥3 = 4
3𝑥1 − 4𝑥2 − 2𝑥3 = 2
5𝑥1 + 3𝑥2 + 5𝑥3 = −1
|𝐴𝑥 |
𝑥=
|𝐴|
|𝐴𝑦 |
𝑦=
|𝐴|
Example
𝑥−𝑦 =2
𝑥 + 4𝑦 = 5
Soln
|𝐴| = |1 −1
|=4+1=5
1 4
|𝐴𝑥 | = |2 −1| = 8 + 5 = 13
5 4
1 2
|𝐴𝑦 | = | |= 5−2= 3
1 5
|𝐴𝑥 | 13
𝑥= =
|𝐴| 5
|𝐴𝑦 | 3
𝑦= =
|𝐴| 5
Solution
−4 2 −9
|𝐴| = | 3 4 1 | = 63
1 −3 2
2 2 −9
|𝐴𝑥 | = |5 4 1 | = 441
8 −3 2
−4 2 −9
|𝐴𝑦 | = | 3 5 1 | = −189
1 8 2
−4 2 2
|𝐴𝑧 | = | 3 4 5| = −252
1 −3 8
2 7
b. [ ]
1 4
4 11 5
c. [1 4 2]
1 2 1
1 −2 1
d. [ 3 −1 5]
−1 4 0
1 −3 7 3
6. If 𝐴 = [ ] and 𝐵 = [ ] show that 𝐴𝐵 = 𝐵𝐴 = 𝐼 and therefore 𝐵 = 𝐴−1 .
−2 7 2 1
7. Evaluate the following sums where possible.
0 6 −2 1 2 9
a. [1 8 2 ] + [1 0 4]
0 3 4 3 −4 1
1 −3 2 0
b. [ ]+[ ]
−2 54 4 1
1 2 1 3
c. [1 0] + [3 1 ]
4 1 4 −2
2
3 2
d. [−4] [ ]
4 −1
1
−2 0 1
3 1 2
e. [ ][ 1 3 0 ]
0 5 1
4 1 −1
1
f. [2] [3 0 4]
1
8. Write out the transpose of each of the following.
1 4
a. [ 0 2]
−6 10
2 1 2
b. [0 3 −5]
4 7 0
c. [10 4 6]
1 2 7 8
1 0
9. Let 𝐴 = [3 4], 𝐵 = [ 9 10] and 𝐶 = [ ]
1 1
5 6 11 12
a. Find 𝐴𝑇 , 𝐵 𝑇 𝑎𝑛𝑑 (𝐴 + 𝐵)𝑇
b. Verify that (𝐴 + 𝐵)𝑇 = 𝐴𝑇 + 𝐵 𝑇
c. Find 𝐶 𝑇 𝑎𝑛𝑑 (𝐴𝐶)𝑇
10. Find the inverse of the following matrices if it exists.
2 3
a. [ ]
3 5
−2 4
b. [ ]
3 −6
1 2 4
c. [−2 1 1]
1 1 1
1 4 1
d. [1 6 3]
2 3 0
2 10 0
c. [3 −1 2]
5 9 2
d. 5𝑥1 − 3𝑥2 = −1
𝑥2 = 2𝑥1 − 2