FORM THREEMATHS
CHAPTER 8
MATRICES
Definition
- A matrix is a rectangular arrangement of numbers, letters or
symbols that are called elements.
- 𝐸𝑥𝑎𝑚𝑝𝑙𝑒𝑠𝑜𝑓𝑎𝑚𝑎𝑡𝑟𝑖𝑥 (𝑎𝑙𝑤𝑎𝑦𝑠𝑒𝑛𝑐𝑙𝑜𝑠𝑒𝑑𝑖𝑛𝑏𝑟𝑎𝑐𝑘𝑒𝑡𝑠)
𝑎 𝑏𝑐
a) ) *
𝑑 𝑒𝑓
1 2
b) 3 4
5 6
6 9
c) ( )
3 4
1
d) 2
3
4
NB// Commas are not used instead the elements are separated by a
space.
1|Page
The order of a matrix
- A matrix consists of rows and columns. Rows are the horizontal
arrangement while column are the vertical arrangement.
- The number of rows and columns determine the order of a
matrix, which is given by stating the number of rows followed
by the number of columns.
- The symbol X is used which means by and not multiplication.
𝑎 𝑏𝑐
For example ) *is a 3 x 2 (‘Three by two’ matrix)
𝑑 𝑒𝑓
6 9
b) ( ) is a 2 x 2
3 4
- Elements of a matrix (matrix notation)
- Each number or letter is called an element of the matrix.
- Each element can be located in the matrix by stating its
position in the row and the column.
𝑎11 𝑏12 𝑐13
Consider matrix Q = ) * 2 x 3 matrix
𝑑21 𝑒22 𝑓23
a11 first row and First column.
b 12 first row and second column
c 13 first row and third column
d21 second row and first column
e 22 second row and second column
f23 second row and third column
2|Page
Example
How many elements are there in a matrix of order?
𝑎 𝑏
a) 4 x 2 𝑐 𝑑 These are 8 elements.
𝑒 𝑓
g h
(m x n) mn elements
b) 1 x 3
(q r s)
= 3 elements
Example
3 4 5 6
Given A = 2 1 ,1 ,2
,4 ,3 0 7
What is the element?
i) aI,3 = 5
ii) a2,1 = 2
iii) a3,4 =7
iv) a3,3 =0
Further exercises
Reference; Discovery maths Book 3
Exercise 8.1
Page 80
3|Page
ADDITION AND SUBTACTION OF MATRICES
- Matrices can be added or subtracted if they are of the same
order. The sum of two or more matrices is obtained by adding
corresponding elements. Subtraction is also done in the same
way.
- The resulting matrix is of the same order.
- The operation is done as follows;
𝑎 𝑏 𝑐 𝑔 ℎ 𝑖 𝑎-𝑔 𝑏-ℎ 𝑐-𝑖
) *±) * = ) *
𝑑 𝑒 𝑓 𝑗 𝑘 𝑙 𝑑-𝑗 𝑒-𝑘 𝑓-𝑙
Example:
2 3 2 ,3
Given that P =( ) and Q =( )
1 2 ,1 2
a) Find P+ Q adding the corresponding elements.
2 3 2 ,3 2 + 2 3 + ,3
( ) + ( ) = ( )
1 2 ,1 2 1 + ,1 2 + 2
4 0
=( )
0 4
b) P – Q
Subtracting Q from P
2 3 2 ,3 2, 2 3 , ,3
( ) - ( ) = ( )
1 2 ,1 2 1 , ,1 2, 2
4|Page
0 6
=( )
2 0
c) Q –P
Q P
2 ,3 2 3 2,2 ,3 , 3
( ) , ( ) = ( )
,1 2 1 2 ,1 , 1 2,2
0 ,6
=( )
,2 0
- Matrix addition is commutative
i.e. P + Q = Q + P
but
Matrix subtraction is non-commutative
P-Q ≠Q-P
Example
4 5 2 0 3 5
If A = [ \ , 𝐵= [ \ and C = [ \
3 2 0 6 1 6
Find;
a) A- B+ C
4 5 2 0 3 5
[ \ , [ \ + [ \=
3 2 9 6 1 6
4,2+3 5,0+5 5 10
[ \=[ \
3,9+1 2,6+6 ,5 2
5|Page
b) A- ( B + C)
4 5 2 0 3 5
[ \, [ \ + [ \ √ start with the bracket.
3 2 9 6 1 6
4 5 2+3 0+5
[ \,[ \=
3 2 9+1 6+6
4 5 5 5
[ \,[ \ = √ subtracting
3 2 10 12
4,5 5,5
=[ \
3 , 10 2 , 12
,1 0
=[ \
,7 ,10
Comment on the answer in (a) and (b) above.
NB// Two or more matrices are compatible for addition or
subtraction only if they are of the same order.
Exercise
4 1 0 4 2 3 9 4 3
Given that R = 4 2 4 ‘ S= 2 3 0 and 𝑇 = 6 2 3
6 2 3 5 1 2 3 6 9
6|Page
Find
a) R + S+ T
b) T - S
c) ( R –S ) + T
d) T- R
Further exercises
Reference: KLB maths book 3
Exercise 8.1
Page 171
Multiplying a matrix by a scalar
3 1 3 1
Suppose matrix Q = [ \ , 𝑡ℎ𝑒𝑛 𝑄 + 𝑄 + 𝑄 = [ \ +
1 4 1 4
3 1 3 1
[ \ +[ \
1 4 1 4
3+3+3 1+1+1
=[ \
1+1+1 4+4+4
9 3
=[ \
3 12
But Q + Q + Q = 3Q
3 1
3Q= 3 [ \multiply the elements by 3
1 4
3.3 3.1
=[ \
3.1 3.4
9 3
=[ \
3 12
7|Page
To multiply a matrix by a scalar, we multiply each element of the
matrix by the scalar e.g.
𝑎 𝑏 𝑐 𝑚𝑎 𝑚𝑏 𝑛𝑐
m[ ]=[ ]
𝑑 𝑒 𝑓 𝑚𝑏 𝑚𝑒 𝑚𝑓
Example
Find K if
3 0 ,1 2 6 6
k[ \ + 3[ \=[ \
1 2 3 ,4 12 ,6
Solution
K is a scalar, so we multiply it by the matrix as follows.
3𝑘 0 ,3 6 6 6
[ \+[ \=[ \
𝑘 2𝑘 9 ,12 12 ,6
Equating the corresponding elements
3𝑘 , 3 0+6 6 6
[ \=[ \
𝑘+9 2𝑘 , 12 12 ,6
3k- 3 = 6 0 +6 = 6
K+9 = 12 2k – 12 = -6
Solve one equation to get the value of K e.g.
8|Page
3k - 3= 6 +3
3k = 6+ 3
3𝑘 9
=
3 3
K= 3
Example
8 2
Given B = [ \
7 4
Find;
a) 2B
b) ½ B
Solution
8 2
a) 2B = 2 [ \ - multiplying
7 4
2. 8 2.2
=[ \
2.7 2.4
16 4
=[ \
14 8
8 2
b) ½ B = ½ [ \
7 4
1 1
. 8 .2
=[12 2
1 \
.7 . 4
2 2
4 1
=[ \
3.5 2
9|Page
Example: find x and y if;
𝑥 3 𝑥 4 18 7
5[ \ , 2[ ]=[ \
7 3 𝑦 2 29 11
Solution
Multiplying the scalars by the matrices
5𝑥 15 2𝑥 8 18 7
[
\,[ ]=[ \
35 15 2𝑦 2 29 11
Solving and equating the corresponding elements.
5x -2x = 18
35 – 2y = 29
Solving for x
5x-2x= 18 Solving for y
35 - 2y = 29
3𝑥 18
=
3 3 35- 29 = 2y
X= 6 6 2𝑦
=
2 2
Y=3
Example
𝑝+𝑞+𝑟 8
Find the unknowns in 𝑝 + 2𝑞 = 6
3𝑝 6
10 | P a g e
Solution
Equating the corresponding elements;
P + q+ r = 8
P + 2q = 6
3p = 6
Solving for p;
3𝑝 6
=
3 3
P=2
Replacing P in p + 2q =6 to obtain q
P=2
So 2 + 2q = 6 -2
2
2𝑞 4
= q=2
2 2
Replacing q = 2 and p = 2 in p + q + r = 8
2 + 2 + r= 8
4+8 =8 - 4
r=8-4
r=4
P = 2, q = 2 and r = 4
11 | P a g e
Exercises: Discovery maths Book 3
Exercise 8.2
Page 82
Multiplying a matrix by a matrix
To multiply two matrices, the number of columns in the first matrix
must be equal to the number of rows in the second matrix.
𝑥
i.e. ( a b c) 𝑦 = (ax + by + cz)
𝑧
Example
4
If P = (2 34) and Q = 3
2
ThenPQ is;
4
(2 3 4) 3 = 2 x4 + 3 x 3 + 4 x 2)
2
= ( 8+ 9+ 8)
= (25)
𝑢 𝑣
𝑎 𝑏 𝑐 𝑤 𝑥
If A =[ ] and B =
𝑑 𝑒 𝑓 𝑦 𝑧
To find AB, the answer will be;
12 | P a g e
- First note that the number of columns in the matrix A is 3 and it
is the same as the number of rows in matrix B which is also
three.
- Multiply the elements of each row of the first matrix (A) by the
elements of each column in the second matrix (B).
Add the products: this gives the answer to the first element in the
first row, first column.
𝑢 𝑣
𝑎 𝑏 𝑐 𝑤 𝑥 =(a x u) + ( b x w) + ( c x y) = i
𝑑 𝑒 𝑓 𝑦 𝑧
𝑢 𝑣
𝑎 𝑏 𝑐 𝑤 𝑥 = ( a x v ) + ( b x X) + ( c x z) = j
𝑑 𝑒 𝑓 𝑦 𝑧
Move to the second row of the first matrix multiply by the element
of each column in the second matrix.
𝑢 𝑣
𝑎 𝑏 𝑐 𝑤 𝑥 = ( d x u) + ( e x w) + ( f x y) = k
𝑑 𝑒 𝑓 𝑦 𝑧
𝑢 𝑣
𝑎 𝑏 𝑐 𝑤 𝑥
= = ( d x v) + ( e x x) + f x z ) = L
𝑑 𝑒 𝑓 𝑦 𝑧
so the product AB is equal to;
13 | P a g e
𝑢 𝑣
𝑎 𝑏 𝑐 𝑖 𝑗
= 𝑤 𝑥 =
𝑑 𝑒 𝑓 𝑦 𝑧 𝑘 𝑙
Example
,4 6 2 ,1
a) Work out 3 ,3 4 0
,5 6 8 2
Solution
Multiply the elements of each row of the first matrix by the elements
of each column in the second matrix ( the second matrix has only
one column)
(,4 𝑥 , 1) + ( 6 . 0) + (2 . 2)
(3𝑥 , 1 ) + (,3 . 0) + (4 . 2)
(,5𝑥 , 1) + (6 . 0) + ( 8 . 2)
Opening the brackets
4 + 6+ 4
,3 , 0 + 8
5 + 6 + 16
Adding
14
= 5
27
14 | P a g e
,2 4 ,2 1
b) Work out [ \[ \
3 ,6 2 1
Solution
,2 4 ,2 1
[ \[ \=
3 ,6 2 1
Multiplying the elements of each row of the first matrix by the
elements of each column in the second matrix.
= (-2 X -2) + (4 X 2) (-2 x 1 ) + ( 4 X 1)
(3X -2) + ( -6 x 2) (3 x 1) + ( -6 x 1)
4+8 ,2 + 4
=
,6 , 12 3,6
12 2
= [ \
,18 ,3
12 +2
In example (b) above, the answer is [ \,
,18 ,3
Compare the answer if we interchange the matrix and work out.
,2 1 ,2 4
[ \[ \=
2 1 3 ,6
(,2 . ,2) + (1 . 3) (,2 . 4) + (1 . ,6)
(2 . ,2) + ( 1 . 3) (2 . 4) + (1 . ,6)
15 | P a g e
4+ 3 ,8 , 6
=
,4 + 3 8,6
7 ,14
=[ \
,1 2
N/B: AB ≠ BA
It’s important to notice (observe) the order in which the matrix
product is required. If A comes before B. B is said to be pre-
multiplied by A. If A comes after B, B is said to be post multiplied by
A.
Further exercises;
Reference: Advancing maths Book 3
Exercise 8.5
Page 112-113
Discovery maths book 3
Exercise 8.3
Page 85
KLB Maths Book 3
Exercise 8.2
Page 179- 182
Types of matrices
Row and column matrix
A matrix that has only one row is called a row matrix.
16 | P a g e
For example; ( 1 2 3 4 )
A matrix that has only one column is called a column matrix;
For example;
1
2
3
4
A square matrix
This is a matrix that has an equal number of rows and columns.
𝑎 𝑏
for example; [ \ is a 2 x 2 matrix.
𝑐 𝑑
𝑎 𝑏 𝑐
𝑑 𝑒 𝑓 is a 3 X 3 matrix
𝑔 ℎ 𝑐
In general, if the order of a matrix is n x n, then it is a square matrix.
An identity matrix
Identity matrix is a square matrix which has only 1’s in the diagonal
from the top left corner to the bottom right corner and O’s
elsewhere. TheI’s are said to be in the leading or main diagonal.
It is a square matrix that does not alter another matrix after a
multiplication.
Examples of identity matrices are;
1 0 0
1 0
0 1 0 [ \
0 1
0 0 1
17 | P a g e
Such matrices are denoted by the letter I and for any matrix A of the
same order as I , AI = IA = A
EXAMPLE
1 0 𝑃 𝑞 (1 . 𝑃) + (𝑂 . 𝑟) (𝐼 . 𝑞) + (0 . 5)
[ \[ \ =
0 1 𝑟 𝑆 (0 . 𝑝 ) + (𝐼 . 𝑟) (𝑂 . 𝑞) + (1 . 5)
𝑝+𝑂 𝑞+𝑜
= [ \
𝑂+𝑟 𝑜+ 𝑠
𝑝 𝑞
=
𝑟 𝑠
A null or zero matrix
A zero matrix is a matrix of any order, not necessarily square, with all
its elements zero.
0 0 0
For example; Type equation here.
0 0 0
It is denoted by O, and has the property that OA =AO = O, provided
that O and A are compatible both ways.
O is also an additive identity, that is
A + O = O + A = A, provided that O and A are of the same order. Thus,
O behaves like the number zero.
Equal matrices
These are matrices that are of the same order and elements in
corresponding position are equal.
𝑎 𝑏 𝑤 𝑥
For example, if P = [ \and Q = [ 𝑦 𝑧\
𝑐 𝑑
18 | P a g e
and P = Q then
a=w
b= x
c= y
d= z
Example
1 2 0 0
If A = [ \,find a 2 X 2 matrix B such that AB = [ \
2 1 0 0
Solution
𝑎 𝑏
Let B =[ \
𝑐 𝑑
1 2 𝑎 𝑏 𝑜 𝑜
Then[ \[ \=[ \
2 1 𝑐 𝑑 𝑜 𝑜
𝑎 + 2𝑐 𝑏 + 2𝑑 0 0
[ \=[ \=
2𝑎 + 𝑐 2𝑏 + 𝑑 0 0
a+ 2c= 0 b + 2d= 0
2a + c = 0 2b + d = 0
19 | P a g e
Solving simultaneous equations
2 a + 2c = 0 2 b + 2b = 0
1 2a + c = 0
1 2b + d = 0
2a + 4c = 0
2a + 4c = 0 2b + 4d = 0
2b + d = 0
3𝑐 0
= 3𝑑 0
3 3 =
3 3
C= 0 d= 0
b+0=0
a+0=0
b= 0
a= 0
0 0
B=( )
0 0
THE DETERMINANT OF A 2 X 2 MATRIX
𝒂 𝒃
[ \Is a 2 X 2 matrix. The elements a and d form the leading
𝒄 𝒅
(main) diagonal. The elements b and c form the secondary diagonal.
The number obtained by subtracting the product of the elements of
the secondary diagonal from the products of the elements of the
leading diagonal is known as the determinant of the matrix.
4 7
If p =[ \ then the determinant of P is
1 2
(4 X 2) - (7 X 1) =
20 | P a g e
8–7=1
This is written in short as
det P= 1
𝑎 𝑏
If A = [ \ , the determinant of A is
𝑐 𝑑
det A = ad – bc.
Example
State the determinant of the following matrices.
2 ,5
a) [ \
3 6
Solution
= ad – bc
(2 X 6) - (3X -5)
12 - (-15)
= 12 + 15
= 27
,2 2
( )
6 ,9
Solution
= ad- bc
(-2X-9) - (6 X2)
18 - 12
=6
21 | P a g e
3 6
[ \
2 4
Solution
= ad – bc
(3. 𝟒) - ( 2 . 6 )
= 12 – 12
=0
The inverse of a 2 X 2 matrix
- Given matrices A and B, then A is the inverse of B if AB = BA = I (Identity matrix).For A
to be an inverse of B and vice versa, both A and B must be square matrices which
have the same number of columns and rows.
- The inverse of a matrix A is written as A-I.
𝑎 𝑏
To find the inverse of matrix A =[ \;
𝑐 𝑑
𝑎 𝑏
1. Find the determinant of matrix [ \ that is;
𝑐 𝑑
ad -bc
2. Interchange the elements in the leading diagonal
𝑎 becomes 𝑑
𝑑 𝑎
3. change the signs of the elements in the secondary diagonal ( 𝑏 ) will be
𝑐
( ,𝑏)
,𝑐
4. combine the results of step 2 and 3 to get
𝑑 ,𝑏
[ \
,𝑐 𝑎
𝑑 ,𝑏
5. divide each element of [ \ by the determinant ad – bc to get the
,𝑐 𝑎
22 | P a g e
1 𝑑 ,𝑏
Inverse as [ \
𝑎𝑑−𝑏𝑐 ,𝑐 𝑎
EXAMPLE
3 ,2
Find the inverse of ; [ \
4 5
Solution
3 ,2
Find the determinant of [ \ = (3 X 5) - (4X -2)
4 5
= 15 - -8
= 23
Interchanging the elements in the leading diagonals,
5 ,2
[ \
4 3
Change the signs in the secondary (other) diagonal.
5 2
[ \
,4 3
Then dividing each element of the interchanged matrix by the determinant;
1 5 2
[ \
𝑑𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑛𝑡 ,4 3
𝟏 𝟓 𝟐
= [ \
𝟐𝟑 ,𝟒 𝟑
𝟓 𝟐
𝟐𝟑 𝟐𝟑
=[ −𝟒 𝟑
\
𝟐𝟑 𝟐𝟑
Example
1 4
Find Q-I given that Q =[ \
0 2
SOLUTION
- Determinant of Q = (1 X 2) - ( 0 X 4)
23 | P a g e
= 2-0
=2
- Interchanging the elements of the leading diagonal.
2 4
=[ \
0 1
2 ,4
- Changing the signs in the secondary diagonal [ \but -0=0
,0 1
- Dividing each element of the interchanged matrix by the determinant.
1 2 ,4
[ \
det 𝑄 0 1
1 2 ,4
[ \
2 0 1
2 −4
|02 2
1 |=
2 2
1 ,2
Q-I= [0 1 \
2
Examples
6 3
Find the inverse of [ \
2 1
Solution
6 3
Find the determinant of [ \
2 1
(6 X 1) - (3X 2)
6 -6
=0
When the determinant of a matrix is equal to zero, then the matrix has no inverse. Any
matrix whose determinant is zero is called a singular matrix.
Exercises
Determine the value of x given that the matrices are singular matrices.
24 | P a g e
2𝑥 5
a) [ \
10 𝑥
𝑥 4
b) [ \
𝑥+𝐼 6
Further exercises
Reference: discovery maths book 3
Exercise 8.4
Page 88
KLB maths Book 3
Exercise 8.3
Page 187
Solving simultaneous equations using matrices
Linear equations can be solved using the inverse matrix. Consider the linear equation;
3x + y = 4
4x + 3y = 7
Using elimination, substitution or graphical method, we obtain the solution
x=1
y =1
The equation can be written in matrix form as
[
3 1
\= * +
4
4 3 7
3 1
The matrix [ \ is called the co-efficients Matrix of the simultaneous equations.
4 3
The matrix (47) is called the constants matrix.
3 −1
5 5
The inverse of the coefficients matrix is [−4 3 \
5 5
25 | P a g e
Pre-multiplying both sides of the matrix equation by the inverse.
3 −1 3 −1
5
[−4 5
\ [
3 1 𝑥
\ ( ) = 5
[−4 5
\
4
)7*
3 4 3 𝑦 3
5 5 5 5
3 −1
.4 .7
[
1 0
\ 𝑥)
(𝑦 = [ 5 5
\
0 1 −4 3
.7
5 5
12 −7
1 0 𝑥) 5
+ 5
[ \ (𝑦 = [−16 21 \
0 1 +
5 5
5
(𝑦𝑥 ) = () 5
5
5
(𝑦𝑥 ) = (11)
∴ x = 1 and y = 1
In general;
Given the two simultaneous equations
ax + by = p
(x + dy) = q
Write down the matrix equation as
𝑎 𝑏 𝑥 𝑝
[ \ ) * = ) *
𝑐 𝑑 𝑦 𝑞
26 | P a g e
The solutions are given by
𝑑 ,𝑏
(𝑦𝑥 ) =
1 [ \ (𝑝𝑞)
𝑎𝑑−𝑏𝑐 ,𝑐 𝑎
Provided that ad- bc ≠ 0
Example
Solve the simultaneous equation below.
2x - 3y = 5
-x + 2y = -3
Solution
Write the simultaneous equation in this form;
2 ,3 𝑥 5
[ \ ) * = ) *
,1 2 𝑦 ,3
Find the inverse of the coefficient matrix.
2 ,3
[ \= determinant is (2X2 ) – (-1 X -3)
,1 2
=4-3
=1
1 2 3 2 3
= [ \ = = [ \ inverse
1 1 2 1 2
Pre-multiply both sides of the matrix equation by the inverse.
𝟐 𝟑 𝟐 ,𝟑 𝒙 𝟐 𝟑 𝟓
[ \ [ \= (𝒚) [ \ ( )
𝟏 𝟐 ,𝟏 𝟐 𝟏 𝟐 −𝟑
1 𝑂 𝒙 (2 . 5) + (3𝑋 , 3)
[ \ ( ) =[ ]
0 1 𝒚 (1 . 5) + (2𝑋 , 3)
27 | P a g e
1 𝑂 𝒙 10 + ,9
[ \ ( ) =[ \
0 1 𝒚 5 + ,6
(𝒚𝒙) = (−𝟏
𝟏
) hence x= 1
Y = -1
Example
Solve the following simultaneous equation using matrix method.
x + 2y = 7
-y + x = 1
Solution
Rewrite the simultaneous equation in this form
x + 2y = 7
x -y =1
Then rewrite in matrix form
1 +2 𝒙 𝟕
[ \ ( ) = ( )
1 ,1 𝒚 𝟏
Find the inverse of the coefficient matrix
1 +2
[ \ Determinant is (-1X1) – (1X+ 2)
1 ,1
-1- 2
-1-2
=3
1 ,𝟏 ,𝟐
( )
3 ,𝟏 𝟏
−𝟏 −𝟐
𝟑 𝟑
=(−𝟏 𝟏 ) inverse
𝟑 𝟑
28 | P a g e
Pre-multiply both sides of the matrix equation by the inverse.
−1 −2 −1 −2
1 +2 𝑥
3
(−1 3
1 ) ( 3
) ( )= (−1 3
1 ) (71)
1 ,1 𝑦
3 3 3 3
−1 −2
,1 0
( ) (𝑥 )= (−1
3 3
1 ) (71)
0 ,1 𝑦
3 3
−1 −2
−𝑥 3
.7+ .1
3
(−𝑦 )= ( −1 1 )
.7 . 1
3 3
−7 −2
−𝑥
+
3 3
(−𝑦 )= (−7 1 )
+
3 3
−9
−𝑥
(−𝑦 ) =( ) 3
−6
3
−𝑥
(−𝑦 ) = (−3
−2
) Negative cancels
𝑥 3
) *=) *
𝑦 2
Exercise
4 3 2 𝑚
1. Two matrices A and B are such that P= [ \ and Q= [ \. Given that the
2 2 1 5
determinant of PQ is 14, find the value of m.
2. The cost of the shorts and three pairs of trousers is sh. 3700 while the cost of four
shirts and two trousers is sh. [Link] using the matrix method the cost of each
item.
29 | P a g e
3 4 2 2
3. Given the matrices A = [ \ and B [ \ and that R = AB, find R-1
2 1 ,5 1
Further exercises Discovery maths Book 3 page 90-91
Reference: Exercise 8.5
Further exercise 8
KLB Book 3
Exercise 8.4
Page 190
30 | P a g e
31 | P a g e