Topic 4 Matrices (4)
Topic 4 Matrices (4)
4.1 Matrices
LEARNING OUTCOMES
4.1.1 Definition
n columns
Page | 60
Topic 4: Matrices and System of Linear Equations
Types of Matrices
Square Matrix
A matrix with an equal number of rows and columns is a square matrix.
For example :
1 3 2
2 3
A= , B = 3 1 2
−1 5 2 3 1
Zero Matrix
A matrix with elements that are all 0’s.
For example :
0 0 0 0 0
A = 0 0 0 , B = 0 0 0 , C = 0 0
0 0 0 0 0
Diagonal Matrix
A square matrix is where all the elements are zero except the elements in the principal
diagonal.
For example:
1 0 0 a 0 0
2 0
A= B = 0 2 0 C = 0 0 0
0 3 0 0 3 0 0 b
Identity Matrix
Identity Matrix is a matrix with all entries in the main diagonal are 1 and others are
zero.
1 0 0
1 0
A= B = 0 1 0
0 1 0 0 1
Page | 61
Topic 4: Matrices and System of Linear Equations
Equal Matrices
Two m n matrices are equal if they have the same dimension and their
corresponding entries are equal.
Example
Which matrices below are the same?
1 2 1 2 2 1
A= B = 1 2 , C = 2 1 , D = , E=
1 ,
,
2 2 1 2 1
1 2
F = 2 1 .
2 1
SOLUTION
A=D
Page | 62
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.1
3 − a 6 4 9 6 − c 4
Let A = =
4b 2 2 − 3d − 8 2
, and B .
8
If A = B, find value of a, b, c, and d.
SOLUTION
3− a = 9 4b = −8 6−c = 6 2 − 3d = 8
a = −6 b = −2 c=0 3d = −6
d = −2
NOTE
EXAMPLE 4.2
1 2 4 3
Simplify the given quantity for A = , B=
3 4 − 5 6
(a) A + B (b) A – B
SOLUTION
1 2 4 3 1+ 4 2 + 3 5 5
(a) A + B = + = =
3 4 − 5 6 3 + (−5) 4 + 6 − 2 10
1 2 4 3 1− 4 2 − 3 − 3 − 1
(b) A – B = - = =
3 4 − 5 6 3 − (−5) 4 − 6 8 − 2
Try this! p q − p q 3p − 2q
If A = , B = and C = , find 2A – 3B + 4C.
r s r − s − 4r 5s
17 p − 9q
Ans:
− 17 r 25s
Page | 63
Topic 4: Matrices and System of Linear Equations
b) Scalar Multiplication
EXAMPLE 4.3
2 − 4
1
Compute − · 8 5
2
− 6 7
SOLUTION
2 − 4 (− 12 )2 (− 12 )(−4) −1 2
1
5 = (− 2 )8 (− 2 )5 = − 4 − 52
− · 8 1 1
2
− 6 7 (− 12 )(−6) (− 12 )7 3 − 72
EXAMPLE 4.4
2 1
1 2 3
Multiply − 3 4
− 2 0 5 2 1
SOLUTION
2 1
1 2 3 1(2) + 2(−3) + 3(2) 1(1) + 2(4) + 3(1)
− 2 0 5 − 3 4 = − 2(2) + 0(−3) + 5(2) − 2(1) + 0(4) + 5(1)
2 1
2 12
=
6 3
Page | 64
Topic 4: Matrices and System of Linear Equations
For all matrices A, B and C where the sum and product of matrices are defined
A ( B + C ) = AB + AC
NOTE
If A is a square matrix, then A2 = AA, A3 = AAA
(A )T T
=A
( A + B ) = AT + BT and ( A − B ) = AT − BT
T T
( AB ) = BT AT
T
( kA) = kAT
T
Page | 65
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.5
1 2 3 4 1 4
Let A = , B= and C= .
3 4 2 1 3 2
SOLUTION
1 + 3 + 1 2 + 4 + 4 5 10
A+B+C = =
3 + 2 + 3 4 + 1 + 2 8 7
5 8
Therefore (A + B + C)T = and
10 7
1 3 3 2 1 3 5 8
AT + BT + CT = + + =
2 4 4 1 4 2 10 7
Thus (A + B + C)T = AT + BT + CT
T
3 4 1 4 3 + 12 12 + 8
T T
15 20
(b) (BC)T = = =
2 1 3 2 2+3 8+2 5 10
15 5
=
20 10
T T
1 4 3 4
T T
CB =
3 2 2 1
1 3 3 2
=
4 2 4 1
3 + 12 2 + 3
=
12 + 8 8 + 2
15 5
=
20 10
(BC)T = CTBT
Page | 66
Topic 4: Matrices and System of Linear Equations
1 a − b
1 2
Example A= , B = a 3 c
2 3 − b c 2
Solution:
1 a − b
1 2
T
A = , B = a 3 c
T
2 3 − b c 2
NOTE
In a symmetric matrix, the elements are symmetrical about the leading diagonal
.
Example 0 2 − 1
0 2
A= B = − 2 0 − 3
− 2 0 1 3 0
0 −2 1 0 2 −1
− B = − 2 0 3 = −2 0 −3 = B
T
−1 −3 0 1 3 0
Page | 67
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.6
5 − 1 1 1
Find A and B if AT + 2 B T = and 2 AT + B T = .
− 2 3 2 0
− 1 2 3 − 2
Ans: A = , B=
1 − 1 − 1 2
SOLUTION
EXAMPLE 4.7
− 1 0 − 3 3 9 3
If C = ( A − B ) where A = 6 9 2 and B = 0 8 1 , find matrix C.
T
7 0 1 7 6 8
Ans: ( A − B ) = AT − BT
T
SOLUTION
Page | 68
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.8
1 0 0
Given H = −1 −2 0 , find the real number of p and q if H 2 = pH + qI where I is
−1 −3 1
the identity matrix of order 3 x 3. Hence, show that H 4 = −5 H + 6 I
Ans : p = -1 , q = 2
SOLUTION
Page | 69
Topic 4: Matrices and System of Linear Equations
Example
Given A = [-2], so det A = A = -2
Example 2 5
Given A = ,
3 8
2 5
so det A = A = = [(2)(8) − (3)(5)] = 16 − 15 = 1
3 8
Page | 70
Topic 4: Matrices and System of Linear Equations
then det A can be obtained by the following diagonal expansion. Form a 3 x 5 matrix
by augmenting A on the right with its first two columns. Then obtain the sum of
multiplication of elements in every arrow to the right minus the sum of multiplication
of elements in every arrow to the left.
a11 a12 a13 a11 a12
Det A = A = a21 a22 a23 a21 a22
a31 a32 a33 a31 a32
= a11 a22 a33 + a12 a23 a31 + a13 a21 a32 − a13 a22 a31 + a11 a23 a32 + a12 a21 a33
EXAMPLE 4.9
= 0 − 64 + 12 − 0 + 24 − 24
= -52
Page | 71
Topic 4: Matrices and System of Linear Equations
Let A be n n matrix,
1. The minor of the element aij in A denoted by M ij is the determinant of the sub-
matrix obtained from A ,by deleting the ith row and jth column of A.
For example: Consider determinant of matrix A of order 3.
1 2 −1
A = 3 4 2 , the minor of element a11 is M 11 .
1 4 3
M11 is the determinant of the sub-matrix obtained by deleting the first row and the
first column from A.
Similarly
M32 = 1 2 −1 = 1 − 1 = 1.2 – 3(-1) = 5
3 4 2 3 2
1 4 3
2. The cofactor cij of the element aij is denoted by cij and defined by
cij = ( - 1 )i +j Mij
M ij if i + j = even
cij =
− M ij if i + j = odd
Page | 72
Topic 4: Matrices and System of Linear Equations
Determinant
n
Let A be a n n matrix, then A = aij cij for any row i or
j =1
n
A = aij cij for any column j.
i =1
EXAMPLE 4.10
2 −2 0
By using cofactor, find the determinant of A = −3 1 3 by using the elements
−2 −4 −1
in (i) the first row (ii) the third column
SOLUTION
(i)
2 −2 0
A = −3 1 3
−2 −4 −1
1 3 −3 3 −3 1
= 2 (−1)1+1 + (−2) (−1)1+ 2 + (0) (−1)1+3
−4 −1 −2 −1 −2 −4
= 2(−1 + 12) + 2(3 + 6) + 0
= 22 + 18
= 40
(ii)
2 −2 0
A = −3 1 3
−2 −4 −1
−3 1 2 −2 2 −2
= 0 (−1)1+3 + (3) (−1) 2+3 + (−1) (−1)3+1
−2 −4 −2 −4 −3 1
= 0(12 + 2) − 3(−8 − 4) − 1(2 − 6)
= 36 + 4
= 40
NOTE
Page | 73
Topic 4: Matrices and System of Linear Equations
If each element of any row (or column) of a determinant is multiplied by a constant k, the new
determinant is k times the original.
ka11 ka12 ka13 a11 a12 a13
a21 a22 a23 = k a21 a22 a23
a31 a32 a33 a31 a32 a33
1 2 3 1 2 3
Example
4 8 −4 = 4 1 2 −1
1 1 0 1 1 0
Example 3 −2 5
0 0 0 =0
−1 4 9
If two rows (or columns) of a determinant are interchanged, the sign of the determinant is
changed.
1 0 9 1 9 0
Example −2 1 5 = − −2 5 1 Second and third
3 0 7 3 7 0 column are
interchanged
2 3 2 −1
Example = = 4+3= 7
−1 2 3 2
Page | 74
Topic 4: Matrices and System of Linear Equations
8. If each element of any row (or column) of A is the sum of two terms,
Example a + b+ a b
= +
c d c d c d
EXAMPLE 4.11
1 −1 0
If A = −3 x − 2 2 and A = −5 , find
0 −2 x + 1
SOLUTION
1 −1 0
(a) A = −3 x − 2 2
0 −2 x + 1
x−2 2 −3 2 −3 x − 2
=1 − (−1) +0 (using row 1)
−2 x + 1 0 x +1 0 −2
= [( x − 2)( x + 1) − (−4)] + [−3( x + 1) − 0] + 0
− 5 = x 2 − x − 2 + 4 − 3x − 3
x2 − 4 x + 4 = 0
( x − 2) 2 = 0
x=2
Page | 75
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.12
1 2 2
Given that P = m 1 2 where m and n are integers. Using the determinant
2 2 n
2m 1 2
properties, find the value of 2 2 2 in terms of t if P = t.
4 2 n
Ans: -2t
SOLUTION
Page | 76
Topic 4: Matrices and System of Linear Equations
4.3.1 Definition
Theorem:
If A is a square matrix of order n n , then A-1 exist if and only if
determinant (det) A 0 or A is non-singular matrix.
Theorem:
If A and B are two non-singular matrices of order
n n , then ( AB ) = B −1 A−1
−1
Proof:
Let C = AB
multiply C by B −1 A−1
CB −1 A−1 = AB( B −1 A−1 ) , ( B −1 A−1 ) C = ( B −1 A−1 ) AB
= ABB −1 A−1 = B −1 A−1 AB
= AIA−1 = B −1 IB
= AA−1 = B −1 B
=I =I
Page | 77
Topic 4: Matrices and System of Linear Equations
NOTE
EXAMPLE 4.13
1 2 3 11 −3 −10
Let A = 0 4 1 and B = 1 0 −1 . Show that AB = BA and hence,
1 1 3 −4 1 4
find A −1 .
11 −3 −10
−1
Ans: A = 1 0 −1
−4 1 4
SOLUTION
EXAMPLE 4.14
1 2 1
Given that matrix A = 1 −1 0 , find the matrix A2 . If A 3 − A 2 − 6 A = I , where I
3 1 1
is an identity matrix, find the inverse matrix of A.
6 1 2 −1 −1 1
−1
Ans: A = 0 3 1 , A = − 1 − 2 1
2
7 6 4 4 5 − 3
SOLUTION
Page | 78
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.15
SOLUTION
2 4 3 4 3 2
c11 = (-1)1+1 c12 = (-1)1+2 c13 = (-1)1+3
1 3 1 3 1 1
= 6 -4 = 2 = - ( 9 – 4) = -5 = 3 -2 =1
2 3 1 3 1 2
c21 = (-1)2+1 c22 = (-1)2+2 c23 = (-1)2+3
1 3 1 3 1 1
= - (6 – 3 ) = -3 =3–3=0 = - (1 – 2 ) = 1
2 3 1 3 1 2
c31 = (-1)3+1 c32 = (-1)3+2 c33 = (-1)3+3
2 4 3 4 3 2
=8–6 = - (4 – 9 ) = 2 -6
=2 =5 = -4
−T
2 −5 1 2 −3 2
Therefore, adj ( A) = −3 0 1 = −5 0 5
2 5 −4 1 1 −4
Page | 79
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.16
1 1 − 1
Find an inverse matrix of A = 2 − 3 1
2 1 2
SOLUTION
A = 1( −6 − 1) − 1( 4 − 2 ) − 1( 2 + 6 )
= −17
−3 1 2 1 2 −3
−
1 2 2 2 2 1 − 7 − 2 8
1 −1 1 −1
= − 3 4 1
1 1
Cofactor A= C ij = − −
1 2 2 2 2 1 − 2 − 3 − 5
1 −1 1 −1 1 1
−
− 3 1 2 1 2 −3
− 7 − 3 − 2
adj A = [Cij ] = − 2 4 − 3
T
8 1 − 5
− 7 − 3 − 2 7 3 2
1
2 − 4 3
−11 1
A = adj A = − 2 4 − 3 =
A − 17 17
8 1 − 5 − 8 − 1 5
7 3 2 1 1 − 1 17 0 0
1 1
Check!
−1
A A=
2 − 4 3 2 − 3 1 = 0 17 0 = I
17 17
− 8 − 1 5 2 1 2 0 0 17
Page | 80
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.17
1 −1 0
Find an inverse matrix of A = 2 3 − 2 .
− 2 0 1
3 1 2
−1
Ans: A = 2 1 2
6 2 5
SOLUTION
Page | 81
Topic 4: Matrices and System of Linear Equations
1 2 3
Consider matrix A = − 1 2 0
3 1 1
1 2 3 3 1 1
R1 R3
*
−1 2 0 −1 2 0
3 1 1 1 2 3
1 2 3 1 2 3
2 R2 → R2
*
−1 2 0 − 2 4 0
3 1 1 3 1 1
3. Multiply all the elements of a row by a scalar and add the product to another
row.
Example
multiplying the first row by –3 and adding the product to the
third row.
1 2 3 1 2 3
*
−1 2 0 − 3R1 + R3 → R3 − 1 2 0
3 1 1 0 − 5 − 8
To find the inverse of a matrix A, start by writing the matrix in the form ( A I ) and
changed it by elementary row operations into ( I B ) . The resulting matrix B is the
inverse of A.
Page | 82
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.18
2 −1 1
If A = 1 −1 −1 . Find A−1 by using elementary row operation.
2 −2 −1
SOLUTION
2 −1 1 1 0 0 1 −1 −1 0 1 0
( A I ) = 1 −1 −1 R1 R2
0 1 0 ⎯⎯⎯→ 2 −1 1 1 0 0
2 −2 −1 0 0 1 2 −2 −1 0 0 1
1 −1 −1 0 1 0
Procedure:
Step1: Obtain a 1 in the first
( −2) R1 + R2 → R2 *
⎯⎯⎯⎯⎯→ 0 1 3 1 −2 0
position on the leading diagonal. 2 −2 −1 0 0 1
Step 2: Obtain zeros under 1 in
the first column. 1 −1 −1 0 1 0
Step 3: Obtain a 1 in the second
( −2) R1 + R3 → R3 *
⎯⎯⎯⎯⎯→ 0 1 3 1 −2 0
position on the leading diagonal. 0 0 1 0 −2 1
1 3 −2
Therefore A = B = 1 4 −3
−1
0 −2 1
Page | 83
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.19
2 0 − 1
If A = − 1 2 1 . Find A−1 by using elementary row operation.
3 − 2 − 4
3 1 1
4 − −
4 4
1 5 1
Ans: A−1 =
8 8 8
1 −
1
−
1
2 2 2
SOLUTION
Page | 84
Topic 4: Matrices and System of Linear Equations
EXAMPLE 4.20
1 −1 0
If A = 2 3 −2 . Find A−1 by using elementary row operation.
−2 0 1
3 1 2
−1
Ans: A = 2 1 2
6 2 5
SOLUTION
Page | 85
Topic 4: Matrices and System of Linear Equations
a11 x1 + a12 x2 = b1
a21 x1 + a22 x2 = b2
Page | 86
Topic 4: Matrices and System of Linear Equations
Proof:
X = A−1B
AX = B ( let A is a 3 3 square matrix )
A−1 ( AX ) = A−1B ( multiply by A on both sides )
−1
( A A) X = A
−1 −1
B ( since A A = I )
−1
X = A−1B ( since IX = X )
EXAMPLE 4.21
SOLUTION
Page | 87
Topic 4: Matrices and System of Linear Equations
22 − 10 − 10
= − 11 + 10 + 0
− 22 + 10 + 15
2
= − 1
3
Therefore, x1 = 2 , x2 = −1 and x3 = 3
EXAMPLE 4.22
−10 4 9 2 3 4
MN = 15 −4 −14 4 3 1
−5 6
1 1 2 4
5 0 0
= 0 5 0 = 5I
0 0 5
Page | 88
Topic 4: Matrices and System of Linear Equations
M M
N = I similar N = I
5 5
4 9
−2 5 5
−1 M −4 −14
Therefore N = = 3
5 5 5
−1 1 6
5 5
x 750
N y = 1000
z 500
x 750
Multiply by N −1 : N −1 N y = N −1 1000
z 500
x 750
−1
I y = N 1000
z 500
4 9
−2 5 5 750
x
−4 −14
y = 3 5 5
1000
z 500
6
−1 1
5 5
200
= 50
50
Therefore, x = 200, y = 50, z = 50
Page | 89
Topic 4: Matrices and System of Linear Equations
Try this:
Ans:
i) x1 = -9 and x2 = 5 (ii) x1 = 2 , x2 = 0 and x3 = -4
This method involves reducing an augmented matrix to the identity matrix I, using
elementary row operation.
Example
augmented matrix A B I n X
EXAMPLE 4.23
Solve the following system of equations using the Gauss- Jordan Elimination method
x1 − 3 x2 + x3 = −12
x1 + x2 + x3 = 0
2 x1 − x2 + x3 = −8
SOLUTION
We first form the augmented matrix A B , and then begin applying the elementary
1 − 3 1 − 12
1
R2 R2* 0 1 0 3
4 0 5 − 1 16
Page | 90
Topic 4: Matrices and System of Linear Equations
1 0 1 − 3
3R2 + R1 → R1*
−5R2 + R3 → R3* 0 1 0 3
0 0 −1 1
1 0 1 − 3
0 1 0 3
(−1)R3 R3* 0 0 1 − 1
(−)R3 + R1 → R1* 1 0 0 − 2
0 1 0 3
0 0 1 − 1
So x1 = −2 , x2 = 3 and x3 = −1
Try this:
Solve the following system of equations using the Gauss-Jordan Elimination method
x1 + 2 x2 + 4 x3 = −10
(a) 2 x1 + 3x2 + 6 x3 = −15
x1 − x2 + x3 = −7
4 x1 + x3 = 5
(b) − 2 x1 + x2 = 4
− 2 x1 + x3 = 2
2 x1 − 4 x2 − 10 x3 = −12
(c) 2 x1 − 2 x2 − 2 x3 =2
− 3x1 + 4 x2 + 11x3 = 8
Answer:
(a). x1 = 0 , x2 = 3 and x3 = −4
1
(b) x1 = , x2 = 5 and x3 = 3
2
(c) x1 = 5 , x2 = 3 and x3 = 1
Page | 91