Makerere University: Instructor: Thomas Makumbi
Makerere University: Instructor: Thomas Makumbi
Makerere University: Instructor: Thomas Makumbi
SCHOOL OF ENGINEERING
1
LINEAR TRANSFORMATION AND MATRICES
Definitions
A matrix is a rectangular array of numbers (real or complex) enclosed in brackets (or
parenthesis) systematically arranged in rows and columns.
A matrix with m rows and n columns is called an m n matrix and each element in a matrix a jk
so denoted means i represents its row position and j its column position.
a11 a12 .... a1n
a a22 .... a2 n
A 21
.. .. .... ..
a .... amn
m1 am 2
If a matrix has only one row, it is called a row matrix or row vector;
a a1 a2 .... an
Similarly, a column matrix or column vector is a matrix with only one column;
b1
b2
b .
.
b
m
A square matrix is a matrix that has as many rows as columns. If it has n rows and n rows, it is
an n n matrix of order n. The diagonal containing the entries a11 , a22 ,......... ........., ann in a square
matrix A a jk is called the main diagonal or principal diagonal or leading diagonal of this
matrix.
a b
e.g. A is a square matrix of order 2, and a and d are on its main diagonal.
c d
Any matrix obtained by omitting some rows and columns from a given m n matrix A is called
a submatrix of A.
Equality of matrices
Two matrices A ail and B b jk are equal if and only if A and B have the same number of
rows and the same number of columns and the corresponding elements are equal.
Example
a a12 1 3
A 11 and B , A = B, if and only if;
a21 a22 8 1
a11 1, a12 3, a21 8 and a22 1
2
Addition of matrices
Addition is defined only for matrices with the same number of rows and the same number of
columns and is defined as follows;
The sum of two m n matrices, A ail and B b jk is written as A + B and is the m n matrix
obtained by adding the corresponding entries in A and B.
The entries in A + B are; ail b jk
Matrices with different numbers of rows or different number of columns cannot be added.
Example
4 6 6 5 1 0
A and B
0 1 2 3 1 0
1 5 3
A B
3 2 2
Properties of matrix addition
(a) A B B A
(b) U V W U V W
(c) A 0 A
(d) A A 0
Where A a jk is the m n matrix obtained by multiplying every entry in A by -1.
3
Therefore, for any m n matrices (with fixed m and n) and any scalars.
(a) c( A B ) cA cB
(b) (c k ) A cA kB
(c) ckA ck A
Matrix multiplication
Let A a jk be an m n matrix and B a jk an r p matrix. Then the product AB (in this
order) is defined only when r = n i.e.
Number of row in B = Number of columns in A
AB is then the m p matrix C c jk whose entry cjk is the dot product;
c jk j th rowvector of A . k th column vector of B i.e. the product of two matrices is determined
by multiplication of the rows of the first matrix and columns of the second matrix.
Example
4 2 3 12 10 22
1 8 5 3 40 43
Note
Multiplication of matrices is not commutative, e.g.
8 0
2 3 1 41 12
6 1 but;
0 4 5 7 9 59 49
8 0 16 24 8
2 3 1
6 1 12 22 11
7 9 0 4 5 14 57 52
Hence, even if both AB and BA are defined; AB BA , i.e. matrix multiplication is not
commutative.
Properties of matrix multiplication
(a) Matrix multiplication is associative and is distributive with respect to addition of matrices,
i.e.
kAB k AB AkB
ABC AB C
A BC AC BC
C A B CA CB , provided A, B and C are such that the expressions on the left are
defined. k is any constant.
4
(b) Matrix multiplication is not commutative, i.e. if A and B are matrices such that both AB and
BA are defined, then;
AB BA
(c) AB = 0, does not necessarily imply that A = 0 or B = 0.
Special matrices
1. Triangular matrices
A square matrix whose entries above the main diagonal are all zero is called a lower
triangular matrix.
1 0 0
e.g. T1 2 3 0
5 0 2
Similarly, an upper triangular matrix is a square matrix whose entries below the main
diagonal are all zero.
1 6 1
e.g. T2 0 2 3
0 0 4
2. Diagonal matrices
A square matrix A a jk whose entries above and below the main diagonal, are all e.g.
2 0 0 2 0 0
0 0 0 and 0 2 0
0 0 4 0 0 2
A diagonal matrix whose entries on the main diagonal are all equal is called a scalar matrix.
Thus a scalar matrix is of the form;
c 0 .... 0
0 c .... 0
S
. . .... .
o 0 .... c
Where c is any constant
3. Singular and non singular matrices
A matrix A a jk is said to be singular if it does not have an inverse. However, if an inverse
can be found for a given matrix A, then it is a non singular matrix. A matrix is singular if its
determinant is zero.
4. Unit matrix (Identity matrix)
The m n square matrix in which all the numbers on the leading diagonal are one and all
other entries are zero is called the n n unit matrix or identity matrix. E.g.
1 0 0
1 0
0 1 0 and are 3 3 and 2 2 identity matrices respectively.
0 0 1 0 1
5
Unit matrices of all orders are usually denoted by I.
For any m n matrix A, we have that; IA A , where I is an m m matrix.
Also AI A , where I is the n n unit matrix.
Transpose of a matrix
The transpose AT of an m n matrix A, is the n m matrix that has the columns of A as rows.
i.e.
a11 a12 .... a1n a11 a21 .... a m1
a21 a22 .... a2 n a12 a22 .... am 2
If A , then; AT
. . .... . . . .... .
a .... amn a a2 n .... amn
m1 am 2 1n
Example
5 4
5 8 1
If A , then A 8 0
T
4 0 0 1 0
Note:
(i) A real matrix A is said to be symmetric if it is equal to its transpose, AT e.g.
3 1 5
A 1 0 2 is symmetric.
5 2 4
(ii) A real matrix, A, is said to be skew – symmetric if; AT A for examples,
0 4 1
B 4 0 5 is skew symmetric since;
1 5 0
0 4 1 0 4 1
B 4 0
T
5 4 0 5 B
1 5 0 1 5 0
Question
Prove that A BT AT BT
Note: The transpose of a product equals the product of the transposed factors, taken in the
reverse order, i.e. AB T BT AT
6
Determinants
Consider systems of two linear equations;
a11 x1 a12 x 2 b1
.......... .......... .......... .......... .......... .......... .......... .......... ......(1)
a 21 x1 a 22 x 2 b2
With x1 and x2 unknown
Solving these two linear equations, gives;
b1 a 22 b2 a12
x1
a11a 22 a 21a12
.......... .......... .......... .......... .......... .......... .......... .......... .......( 2)
a11b2 a 21b1
x2
a11a 22 a 21a12
a11 a12
The expression in the denominators is written in the form; and is called a
a21 a22
determinant of second order, thus:
a11 a12
a11a 22 a 21a12 .......... .......... .......... .......... .......... .......... .......... ......( 3)
a 21 a 22
The four entries a11, a12, a21, and a22 are called the entries in the determinant or the elements
of the determinant.
Thus, now we can write;
D1 D
x1 and x2 2 .......... .......... .......... .......... .......... .......... .......... .......... .(4)
D D
Where;
a11 a12 b1 a12 a11 b1
D , D1 and D2
a 21 a 22 b2 a 22 a 21 b2
Formula (4) is called crammer’s rule.
Note
D1 is obtained by replacing the first column of D, containing the coefficients on x1 by
the column with entries b1 and b2.
Similarly is obtained by replacing the second column in D, containing the coefficients
on x2 by the column with entries b1 and b2.
If both b1 and b2 are zero, the system is said to be homogeneous. In this case the
system has at least the “trivial solution” x1 = 0 or x2 = 0.
7
Example
Solve the following set of equations using Crammer’s rule;
2 x 3 y 14 0
3x 2 y 5 0
2 3
D 4 9 13
3 2
14 3
D1 14 * (2) (5) * 3 13
5 2
2 14
D2 10 42 52
3 5
D1 13 52
Therefore, x 1 and y 4
D 13 13
Determinants of third order
Minors of a determinant
Each of the nine positions for an element in a 3 3 determinant can best be described by stating
the row and column to which the element belongs. Corresponding to each position, there is a
2 2 determinant, namely, the determinant obtained by when the entire row and entire column
defining that position are both deleted.
The nine such 2 2 determinants are called the minors of D.
a11 a12 a13
E.g. consider, a21 a22 a23
a a33
31 a32
a 22 a 23
The minor of a11 is
a 32 a 33
a11 a13
The minor of a22 is and,
a31 a33
a 21 a 22
The minor of a33 is
a31 a32
8
Cofactors of a 3 3 matrix
The cofactor of the entry in the ith row and the kth column of D is defined as 1
i k
times the
a11 a12 a13
minor of that entry. E.g. considering a21 a22 a23 , then;
a a33
31 a32
The signs 1 form a checkerboard pattern;
i k
Evaluation of a 3 3 determinant
The determinant of a 3 3 matrix can be evaluated as the sum of the products of elements or
entries in the top row and their respective cofactors.
Examples
3 2 5
6 7 4 7 4 6
1. 4 6 7 3 2 5
9 2 2 2 2 9
2 9 2
312 63 28 14 536 12 21
1 1 2
1 1 2 1 2 1
2. 2 1 1 1. 1. 2
2 1 1 1 1 2
1 2 1
1(1 2) 1(2 1) 2(4 1) 4
Note
We can, if we wish expand along any row or column in the same way, multiplying each element
by its minor and assign to each product the appropriate + or – sign.
9
Example
2 7 5
Evaluate, 4 6 3
8 9 1
We can evaluate this by expanding down the middle column, remembering that the “place signs”
for the 3rd determinant are;
2 7 5
4 3 2 5 2 5
Therefore, 4 6 3 7 6 9 7(4 24) 6(2 40) 9(6 20) 38
8 1 8 1 4 3
8 9 1
But we can also decide to expand along the middle row as;
2 7 5
7 5 2 5 2 7
4 6 3 4 6 3 4(7 45) 6(2 40) 3(18 56) 38
9 1 8 9 8 7
8 9 1
a11 b1 a13
Dx2 D2 , where; D2 a 21 b2 a 23 and;
a31 b3 a33
10
a11 a12 b1
Dx3 D3 , where; D3 a 21 a 23 b2
a31 a32 b3
2 2 2
D2 1 5 3 2(5 9) 2(1 3) 2(3) 0
1 3 1
2 1 2
D3 1 10 5 2(30 5) (1)(3 5) 2(1 10) 46
1 1 3
Therefore;
92 0 46
x 2, y 0 and z 1
46 46 46
11
Questions
Solve the following set of equations using Crammer’s rule:
2x 3 y z 4 0
(i) 3 x y 2 z 13 0 Ans : x 2, y 1 and z 3
x 2 y 5 z 11 0
4 x 5 y 7 z 14
(ii) 9 x 2 y 3 z 47 Ans : x 3, y 2 and z 1
x y 5 z 11
4 x 3 y 2 z 7
(iii) 6 x 2 y 3z 33 Ans : x 2.5, y 3, z 4
2 x 4 y z 3
12
Consistency of a set of equations
Equations are said to be consistent if they have a common solution, otherwise they are non –
constant.
e.g. consider the set of equations;
3x y 4 0.......... .......... .......... .......... ...( a)
2 x 3 y 8 0.......... .......... .......... .......... ..(b)
x 2 y 3 0.......... .......... .......... .......... ....( c)
Solving (b) and (c) gives; x = 1 and y = 2. But on substituting x = 1 and y = 2 into (a); gives;
3(1) 2 4 3 , and not 0 as the equation states. Thus the three equations are non – consistent.
But if;
3x y 5 0.......... .......... .......... .......... (a)
2 x 3 y 8 0.......... .......... .......... ........( b)
x 3 y 3 0.......... .......... .......... .......... .(c)
The solution of (b) and (c) gives; x = 1 and y = 2 as before. Substituting these in (a) gives;
3 x y 5 3 2 5 0 . Hence the three equations are consistent.
Taking the general case;
a1 x b1 y d1 0.......... .......... .......... .......... ...( a )
a2 x b2 y d 2 0.......... .......... .......... .......... ...( b)
a3 x b3 y d 3 0.......... .......... .......... .......... ....( c)
Solving for (b) and (c), gives;
x y 1
D1 D2 D0
b2 d2 a2 d2 a2 b2
Where, D1 , D2 and D0
b3 d3 a3 d3 a3 b3
If these results satisfy equation (a), then;
D1 D
a b1 2 d1 0
D0 D0
Therefore, a1 D1 b1 D2 d1 D0 0
b2 d2 a2 d2 a2 b2
a1 b1 d1 0
b3 d3 a3 d3 a3 b3
13
a1 b1 d1
a2 b2 d2 0
a3 b3 d3
Which is therefore, the condition that the three equations are consistent. So three simultaneous
equations in two unknowns are consistent if the determinant of the coefficients is zero.
Examples
1. Test for consistency:
2x y 5 0
x 4 y 1 0
3x y 10 0
Solution
2 1 5
For consistency; 1 4 1 0
3 1 10
2 1 5
4 1 1 1 1 4
1 4 1 2 5 0 ; hence, the equations are consistent.
1 10 3 10 3 1
3 1 10
2. Given;
x (k 1) y 1 0
2kx 5 y 3 0
3x 7 y 1 0
Find the values of k for which the equations are consistent.
Solutions
1 k 1 1
2k 5 3 0
3 7 1
5 3 2k 3 2k 5
(k 1) 0
7 1 3 1 3 7
2k 2 3k 2 0 2k 1k 2 0
1
Hence, k or k 2
2
14
Question
Find the values of β for which the following equations are consistent;
5 x 1 y 5
1x 7 y 5 Ans : 4 or 14
3 x 5 y 1
Adjoint of a matrix
The adjoint of a matrix A is the transpose of its matrix of cofactors. It is denoted by adjA i.e.
adjA C T
Inverse of a matrix
1 1
The inverse of a square matrix A, is given by; A1 .adjA C T , provided A 0
A A
Note
1 0 0
1
1
A. A I A A 0 1 0 , i.e the product of a matrix and its inverse is equal to an identity
0 0 1
matrix.
Example
13 3 2
Given A 3 5 6 , find A 1 , hence show that A1 A I .
1 3 14
13 3 2
D 3 5 6 13(70 18) 3(42 6) 2(9 5) 576
1 3 14
Matrix of cofactors;
5 6 3 6 3 5
3 14 1 14 1 3
52 36 4 13 9 1
3 2 13 2 13 3
C 36 180 36 4 9 45 9
3 14 1 14 1 3
8 72 56 2 18 14
3 2 13 2 13 3
5 6 3 6 3 5
15
13 9 2
C 4 9 45 18
T
1 9 14
Thus the inverse matrix is;
13 9 2 13 9 2
4 1
9 45 18 9 45 18
576 144 1 9 14
1 9 14
Determinant of a product of matrices
For any n n matrices, A and B;
det( AB ) det(BA) det A. det B
Solution of systems of linear equations
There are two basic equations that can be applied;
1. Crammer’s rule; already looked at.
2. Guass elimination method
Guass elimination
A system of m linear equations in n unknowns, x1, x2, ………………xm is a set of equations of
the form;
a11 x1 .......... .......... .......... . a1n x n b1
a 21 x1 .......... .......... .......... . a 2 n x n b2
.......... .......... .......... .......... .......... .......... .......... .....(1)
... .... ..... ...... ....... ..... .... ..
a m1 x1 .......... .......... .......... . a mn x n bm
The a jk are given constants called the coefficients of the system. The bi are also given constants.
If the bi are all zero, then (1) is called a homogeneous system. If at least one bi is not zero, then
(1) is called a non – homogeneous system.
A solution of (1) is a set of values; x1 , x2 ,......... ........., xn which satisfy all the m equations. A
vector solution of (1) is a column vector whose entries are the values of x 1, x2,…..,xn
corresponding to the solution of the system. If the system (1) is homogenous, it has at least the
trivial solution, x1 x2 .......... .......... xn 0
From the definition of matrix multiplication, the m equations of (1) may be written as a single
vector equation; Ax b.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... (2)
Where the coefficient matrix, A a jk is the m n matrix
16
x1 b1
a11 a12 .... a1n
x2 b2
a a22 .... a2 n
A 21 , x . and b .
. . .... .
. .
a
m1 am 2 .... amn x b
n m
We can augment A by column b, as;
a11 ... a1n b1
. ... . .
A . This is the augmented matrix of the system (1)
. ... . .
a bm
m1 ... amn
Each row in the augmented matrix contains the coefficients to represent the coefficients
corresponding to one equation in the system. The linear system can be solved by performing row
operations on the augmented matrix as follows:
1. Use a11 as the pivot entry and use it to eliminate all other entries from the first column.
2. Continue this process of reduction until your main matrix is reduced to a triangular form also
referred to as the echelon form.
3. Use back substitution to solve for x1, x2,………,xn.
Note
The pivot entry must never be zero. If such a situation occurs, rows and columns should be
interchanged to get a non – zero pivot entry.
Example
Use Guass elimination to solve this system;
3 y 2z 9
2 x 2 y 4 z 1
4 x y 3z 4.5
Solution
This can be written in matrix form as;
0 3 2 x 9
2 2 4 y 1
4 1 4 z 4.5
Since the pivot entry is 0, interchange the rows;
2 2 4 x 1
0 3 2 y 9
4 1 3 z 4.5
17
The augmented matrix is;
2 2 4 1
0 3 2 9
4 1 3 4 .5
2R1 + R3
2 2 4 1
0 3 2 9
0 5 5 2.5
2 2 4 1
5R2 – 3R3; 0 3 2 9
0 0 25 37.5
2 2 4 x 1
Therefore; 0 3 2 y 9
0 0 2.5 z 37.5
By back substitution;
25z 37.5 z 1.5
3 y 2 z 9 y 2 and;
1
2 x 2 y 4 z 1 x
2
The system (1) is called over determined if it has more equations than unknowns, determined if
m = n and underdetermined if (1) has fewer equations than unknowns.
Note
The method of Guass elimination can also be applied to a system of more than three unknowns.
Questions
Solve the following set of equations using Guass elimination:
3x1 2 x 2 x3 1
(i) x1 x 2 3x3 5 Ans : x1 2, x 2 2, x3 3
2 x1 5 x 2 2 x3 0
2b c 1
(ii) a b c 5 Ans : a 1, b 1, c 3
2a b 3c 10
18
Rank of a matrix
The maximum number of linear independent row vectors of a matrix A is the rank of A and is
denoted, rankA
Example
3 0 2 2
If, A 6 42 24 54 , has a rank = 2 since the last row is a linear combination of the
21 21 0 15
R2
two others, which are linearly independent i.e. R3 6 R1
2
The rank of a general m n matrix is equal to the size of the largest square sub – matrix of A
whose determinant is non zero.
The following are important features associated with the rank of a matrix:
The only matrices which have zero rank are those with all their elements equal to zero.
If the matrix is an n n matrix and non – singular then rank = n
If A is an m n matrix, then the rank cannot exceed the smaller of m and n e.g. given a
3 2 matrix, the rank cannot exceed 2.
Calculation of rank
The simple way of calculating the rank of a matrix is by using tow operations;
1 1
E.g.
2 2
Det = 2 – 2 = 0; therefore, rank = 1
1 1 0 2
2. If A 2 0 2 2 , all 3 3 give det = 0 and all 2 2 give . Therefore, rank = 2
4 1 3 1
Eigen values and Eigen vectors
From the statement of Engineering applications, Eigen value problems are the most important
problems in connection with matrices.
Suppose a linear operator, A, transform vectors x into other vectors Ax, the possibility then
arises that there will exist vectors x each of which is transformed by A simply into a multiple
itself. Such a vector, x, must therefore satisfy; Ax x .
For non – zero solutions of this system, the values of λ are called Eigen values, characteristic
values or latent roots of a matrix A. The corresponding solutions of, x, are called the Eigen
vectors or characteristic vectors of A.
In general, the operator A has n independent Eigen vectors denoted xi with Eigen values λi.
19
The set of equations;
a11 a12 .... a1n x1 x1
a21 a22 .... a2 n x2 x2
. . .... . . .
. . .... . . .
a x
n1 an1 .... ann xn n
This implies;
a11 a12 ... a1n x1 0
a21 a22 ... a2 n x2 0
. . ... . . .
. . ... . . .
a ann xn 0
n1 an 2 ...
20
2 3 1 0 x1 2 3 2 0 x1 0
2 0
4 1 0 1 x 2 4 1 0 2 x 2 0
4 3 x1 0
4 3 x2 0
Therefore, 4 x1 3x2 0
This relationship does not give specific values of x1 and x2
4
x2 x1
3
1
4
When, x1 = 1, x2 , so x1 is of the form; 4
3
3
3
Hence, x1 , where α is a constant multiplier. The simplest result, with α = 1, is normally
4
quoted.
3
for 1, x1
4
Similarly for λ2 = 5,
2 3 1 0 x1 3 3 x1 0
5 0
4 1 0 1 x 2 4 4 x 2 0
3x1 3x2 0 x2 x1
1
The corresponding Eigen vector is,
1
1
Taking β =1, then for λ2 = 5, x2
1
The required Eigen vectors are:
3
x1 for 1 2
4
1
x2 for 2 5
1
21
2 2 3
2. Find the Eigen values and Eigen vectors of the matrix; A 2 1 6
1 2 0
From, A I 0
2 2 3
2 1 6 0
1 2
1 6 6 2 1
2 2 3 0
2 1 1 2
2 2 12 2 2 6 3 4 1 0
3 2 21 45 0
The roots of A are:
1 5, 2 3 and 3 3
For λ1 = 5;
2 2 3 1 0 0 x1 0 7 2 3 x1 0
2 1 6 5 0 1 0 x 2 0 2 4 6 x 2 0
1 2 0 0 0 1 x 0 1 2 5 x 0
3 3
Using Guassian elimination;
The augmented matrix form is;
7 2 3 . 0
2 4 6 . 0
1 2 5 0
.
R2 +2R3 and 2R1 + 7R2, gives;
7 2 3 0
0 24 48 0
0 8 16 0
8 x 2 16x3 0 x 2 2 x3 and, 7 x1 2(2 x3 ) 3x3 x1 x3
Therefore, x1, x2, and x3 are in the ratio; 1 : 2 : 1
1
Therefore, x1 2
1
22
2
Similarly for λ = -3; x2 1
0
Questions
Find the Eigen values and t he corresponding Eigen vectors of the following matrices.
2 7 0 7 1 1
(i) A 1 3 1 Ans : 1,3,9 and x 1 , 1 , 1
5 0 8 5 7 5
5 6 1 0 1 3
(ii) A 1 1 0 Ans : 1,2,4 x 1 , 1 , 1
3 0 1 6 3 3
END
23