Matrices and vectors
Matrices and vectors
Matrices
Square Matrix
If the number of rows equals to the number of columns (𝑚 = 𝑛), then the
matrix is called square matrix of order 𝑛. For example,
where the elements 𝑎11 , 𝑎22 and 𝑎33 form the principal (main) diagonal of the
square matrix 𝐴.
1
Row or Column Matrix
If the matrix contains one row or one column only, then it is called a vector.
a11
a
A1 n = a11 a12 a1n or An1 = 21 .
an1
Matrix Operations
1. Equality of Matrices
Two matrices 𝐴 and 𝐵 are equal if they have the same order 𝑚𝑛 and if
Example 1
𝑥−1 3 9 3
Find 𝑥 and 𝑦 if [ ]=[ ].
−4 2𝑦 −4 6
Solution
𝑥 − 1 = 9 and 2𝑦 = 6
∴ 𝑥 = 10 and 𝑦=3
2
Example 2
1 0 2 2 1 1
Find 𝐴 + 𝐵 and 𝐴 − 𝐵 if A = and B= .
3 2 1 2 0 3
Solution
1 0 2 2 1 1 3 1 3 − 1 − 1 1
A+ B = +
=
and A − B = 1 2 − 2
3 2 1 2 0 3 5 2 4
Example 3
Find 4𝐴 and 3𝐴 + 2𝐵 if
1 0 2 2 1 1
A= and B= .
3 2 1 2 0 3
Solution
3
4 0 8
4A =
12 8 4
3 0 6 4 2 2 7 2 8
and 3 A + 2 B = + = .
9 6 3 4 0 6 13 6 9
4. Transpose of Matrix
T
a11 a12 a1n a11 a21 am1
a2 n a am 2
T a21 a22 = 12
a22
.
A =
am1 am2 amn a1n a2 n amn
Example 4
1 0 2 2 1 1
Find 𝐴𝑇 and (𝐴 − 𝐵)𝑇 if A = and B= .
3 2 1 2 0 3
Solution
T 1 3
= 0 2
1 0 2
AT =
3 2 1
2 1
T − 1 1
− −
= − 1 2 .
1 1 1
and ( A − B )T =
1 2 − 2
1 − 2
4
5. Matrix Multiplication
Note that: The main condition of matrix multiplication is that the number of
columns of the 1st matrix must equal to the number of rows of the 2nd one.
5
Example 5
3
Find 𝐴𝐵 if A = 2 − 5 4 and B = 1 .
− 2
Solution
3
AB = 2 − 5 4 1 = row 1 column 1
− 2
= 2 3 + (− 5) 1 + 4 (− 2) = − 7 .
Example 6
2 − 5 4 3
Find 𝐴𝐵 if A = 1 2 3 and B = 1 .
0 2 0 − 2
Solution
2 − 5 4 3 row 1 column 1
AB = 1 2 3 1 = row 2 column 1
0 2 0 − 2 row 3 column 1
2 3 + (−5) 1 + 4 (− 2) − 7
= 1 3 + 2 1 + 3 (− 2) = − 1 .
0 3 + 2 1 + 0 (− 2) 2
Example 7
2 3 3 − 1 0
Find 𝐴𝐵 and 𝐵𝑇 𝐴𝑇 if A = and B = 2 4 5 .
1 0
Solution
2 3 3 − 1 0 12 10 15
AB = 2 4 5 = 3 − 1 0
1 0
6
3 2 12 3
BT AT = − 1 4 = 10 − 1 = ( AB )T
2 1
3 0
0 5 15 0
Example 8
1 2 2 1
Find 𝐴𝐵 and 𝐵𝐴 if A = and B = 0 1 .
− 1 3
Solution
1 2 2 1 2 3 2 1 1 2 1 7
AB = 0 1 = − 2 2 and BA = − 1 3 = − 1 3 .
− 1 3 0 1
Example 9
1 2 2 1 − 2 7
Find 𝐴𝐵 and 𝐴𝐶 if A = , B = 3 2 and C = 5 − 1 .
2 4
Solution
8 5
AB = AC = and B C .
16 10
7
6. Matrix Power
Example 10
1 3 1 2
Find 𝐴2 and 𝐵3 if 𝐴 = [ ] and 𝐵 = [ ].
1 4 −1 3
Solution
1 3 1 3 4 15
𝐴2 = 𝐴. 𝐴 = [ ][ ]=[ ]
1 4 1 4 5 19
1 2 1 2 −1 8
𝐵2 = 𝐵. 𝐵 = [ ][ ]=[ ]
−1 3 −1 3 −4 7
−1 8 1 2 −9 22
∴ 𝐵3 = 𝐵2 . 𝐵 = [ ][ ]=[ ]
−4 7 −1 3 −11 13
Note that: If the matrix is not square, it can’t be multiplied by itself. Therefore,
it can’t be raised to any power.
8
7. Determinant of Matrix
The minor of the element in the 𝑖 𝑡ℎ row and 𝑗𝑡ℎ column is the determinant
of the submatrix formed by deleting the 𝑖 𝑡ℎ row and 𝑗𝑡ℎ column. This number
is often denoted 𝑀𝑖,𝑗 . The (𝑖, 𝑗) cofactor is obtained by multiplying the minor
by (−1)𝑖+𝑗 .
9
To illustrate the preceding definitions, consider the following 3 × 3 matrix
1 4 7
[ 3 0 5 ]
−1 9 11
To compute the minor 𝑀2,3 and the cofactor 𝐶2,3 , we find the determinant of
the above matrix with row 2 and column 3 removed.
1 4 ∎
1 4
𝑀2,3 = det [ ∎ ∎ ∎ ] = | | = 1 × 9 − 4 × (−1) = 13.
−1 9
−1 9 ∎
Example 11
10
b) Determinant of fourth order (using the elements of the third column)
2 1 −3 2
0 4 1 2 1 2
0 4 2 1
= (− 3) − 1 5 3 − (2) − 1 5 3
−1 5 0 3
1 2 4 1 2 4
1 2 0 4
Properties of Determinants
𝑎 𝑏 𝑎 𝑐
| |=| | = 𝑎𝑑 − 𝑏𝑐.
𝑐 𝑑 𝑏 𝑑
𝑎 𝑏 𝑐 𝑑
| | = −| |.
𝑐 𝑑 𝑎 𝑏
3 If any two rows (or columns) of the matrix 𝐴 are identical, then |𝐴| = 0. For
example,
𝑎 𝑏
| | = 0.
𝑎 𝑏
Also, if the matrix 𝐴 has a zero row (or column), then |𝐴| = 0. For example,
𝑎 𝑏
| | = 0.
0 0
11
For example,
𝑘𝑎 𝑘𝑏 𝑎 𝑏 𝑘𝑎 𝑏
| | = 𝑘| |=| | = 𝑘𝑎𝑑 − 𝑘𝑏𝑐 = 𝑘(𝑎𝑑 − 𝑏𝑐).
𝑐 𝑑 𝑐 𝑑 𝑘𝑐 𝑑
|𝜶 𝑨| = 𝜶𝒏 |𝑨|
5 If 𝐴 and 𝐵 are square matrices, then |𝐴 𝐵| = |𝐴| |𝐵|. Hence, |𝐴2 | = |𝐴|2 .
Example 12
1 2 3 4 5
1 3 9 0 6
|3 0 5 7 1 || = 0
|
5 −2 1 −4 0
3 0 5 7 1
Example 13
Suppose 𝐴 and 𝐵 are 4 × 4 matrices with det(𝐴) = 4 and det(𝐵) = 3. What are
the values of det(2 𝐵𝑇 ) and det(𝐴𝑇 𝐵2 ) ?
Solution
det(2 𝐵𝑇 ) = 24 det(𝐵𝑇 ) = 16 det(𝐵) = 48.
12
8. Inverse of Matrix
−1
The inverse of a n n matrix A , if it exists, is denoted by A , and is
defined to be the n n matrix such that
A A−1 = A−1 A = I
where I is the n n identity matrix. Note, the inverse only exists for square
matrices if det( A) 0 (nonsingular matrix).
1
𝐴−1 = adj(𝐴)
det(𝐴)
where 𝐚𝐝𝐣(𝑨) is the transpose of the cofactor matrix (the matrix formed by all
of the cofactors of the square matrix 𝐴). For 3 × 3 matrix
Example 14
2 1
Find 𝐴−1 for 𝐴 = [ ].
4 3
Solution
13
+(3) −(4) 𝑇 3 −1
det(𝐴) = 6 − 4 = 2 and adj(𝐴) = [ ] =[ ]
−(1) +(2) −4 2
1 3 −1 3⁄2 − 1⁄2
∴ 𝐴−1 = [ ]=[ ].
2 −4 2 −2 1
Check answer:
Example 15
1 2 4
Find 𝐴−1 for A = − 1 0 3 .
3 1 − 2
Solution
det(𝐴) = 7 and
T
0 3 −1 3 −1 0
+ − +
1 −2 3 −2 3 1
− 3 8 6
2 2
= 7 − 14 − 7
4 1 4 1
adj ( A) = − + −
1 −2 3 −2 3 1
− 1 5 2
2 4 1 4 1 2
+ 0 −
−1 3
+
−1 0
3
− 3 8 6
A−1 =
1 7 − 14 − 7.
7
− 1 5 2
14
Example 16
Suppose 𝐴 and 𝐵 are 3 × 3 matrices with det(𝐴) = 2 and det(𝐵) = 10. What are
the values of det(𝐴−1 𝐵𝑇 ) and det(adj𝐴) ?
Solution
1
det(𝐴−1 𝐵𝑇 ) = det(𝐴−1 ) det(𝐵𝑇 ) = det(𝐵) = 5.
det(𝐴)
1
∴ det(𝑎𝑑𝑗𝐴) = det(2 𝐴−1 ) = 23 det(𝐴−1 ) = 8 = 4.
det(𝐴)
Properties of Inverse
1 2 −1 −2 0 0
If 𝐴 = [ ] and 𝐵 = [ ] , then 𝐴 + 𝐵 = [ ].
3 4 1 3 4 7
15
Special Matrices
Zero Matrix 𝑶
It is 𝑚𝑛 matrix with all elements equal zero and it is denoted by (𝑂)
0 0 0
O= .
0 0 0
Such that 𝐴 + 𝑂 = 𝐴 and 𝐴 – 𝐴 = 𝑂.
Example 17
1 2 4 − 6
Find 𝐴𝐵 if A = and B = .
2 4 − 2 3
Solution
0 0
AB = and neither 𝐴 nor 𝐵 is zero matrix.
0 0
Triangular Matrix
16
Diagonal Matrix 𝑫
It is a square matrix whose all elements are equal zero except the principal
diagonal. The diagonal matrix takes the form
a11 0 0
0 a22 0
D= .
0 0 ann
Note that:
(a )k 0 0
11
2) D k =
0 (a22 )k 0
0 0 (ann )k
𝑎11 0 0
3) For the diagonal matrix 𝐷 = [ 0 𝑎22 0 ],
0 0 𝑎33
1⁄𝑎11 0 0
𝐷 −1
=[ 0 1⁄𝑎22 0 ] provided that 𝑎11 × 𝑎22 × 𝑎33 ≠ 0.
0 0 1⁄𝑎33
Example 18
3 0
Find det(𝐴) and 𝐴2 for A = .
0 4
Solution
3 0 3 0 9 0
det(𝐴) = 3 × 4 = 12 and A2 = = .
0 4 0 4 0 16
17
Example 19
3 0 0 0
9 2 0 0
| | = (3)(2)(−4)(1) = −24
−2 1 −4 0
0 5 7 1
(b) Interchanging the first and second rows results in an upper triangular
matrix. So,
0 4 −1 2 3 5
| 2 3 5 | = −|0 4 −1 | = − (2)(4)(1) = −8
0 0 1 0 0 1
It is diagonal matrix, whose all elements (principal diagonal) are equal one.
1 0 0
0 1 0
I = .
0 0 1
𝐼𝑚 𝐴 = 𝐴 𝐼𝑛 = 𝐴
18
For example,
1 0 0
1 0 1 2 3 1 2 3 = 1 2 3 .
=
0 1 4 5 6 4 5 6 4 5 6
0 1 0
0 0 1
Scalar Matrix 𝑺
It is a diagonal matrix with all elements are equal 𝑘 and takes the form
k 0 0
0 k 0
S= =k I.
0 0 k
Symmetric Matrix
0 3 −6 5
−3 4 −1
−3 0 4 −1
[ 4 0 9 ] [ ]
6 −4 0 9
−1 9 11
−5 1 −9 0
Symmetric matrix Skew symmetric matrix
Example 20
If 𝐴 is a 𝑚𝑛 matrix, prove that 𝐴 𝐴𝑇 is a symmetic matrix.
Solution
(𝐴 𝐴𝑇 )𝑇 = (𝐴𝑇 )𝑇 (𝐴)𝑇 = 𝐴 𝐴𝑇 .
19
Orthogonal Matrix 𝑸
An orthogonal matrix is a real square matrix whose columns and rows are
orthonormal vectors (orthogonal unit vectors). One way to express this is
𝑸𝑻 𝑸 = 𝑸 𝑸𝑻 = 𝑰,
where 𝑄𝑇 is the transpose of 𝑄 and 𝐼 is the identity matrix. This leads to the equivalent
characterization: a matrix 𝑄 is orthogonal if its transpose is equal to its inverse:
𝑸𝑻 = 𝑸−𝟏 ,
Example 21
Prove that if the matrix 𝑨 is orthogonal, then 𝐝𝐞𝐭(𝑨) = ±𝟏.
Solution
𝑨 𝑨𝑻 = 𝑰
{det(𝐴)}2 = 1 ⇒ det(𝐴) = ±1
Example 22
Prove that if 𝑨 and 𝑩 are orthogonal matrices, then 𝑨𝑩 is orthogonal matrix.
Solution
𝑨 𝑨𝑻 = 𝑰 and 𝑩 𝑩𝑻 = 𝑰
20
Note that: If 𝐴 is an orthogonal and symmetric matrix, then
𝑨−𝟏 = 𝑨𝑻 = 𝑨.
For example,
1 2 3 6
𝐴 = [ 3 −6 2 ]
7
6 2 −3
We leave to the students getting the transpose and inverse of 𝐴 to validate this
notice.
21