Engineering Mathematics III
Engineering Mathematics III
Engineering Mathematics III
a. Introduction to matrices
Matrices are used as a shorthand for keeping essential data arranged in rows and columns i.e
matrices are used to summarize data in tabular form.
Definition: A matrix is an ordered rectangular array of numbers, usually enclosed in
parenthesis or square brackets. Capital (Upper – case) letters are used to denote matrices.
Order of a Matrix
The size of a Matrix is specified by the number of rows (horizontal) and the number of columns
(vertical).
A general matrix of order m n is
a11 a12 a1n
a
A = 21
a 22 a 22 = a ij
i → ith row
a n1 a n 2 a mn j → jth column
A Square Matrix is a one with the same number of rows as columns i.e. 𝑚 𝑚 matrix. Two
matrices are of the same size if they have the same order. The diagonal that runs from top left
to bottom right is called the leading (main) diagonal. The matrix whose only non-zero entries
are on the leading diagonal is called diagonal matrix. A vector is a matrix with one row (1 𝑛)
or one column (𝑛 1). A row vector is of the form 1 n, and a column vector is of the form
m 1. A zero matrix of order 𝑚 𝑛 is the matrix with a ij = 0 i = 1, m, j = 1 n .
Similarly we talk of zero rows and column vector.
0
0
0 = (0,0, 0 ) or 0
Equal Matrices: Two matrices A & B are said to be equal if they have the same order (size)
𝑚 𝑛 and aij = bij i & j
a11 a12 a1n
a a 22 a 22
A = 21
a n1
an2 a mn
A square matrix is said to be triangular if 𝑎𝑖𝑗 = 0 ∀ 𝑖 > 𝑗 or ∀ 𝑖 <
𝑗.
Examples
1 2 3
1 0
(0 4 5) is a 3 3 upper triangular matrix while ( ) is a 2 2 lower triangular matrix.
3 4
0 0 7
Matrix Multiplication:
Let A = aik be an m n matrix, and B = bkj an n s matrix. The matrix product AB is
the m s matrix C = cij where c ij the dot product of the ith row of A and the jth column of
B.
n
AB = C , aik bkj = cij ; C ij = Ai B j = a ik bkj
k =1
Remark:
1.Let A ( m n ) , B ( s r ) be two matrices.
C = AB exists iff n = s & C is m n
C = BA exists iff r = m & C is s n
2. It’s possible for AB to be defined while BA is not defined. i.e. matrix multiplication is not
commutative.
Examples
1 − 2 3 3 0 2
1. Let A = and B = . Then
4 5 − 6 − 7 1 8
1 + 3 − 2 + 0 3 + 2 4 − 2 5
A + B = =
4 − 7 5 + 1 − 6 + 8 − 3 6 2
3 1 3 (− 2) 33 3 −6 9
2. 3A = =
3 4 35 3 (− 6 ) 12 15 − 18
2 − 4 6 −9 0 − 6 − 7 − 4 0
3. 2 A − 3B = + =
8 10 − 12 21 − 3 − 24 29 7 − 36
1 2 1 1 1 1 + 2 0 1 1 + 2 2 1 5
4. = =
3 4 0 2 3 1 + 4 0 3 1 + 4 2 3 11
1 1 1 2 11 + 1 3 1 2 + 1 4 4 6
= =
0 2 3 4 0 1 + 2 3 0 2 + 2 4 6 8
The above example shows that matrix multiplication is not commutative, i.e. the products
AB and BA of matrices need not be equal.
Exercise
1 3 2 0 − 4
1. Let A = and B = . Find (a) AB , (b) BA
2 − 1 3 − 2 6
1 − 2 0
2. Given A = (2,−1) and B = , find (a) AB , (b) BA
4 5 − 3
2 − 1
1 − 2 − 5
3. Given A = 1 0 and B = , find (a) AB , (b) BA
−3 4 3 4 0
c. Transpose of a matrix
The transpose of the matrix A is matrix B = AT , such that bij = a ji i.e. the rows
become columns and vice versa.
5. If
( )
A is n n and f ( x ) any polynomial, then f AT = f ( A)
T
Exercise
1 0 1 0
1. Find the transpose A of the matrix A = 2 3 4 5
t
4 4 4 4
1 2 0
2. Let A = . Find (a) AA , (b) A A
t t
3 −1 4
d. Identity matrix
A square diagonal matrix whose main diagonal entries are all 1s is called an identity matrix
denoted by 𝐼𝑛 where 𝑛 stands for the order i.e. 𝑛 × 𝑛 . 𝐼𝑛 is said to be an identity matrix if
𝐼𝑛 × 𝐴 = 𝐴 × 𝐼𝑛 = 𝐴, ∀ matrix 𝐴
Example
1 0 1 2 1 2 1 2 1 2
( )( )=( )( )=( )
0 1 3 4 3 4 3 4 3 4
1 0 0
1 0
Therefore, ( ) is an 𝐼2 identity matrix. Similarly, (0 1 0) is an 𝐼3 identity matrix
0 1
0 0 1
Let A be a square matrix. Another matrix B of the same order as A is called an inverse of A if
𝐴𝐵 × 𝐵𝐴 = 𝐼𝑛
Example
2 3 2 −3 1 0 2 −3 2 3
( )( )=( )=( )( )
1 2 −1 2 0 1 −1 2 1 2
2 3 2 −3
Therefore, ( ) and ( ) are inverses of each other.
1 2 −1 2
g. Determinant of a matrix
a a12 a a12
Let A = 11 . Det A = 11 = a11 a22 − a12 a21 . The determinant is a scalar.
a 21 a 22 a21 a22
Examples:
1. Find the value of such that = 0.
3 −2
1+ x 1
2. Let = find x.
2 + 2x 2
x 3
3. Let = 4 . Find x.
2 2x + 1
a11 a12 a13
Let A = a 21 a 22 a 23
a 31 a 32 a 33
Note: This is a sum of 6 products, 3 positive and 3 negative. Each product has exactly one
factor from each row and column.
3 1 2
1. Evaluate − 1 − 1 4
− 2 −1 1
3 1 2
Solution: − 1 − 1 4 = 3[( −1)1 + 1( 4 )] − 1[−1(1) + 8] + 2[1 − 2] = 0
− 2 −1 1
1 3 1
2. Evaluate 2 1 2
1 −1 2
1 3 1
1 2 2 2 2 1
Solution: 2 1 2 =1 −3 +1 = 1(4 ) − 3(2 ) + 1(− 3) = − 5
−1 2 1 2 1 −1
1 −1 2
4.2.1 Properties of determinants
1. Det (AB) = Det A . Det B
7. Adding a scalar multiple of a row or a column to another row or column respectively leaves
Inverse of a 2 X 2 matrix
a b 1 d − c
Let A = det A = ad − bc 0 ; A −1 =
c d ad − bc − c a
Note:
1 a b d − b 1 ad − bc − ab + ab 1 0
A A −1 = = = ad − bc 0
ad − bc c d − c a ad − bc cd − cd sd − bc 0 1
1
A −1 = adj ( A )
det ( A)
a b a11 a12
For a 2 x 2 matrix A = =
c d a21 a22
T
a11 ' a12 d − c d − b d − b
T
1
Adj(A) = = ; A −1 =
ad − bc − c a
=
a 21 ' a 22 ' − b d − c a
Inverse of a 3 X 3 matrix
T T
a11 a12 a13 a11 ' a12 ' a13 ' A11 − A12 A13
Let A = a 21 a 22 a 23 ; Adj (A) = a ' a ' a ' = − A A22
− A23
21 22 23 21
4 0 1
Examples: Find the inverse of A = 2 2 0
3 1 1
Solution:
2 0 2 0 2 2
Det A = 4 −0 +1 = 4(2 ) − 0 + 1 (2 − 6 ) = 8 − 4 = 4 ; Therefore, A −1 exists.
1 1 3 1 3 1
T
A11 − A12 A13
adj ( A) = − A21 A22 − A23 2 0 2 2
A31 A11 = =2 A13 = = −4
− A32 A33 1 1 2 0 3 1
;
; A12 = = 2; ;
3 1
0 1 4 1 4 0 0 1
A21 = = −1 ; A22 = = 1 ; A23 = = 4 ; A31 = =−2
1 1 3 1 3 1 2 0
2 − 2 − 4 1 − 2
T
2
A32 =
4 1
= −2 A33 =
4 0
= 8 = 8 adj ( A) = 1
1 − 4 = − 2 1 2 ;
2 0 2 2
− 2 2 8 − 4 − 4 8
12 1
4 − 12
A −1 = − 12 14 1
2
− 1 − 1 2
Exercise
−1
1. Find A if
2 3 − 4
A = 0 − 4 2
1 −1 5
Note:
For a matrix in echelon form, for subsequent rows, the non-zero entries occur in later and later
columns.
For a matrix in echelon form, all entries below the main diagonal are zero. Given any matrix
B (not in echelon form) we perform the following elementary row operations to change it to
echelon form:
1. Change the order of the rows (interchange some rows)
2. Multiply one row by a nonzero constant.
3. Add a multiple of one row to a nonzero multiple of another row.
Example
1 − 2 1
1. Reduce the matrix 2 1 − 1 to echelon form
7 − 4 1
The inverse of a matrix a can be found using row reduction to echelon form of the augmented
(
matrix (A/I) to get I / A −1 . )
Example:
4 0 1
Find the inverse of A = 2 2 0
3 1 1
Solution:
4
0 1 1 0 0 4 0 1 1 0 0
2 0 0 1 0 2 R2 − R1
2 → 0 4 −1 −1 2 0
3
1 1 0 0 1 4 R3 − 3R1 0 4 1 −3 0 4 R3 − R2
40 1 1 0 0 2 R1 − R3 8 0 0 4 2 −4 R1 8
04 −1 −1 2 0 2 R2 + R3 → 0 8 0 −4 2 4 R 2 8
0
0 2 −2 −2 4 0 0 2 −2 −2 4 R 3 2
1 0 0 12 1
4 − 12 12 1
4
− 12
→ 0 1 0 − 1 2 1 4 1 2 ; Inverse − 12 14 1
2
0 0 1 −1 −1 2 − 1 − 1 2
Examples
3 4 − 1 1
1. Reduce 1 − 1 3 1 to reduced row-echelon (canonical) form.
4 − 3 11 2
3 4 − 1 1 1 − 1 3 1
Solution: 1 − 1 3 1 R1 R2 3 4 − 1 1 R − 3R
2 1
i) Elimination Method:
The strategy is to eliminate one variable at a time:
Example:
Solve by elimination method
x1 + x2 + x3 = 5 (1)
x1 + 2 x 2 + 3x3 = 10 (2)
2 x1 + x 2 + x3 = 0 (3)
Solution:
Eliminate x1
(2) – (1) x 2 + 2 x3 = 5 (4)
(3)-2(1) - x2 − x3 = −4 (5)
Eliminate x2
(4) +(5) 3
x =1
Substitute in equation 5
− x − 1 = −4 , x2 = 3
2
Substitute in equation 1
x1 + 3 + 1 = 5, x1 = 1
The elimination method is very tedious when there are many variables. We use a much
organized elimination method in matrix form called Gauss-Jordan method.
Example:
Solve using Gauss-Jordan method
2 x1 − 4 x 2 + 6 x3 = 20
3x1 − 6 x2 + x 3 = 22
− 2 x1 + 5x 2 − 2 x3 = − 18
Solution:
Matrix form
2 −4 6 x1 20
3 −6 1 x 22
2
− 2 5 − 2 x 3 − 18
=
Augmented matrix
2 − 4 6 20
3 − 6 1 22
− 2 5 − 2 − 18
1
Divide row 1 by 2 i.e. 2
R1 and use it to reduce a 21 and a31 to zeros
1 −2 3 10
3 −6 1 22 R2 − 3R1
−2 5 −2 −18 R3 + 2 R1
1 −2 3 10
0 0 −8 −8
0 1 4 2
R2 R3
1 −2 3 10
0 1 4 2 R1 + 2 R2
0 0 −8 −8
1 0 11 14 8R1 + 11R3 8 0 0 24 R1 / 8
0 1 4 2 2 R2 + R3 0 2 0 −4 R2 / 2
0 0 −8 −8 0 0 −8 −8 R3 / − 8
1 0 0 3
x1 = 3, x2 = −2, x3 = 1
0 1 0 − 2 Solution
0 0 1 1
Exercise
2. x1 + x 2 + x3 + x 4 = 4
x1 + 2 x 2 − x3 − x 4 = 7
2 x1 − x 2 − x3 − x 4 = 8
x1 − x2 + 2 x3 − 2 x4 = −7
3. x1 + x2 + 2 x3 + x4 = 3
x1 + 2 x2 + x3 + x4 = 2
x1 + x2 + x3 + 2 x4 = 1
2 x1 + x2 + x3 + x4 = 4
4. X1 − X 2 + 2X 3 = 2
2 X 1 + 3 X 2 − X 3 = 14
3 X 1 + 2 X 2 + X 3 = 16
X 1 + 4 X 2 − 3 X 3 = 12
This method uses determinants to solve a linear system Ax = b provided det A (coefficient
matrix) is nonzero.
1
Suppose det A 0 , A square matrix x = A −1b, A −1 = adj ( A)
det A
T
A11 − A21 a11 a21 an1
1 − A12 A22 1
; Let a ij = (− 1)
i+ j
−1
A = Aij ; A−1 = a12 a22 an 2
det A det A
a1n a2 n ann
x1 b1
x b
2 2
a11 a 21 a n1
xn = 1 a12 a 22 an2 bn
det A
a1n a 2n a nn
1
xj = b1 a1 j + b2 a2 j + + bn anj
det A
For 3 3 matrix Ax = b
a11 a12 a13 x1 b1
a a 22 a 23 x 2 = b2
21
a 31 a 32 a 33 x 3 b3
Example
Solve the linear system using Crammer’s rule
− 2 x1 + 3x2 − x3 = 1
x1 + 2 x2 − x3 = 4
− 2 x1 − x2 + x3 = −3
Solution
1 3 −1
4 2 −1
− 3 −1 1 −4
− 2 3 −1 x1 = = =2
A −2
A= 1 2 − 1 = −2 .Then ,
− 2 −1 1
− 2 1 −1
1 4 −1
−2 −3 1 −6
x2 = = =3
A −2
,
−2 3 1
1 2 4
− 2 −1 − 3 −8
x3 = = =4
A −2
And
x1 − 2 −1
7
4 2 3 3
x = 1 − 3 8 = 2 ; x = −3
2 x1 = 3, x2 = 2 , 3
1
2 4
x 3 0 1 −1 10 − 3
4 2
Exercise
x1 + 3x2 + 2 x3 = 3
2. 2 x1 + 4 x2 + 2 x3 = 8
x1 + 2 x2 − x3 = 10