Unit one: Matrices
1.1 Basic Definitions:
A matrix is a rectangular array of numbers (or functions) enclosed in brackets. These
numbers (or functions) are called the entries (or sometimes the elements) of the matrix.
For example,
(1)
The first matrix has two rows (horizontal lines of entries) and three columns (vertical
lines). The second and third matrices are square matrices. Matrices having just a single
row or column are called vectors. Thus the fourth and last matrices are called row and
column vectors, respectively.
We shall denote matrices by capital letters A, B, C, …, or A = [aij]
m × n is called the size of the matrix.
𝑎11 𝑎12 . . . 𝑎1𝑚
𝑎21 𝑎22 . . . 𝑎2𝑚
| . . . . |
A ≡ [aij] = . . . |
| .
. . . .
𝑎𝑛1 𝑎𝑛2 . . . 𝑎𝑛𝑚
If m = n, we call A an n×n square matrix. A matrix that is not square is called a
rectangular matrix.
1.2 Equality of Matrices:
Two matrices A = [ajk ] and B = [bjk] are equal (written A = B) if and only if they have
the same size, and the corresponding elements are equal, that is, a11 = b11, a12 = b12, and
so on. Matrices that are not equal are called different.
Example:
1
1.3 Addition of Matrices
The sum of two matrices A = [aij ] and B = [bij] of the same size is written A + B and has
the entries aij+bij obtained by adding the corresponding entries of A and B. Matrices of
different sizes cannot be added.
Example:
1.4 Scalar Multiplication (Multiplication by a Number)
The product of any m×n matrix A = [aij] and any scalar c (number c) is written cA and is
the m×n matrix cA = [cajk] obtained by multiplying each entry of A by c.
Example:
Rules for Matrix Addition and Scalar Multiplication:
(a) A + B = B + A
(b) (A + B) + C = A + (B + C)
(c) A + 0 = A
(d) A +(-A)= 0
(a) c(A + B) = cA + cB
(b) (c + k)A = cA + kA
(c) c(kA) = (ck)A
(d) IA = A
1.4 Matrix multiplication
The product C = AB (in this order) of an m×n matrix A = [aij] times an r×p matrix B=[bij]
is defined if and only if r = n and is then the m×p matrix C = [cij] with entries
2
𝑛
𝑐𝑖𝑗 = ∑ 𝑎𝑖𝑙 𝑏𝑙𝑗 = 𝑎𝑖1 𝑏1𝑗 + 𝑎𝑖2 𝑏2𝑗 + ⋯ + 𝑎𝑖𝑛 𝑏𝑛𝑗 i = 1,···,m
𝑙=1
j = 1,···,p
A B = C
[m×n] [n×p] [m×p]
Example:
Note: Matrix Multiplication is Not Commutative, AB ≠ BA in general.
Rules of Matrix Multiplication:
(a) (kA)B = k(AB) = A(kB)
(b) A(BC) = (AB)C
(c) (A + B)C = AC + BC
(d) C(A + B)= CA + CB
1.5 Transpose of a Matrix
Given any m×n matrix A=[aij], we define the transpose of A, denoted as AT and read as
“A-transpose” as
𝑎11 𝑎21 . . . 𝑎𝑚1
𝑎12 𝑎22 . . . 𝑎𝑚2
. . . .
AT =[aij]T = [aji] = . . .
.
. . . .
[𝑎1𝑛 𝑎2𝑛 . . . 𝑎𝑚𝑛 ]
Example:
3
1.6 Types of Matrices:
Type of Matrix Details Example
Row Matrix A = [aij]1×n [0 1 1 -2]
Column Matrix A = [aij]m×1
Zero or Null Matrix A = [aij]m×n where, aij = 0
Singleton Matrix A = [aij]m×n where, m = n =1 [2]
Horizontal Matrix [aij]m×n where n > m
Vertical Matrix [aij]m×n where, m > n
Square Matrix [aij]m×n where, m = n
Diagonal Matrix A = [aij] , aij = 0, when i ≠ j
A = [aij]m×n where,
Identity (Unit) Matrix (I)
Can be either upper triangular
Triangular Matrix (aij = 0, when i > j) or lower
triangular (aij = 0 when i < j)
Upper Matrix Lower Matrix
Singular Matrix |A| = 0
Non-Singular Matrix |A| ≠ 0
A = [aij] where, aij = aji
Symmetric Matrix or A=AT
(A is a square matrix)
A = [aij] where, aij = -aji
Skew-Symmetric Matrix or A= -AT
(A is a square matrix)
4
1.7 Determinants
The scalar quantity associated with a square matrix, is called “determinant”. We denote
the determinant of an n×n matrix A=[aij] as
𝑎11 𝑎12 . . . 𝑎1𝑛
𝑎21 𝑎22 . . . 𝑎2𝑛
| . . . . | 𝑛
det A= .
| . . . | = ∑1 𝑎𝑖𝑗 𝐶𝑖𝑗
. . . .
𝑎𝑛1 𝑎𝑛2 . . . 𝑎𝑛𝑛
𝑛
|A|= 𝑎𝑖1 𝐴𝑖1 + 𝑎𝑖2 𝐴𝑖2 + …+𝑎𝑖𝑛 𝐴𝑖𝑛 =∑ 𝑎𝑖𝑗 𝐶𝑖𝑗 (row definition)
𝑗=1
𝑛
|A|= 𝑎1𝑗 𝐴1𝑗 + 𝑎2𝑗 𝐴2𝑗 + …+𝑎𝑛𝑗 𝐴𝑛𝑗 =∑ 𝑎𝑖𝑗 𝐶𝑖𝑗 (column definition)
𝑖=1
where Cij is called the cofactor of the aij element and is defined as
Cij ≡ (-1)i+j Mij
where Mij is called the minor of aij, namely the determinant of (n-1) × (n-1) matrix that
survives when the row and column containing aij are struck out.
Special Cases in Determinants:
1- Determinant of order 1: The determinant of a matrix of the first order (n=1) is the
element itself.
Example: If A=[-1], then detA= -1.
2- Determinant of order 2:
5
3- Determinant of order 3:
(a) The Leibniz formula:
(b) The rule of Sarrus:
det(A)=
det(A)= a11 a22 a33+a12a23a31+a13a21a32-a31a22a13-a32a23a11-a33a21a12
Notes:
i. The scheme of Sarrus for calculating the determinant of a 3 × 3 matrix does not
carry over into higher dimensions.
ii. The Leibniz formula expresses the determinant of an n × n-matrix in a manner
which is consistent across higher dimensions.
4- If the matrix is upper or lower triangular matrix, the determinant of the matrix is
the product of the elements on the main diagonal.
Some Properties of determinants:
1- If any row or column of a determinant detA only contains zero elements, then detA= 0.
2- If A is a square matrix with the transpose AT, then detA = detAT.
3- If each element of a row or column of a square matrix A is multiplied by a
constant k, then the value of the determinant is kdetA.
4- If two rows (or columns) of a square matrix are interchanged, the sign of the
determinant is changed.
5- If any two rows or columns of a square matrix A are proportional, then
detA = 0.
6
Example 1: Evaluate the determinant of the given matrix by cofactor expansion.
Solution: |A|=
Example 2: Explain the following results:
1.8 Matrix Partitioning:
The idea of matrix partitioning is that any matrix A (which is larger than 1×1) may be
portioned into a number of smaller matrices called blocks.
Example: The matrix
7
1.9 Inverse of a Matrix
If A is a non-singular square matrix, there is an existence of n × n matrix A-1, which is
called the inverse matrix of A, such that it satisfies the property:
1
A-1= and AA-1 = A-1A = I
𝑨
where I is the Identity matrix. The inverse of a nonsingular n × n matrix A=[aij] is:
𝑐11 𝑐21 … 𝑐𝑛1
1 𝑇 1 𝑐12 𝑐22 … 𝑐𝑛2 adj(𝑨)
A-1=
|𝑨|
[𝐶𝑖𝑗 ] = |𝑨|
[ ⋮ ⋮ ⋱ ⋮ ] = |𝑨|
𝑐1𝑛 𝑐2𝑛 … 𝑐𝑛𝑛
where [Cij]T is the transpose of cofactors matrix of A, adj(A) is the adjoint matrix of A.
8
Properties of the Inverse:
Let A and B be nonsingular matrices. Then
(i) (A-1)-1 = A
(ii) (AB)-1 = B-1A-1
(iii) (AT)-1 = (A-1)T
Example:
1.10 Solution of linear simultaneous equations:
A system of m linear equations in n variables x1, x2, …, xn,
a11x1 + a12x2 + … + a1nxn = b1
a21x1 + a22x2 + … + a2nxn = b2 (1)
⋮ ⋮
am1x1 + am2x2 + … + amnxn = bm
can be written completely as a matrix AX=B, where
9
𝑎11 𝑎12 . . . 𝑎1𝑛 𝑥1 𝑏1
𝑎21 𝑎22 . . . 𝑎2𝑛 𝑥2 𝑏2
. . . . . .
A= . . . , X = . , B= .
.
. . . . . .
[𝑎𝑚1 𝑎𝑚2 . . . 𝑎𝑚𝑛 ] [ 𝑥 𝑛] [𝑏𝑚 ]
Let us suppose that m = n in the equation above, so that the coefficient matrix A is
n×n. In particular, if A is nonsingular, then the system AX = B can be solved by:
X = A-1 B
Where X is variable matrix, A coefficients matrix and B constant matrix. (Note: if
det A=0, the system of linear equations is called inconsistent, i.e. there is no unique
solution).
Example: Use the inverse of the coefficient matrix to solve the system
2x1 + x3 = 2
-2x1 + 3x2 + 4x3 = 4
-5x1 + 5x2 + 6x3 = -1
Solution:
(Home work !)
Thus
In addition to the inverse matrix method shown above, there are two another widely used
important methods:
10
1- Cramer’s Rule
Let A be the coefficient matrix of system (1). If det A ≠ 0, then the solution of (1) is
given by
det 𝐀1 det 𝐀2 det 𝐀𝑛
𝑥1 = , 𝑥2 = , … , 𝑥𝑛 =
det 𝐀 det 𝐀 det 𝐀
where Ak, k = 1, 2, . . ., n, is defined as:
𝑎11 𝑎12 … 𝑎1 𝑘−1 𝑏1 𝑎1 𝑘+1 … 𝑎1𝑛
𝑎21 𝑎22 … 𝑎2 𝑘−1 𝑏2 𝑎2 𝑘+1 … 𝑎2𝑛
Ak =
⋮ ⋮ ⋮ ⋮
[𝑎𝑛1 𝑎𝑛2 … 𝑎𝑛 𝑘−1 𝑏𝑛 𝑎𝑛 𝑘+1 … 𝑎𝑛𝑛 ]
Example:
11
2- Gaussian Elimination Method:
There are three types of elementary row operations which may be performed on the rows
of a matrix:
1- Swap the positions of two rows.
2- Multiply a row by a non-zero scalar.
3- Add to one row a scalar multiple of another.
The solution is then found by the process called back-substitution.
Example: Solve the following linear system using Gaussian elimination:
Solution: Using row operations on the augmented matrix of the system, we obtain:
Substituting x3 = 5 into the second equation gives x2 = -3. Substituting both these values
back into the first equation finally yields x1 = 10.
Home Works:
Exercises 8.2: Problems 1-20 (Only use Gaussian elimination).
Exercises 8.4: All Problems.
Exercises 8.5: 1-16.
Exercises 8.7: Problems 1-11.
12