Ch6 Matrix, Determinant and System of Linear Equations

Download as pdf or txt
Download as pdf or txt
You are on page 1of 114

Page 1 of 114

MA1201 Basic Calculus and Linear Algebra II

Chapter 6
Matrix, Determinant and System of Linear Equations
Page 2 of 114

Basic Definition of Matrices


A 𝑚 × 𝑛 matrix, denoted by 𝐴, is a rectangular array of 𝑚𝑛 numbers arranged in
the form
𝑛 columns
⏞ 𝑎11 𝑎12 … 𝑎1𝑛
𝑎21 𝑎22 … 𝑎2𝑛
𝐴=( ⋮ ⋮ ⋱ ⋮ ) 𝑚 rows
𝑎𝑚1 𝑎𝑚2 … 𝑎𝑚𝑛
}
Example 1
2 3
( ) is a 2 × 2 matrix. We also call this matrix as square matrix.
1 5
(3 1 2) is a 1 × 3 matrix. This matrix is also called a row vector.
2
(3) is a 3 × 1 matrix. This matrix is also called a column vector.
0
Page 3 of 114

Algebra on Matrix
1. Comparison of two matrices
Definition (Equality of matrices)
We say two matrices 𝐴 and 𝐵 are equal (i.e. 𝐴 = 𝐵) if and only if BOTH
the size of two matrices and ALL entries of two matrices are the same.

Example 2

2 3 2 3 1 1 −3 𝑏 −3 𝑎=2
( )≠( ), (1 4) ≠ ( ), ( )=( )⇒{ .
1 4 1 −4 4 0 𝑎 0 2 𝑏=1
Remarks

Different from real number, we cannot say whether one matrix is bigger / smaller
than another matrix. We cannot say

𝐴 > 𝐵 or 𝐴 < 𝐵.
Page 4 of 114

2. Addition, subtraction and multiplication matrices


Definition (Addition and subtraction of matrices)
Let 𝐴 and 𝐵 two 𝑚 × 𝑛 matrices (must be the same size), the addition
(𝐴 + 𝐵) and subtraction (𝐴 − 𝐵) two matrices are defined as
𝑎11 ⋯ 𝑎1𝑛 𝑏11 ⋯ 𝑏1𝑛 𝑎11 ± 𝑏11 ⋯ 𝑎1𝑛 ± 𝑏1𝑛
𝐴±𝐵 =( ⋮ ⋱ ⋮ )±( ⋮ ⋱ ⋮ )=( ⋮ ⋱ ⋮ )
𝑎𝑚1 ⋯ 𝑎𝑚𝑛 𝑏𝑚1 ⋯ 𝑏𝑚𝑛 𝑎𝑚1 ± 𝑏𝑚1 ⋯ 𝑎𝑚𝑛 ± 𝑏𝑚𝑛

Example 3
2 1 0 1 2+0 1+1 2 2
( )+( )=( )=( ).
−1 3 2 −3 −1 + 2 3 + (−3) 1 0
2 1 1 2 2−1 1−2 1 −1
( )−( )=( )=( ).
−1 3 −1 0 −1 − (−1) 3 − 0 0 3
Page 5 of 114

Definition (Multiplication of matrices)


Let 𝐴 be 𝑚 × 𝑝 matrix and 𝐵 be 𝑝 × 𝑛 matrix, then the product of two
matrices, denoted by 𝐴𝐵, is defined as
𝑝 𝑝

∑ 𝑎1𝑘 𝑏𝑘1 ⋯ ∑ 𝑎1𝑘 𝑏𝑘𝑛


𝑎11 ⋯ 𝑎1𝑝 𝑏11 ⋯ 𝑏1𝑛 𝑘=1 𝑘=1
𝐴𝐵 = ( ⋮ ⋱ ⋮ )( ⋮ ⋱ ⋮ )= ⋮ ⋱ ⋮
𝑝 𝑝
⏟𝑎𝑚1 ⋯ 𝑎𝑚𝑝 ⏟𝑏𝑝1 ⋯ 𝑏𝑝𝑛
𝑚×𝑝 matrix 𝑝×𝑛 matrix ∑ 𝑎𝑚𝑘 𝑏𝑘1 ⋯ ∑ 𝑎𝑚𝑘 𝑏𝑘𝑛
(
⏟𝑘=1 𝑘=1 )
𝑚×𝑛 matrix

More generally, the (𝑖, 𝑗)th entry of 𝐴𝐵 is given by


𝑝

[𝐴𝐵]𝑖𝑗 = ∑ 𝑎𝑖𝑘 𝑏𝑘𝑗 .


𝑘=1
Page 6 of 114

How to memorize the formula?

According to the formula, the (𝑖, 𝑗)th entry of 𝐴𝐵 is formed by adding the product
of the some entries in 𝑖 th row of 𝐴 and 𝑗 th column of 𝐵.
𝑎11 𝑎12 ⋯ 𝑎1𝑝
𝑏11 ⋯ 𝑏1𝑗 ⋯ 𝑏1𝑛
⋮ ⋱ ⋱ ⋮
𝑏21 ⋱ 𝑏2𝑗 ⋱ 𝑏2𝑛
𝐴𝐵 = 𝑎𝑖1 𝑎𝑖2 ⋯ 𝑎𝑖𝑝
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋮ ⋱ ⋮
(𝑏𝑝1
⋯ 𝑎𝑚𝑝 ) ⏟ ⋯ 𝑏𝑝𝑗 ⋯ 𝑏𝑝𝑛 )
(𝑎𝑚1
⏟ 𝑎𝑚2
𝑗 th column of 𝐵
𝑖 th row of 𝐴

[𝐴𝐵]𝑖𝑗 = ∑ 𝑎𝑖𝑘 𝑏𝑘𝑗 = 𝑎⏟𝑖1 𝑏1𝑗 + 𝑎⏟𝑖2 𝑏2𝑗 + 𝑎𝑖3 𝑏3𝑗 + ⋯ + 𝑎⏟𝑖𝑝 𝑏𝑝𝑗 .
𝑘=1 1st term 2nd term 𝑝th term
of each part of each part of each part
Page 7 of 114

Remark about multiplication rule

 When doing multiplication of two matrices, the number of columns of matrix 𝐴


MUST BE THE SAME as the number of rows of matrix 𝐵. You cannot find the
product of the following matrices:
0 1 2
(⏟1 2) (−1 3) and (−1) (1 0 1)
⏟0 −1 0
1×2 ⏟ 2 0 ⏟ 0 2×3
3×2 3×1

 Different from real numbers, the order of multiplication of matrices cannot be


1 −1
reversed in general (i.e. 𝐴𝐵 ≠ 𝐵𝐴). As an example, we take 𝐴 = ( ), 𝐵 =
0 1
1 0
( ), we have
2 1
1 −1 1 0 −1 −1
𝐴𝐵 = ( )( )=( )
0 1 2 1 2 1
1 0 1 −1 1 −1
𝐵𝐴 = ( )( )=( ) ≠ 𝐴𝐵.
2 1 0 1 2 −1
Page 8 of 114

Example 4
2 1 1 0
Compute the product ( )( ).
−1 3 2 7
Solution:
2 1 1 0
Let 𝐶 = ( )( ) be the product, the entries of 𝐶 are formed as follows:
−1 3 2 7

(1,1)th entry: 𝐶 = (2 × 1 + 1 × 2 = 4 ? ?) 2 1 1 0
( )( )
?? ?? −1 3 2 7

(1,2)th entry: 𝐶 = (? ? 2 × 0 + 1 × 7 = 7) 2 1 1 0
( )( )
?? ?? −1 3 2 7
?? ?? 2 1 1 0
(2,1)th entry: 𝐶 = ( ) ( )( )
−1 × 1 + 3 × 2 = 5 ? ? −1 3 2 7
?? ?? 2 1 1 0
(2,2)th entry: 𝐶 = ( ) ( )( )
? ? −1 × 0 + 3 × 7 = 21 −1 3 2 7
2 1 1 0 4 7
Hence, ( )( )=( ).
−1 3 2 7 5 21
Page 9 of 114

Example 5
0 1
1 0 −1
Compute the product ( ) (2 3 ).
−2 1 2
1 −1
Solution:
0 1
1 0 −1
According to the definition, the product 𝐷 = ( ) (2 3 ) is a 2 × 2
⏟−2 1 2
⏟1 −1
2×3 matrix
3×2 matrix
matrix. The entries of the product 𝐷 can be computed as follows
0 1
( ) 1 0 −1
)th
(1,1 entry: 𝐷 = (1 × 0 + 0 × 2 + −1 × 1 ? ?) ( ) (2 3 )
?? ?? −2 1 2
1 −1
0 1
)th
(1,2 ? ? 1 × 1 + 0 × 3 + (−1) × (−1) 1 0 −1
entry: 𝐷 = ( ) ( ) (2 3 )
?? ?? −2 1 2
1 −1

?? ?? 0 1
)th
(2,1 1 0 −1
entry: 𝐷 = ( ) ( ) (2 3)
(−2) × 0 + 1 × 2 + 2 × 1 ? ? −2 1 2
1 −1
Page 10 of 114

?? ?? 0 1
(2,2)th 1 0 −1
entry: 𝐷 = ( ) ( ) (2 3 )
? ? (−2) × 1 + 1 × 3 + 2 × (−1) −2 1 2
1 −1
Therefore, the product is given by
0 1
1 0 −1 −1 2
( ) (2 3 ) = ( ).
−2 1 2 4 −1
1 −1
Page 11 of 114

Example 6
0 −2
Compute the product (⏟1 2 3) (1 0 ).
1×3 matrix ⏟0 −1
3×2 matrix
Solution:
According to the definition, the product is a 1 × 2 matrix. The entries of the product
can be computed as
0 −2
(1,1)th entry: 𝐷 = (1 × 0 + 2 × 1 + 3 × 0 ? ?) (1 2 3) (1 0)
0 −1
0 −2
(1,2)th entry: 𝐷 = (? ? 1 × (−2) + 2 × 0 + 3 × (−1)) (1 2 3) (1 0 )
0 −1
Therefore the product is given by
0 −2
(1 2 3) (1 0 ) = ⏟
⏟ (2 −5) .
1×3 matrix ⏟0 −1 1×2 matrix
3×2 matrix
Page 12 of 114

Example 7
𝑎 0
Let 𝐴 = ( ), find the value of 𝐴2 and 𝐴3 . Guess the value of 𝐴𝑛 , where 𝑛 is
0 𝑏
any positive integer.

Solution
𝑎 0 𝑎 0 𝑎×𝑎+0×0 𝑎×0+0×𝑏 2
2
𝐴 =( )( )=( )=( 𝑎 0 ).
0 𝑏 0 𝑏 0×𝑎+𝑏×0 0×0+𝑏×𝑏 0 𝑏2
2 2 2 3
3
𝐴 =𝐴 𝐴=(2𝑎 0 ) (𝑎 0
)=(𝑎 × 𝑎 + 0 × 0 𝑎 × 0 + 0 × 𝑏 )=(𝑎 0 ).
2 2
0 𝑏2 0 𝑏 0×𝑎+𝑏 ×0 0×0+𝑏 ×𝑏 0 𝑏3
Following this pattern, we guess that

𝑛 𝑎𝑛 0
𝐴 =( ).
0 𝑏𝑛
Page 13 of 114

Definition (Scalar Multiplication)


Let 𝐴 be a 𝑚 × 𝑛 matrices and 𝑐 is a scalar (or real number), then the
scalar multiplication, denoted by 𝑐𝐴, is defined as
𝑎11 ⋯ 𝑎1𝑛 𝑐𝑎11 ⋯ 𝑐𝑎1𝑛
𝑐𝐴 = 𝑐 ( ⋮ ⋱ ⋮ )=( ⋮ ⋱ ⋮ ).
𝑎𝑚1 ⋯ 𝑎𝑚𝑛 𝑐𝑎𝑚1 ⋯ 𝑐𝑎𝑚𝑛

Example 8
−3 1 −6 2
2( )=( )
1 −1 2 −2
1 2 0 0
0( )=( )
−1 1 0 0
(*Note: The last matrix obtained is called “zero matrix”).
Page 14 of 114

Definition (transpose of matrix)

The transpose of a 𝑚 × 𝑛 matrix 𝐴, denoted by 𝐴𝑇 or 𝐴′ , is a 𝑛 × 𝑚


matrix defined as follows:
𝑎11 𝑎12 … 𝑎1𝑛 𝑇 𝑎11 𝑎21 … 𝑎𝑚1
𝑇
𝑎21 𝑎22 … 𝑎2𝑛 𝑎12 𝑎22 … 𝑎𝑚2
𝐴 =( ⋮ ⋮ ⋱ ⋮ ) =( ⋮ ⋮ ⋱ ⋮ ).
𝑎𝑚1 𝑎𝑚2 … 𝑎𝑚𝑛 ⏟𝑎1𝑛 𝑎2𝑛 … 𝑎𝑚𝑛
𝑛×𝑚 matrix

In order words, the 𝑖 th row (column) of matrix 𝐴 will becomes the 𝑖 th


column (row) of 𝐴𝑇 .

Example 9

𝑇 0 −1 1 𝑇 0 1 −1
1 2 1 3
( ) =( ), (1 0 −1) = (−1 0 1 ).
3 4 2 4
−1 1 0 1 −1 0
Page 15 of 114

Some Special Matrices


In this section, we introduce some special types of matrices which are of theoretical
interest.

1. Zero Matrix (denoted by 0)


A 𝑚 × 𝑛 matrix is a zero matrix if all entries of the matrix are 0,
0 0 ⋯ 0
0 0 ⋱ 0
0=( )
⋮ ⋱ ⋱ ⋮
0 ⋯ ⋯ 0
Properties of zero matrix
(1) 𝐴 ± 0 = 𝐴 (provided that the operation is feasible)
(2) 0𝐵 = 𝐵0 = 0 (provided that the operation is feasible)

Therefore, zero matrix plays a role of “zero” in the matrix world.


Page 16 of 114

2. Identity Matrix (denoted by 𝐼𝑛 , must be a square matrix)


We say a 𝑛 × 𝑛 square matrix is an identity matrix (denoted by 𝐼𝑛 ) if all
diagonal entries are 1 (𝑎𝑖𝑖 = 1) and all off-diagonal entries are 0 (𝑎𝑖𝑗 = 0, 𝑖 ≠
𝑗).
1 0 0
1 0
𝐼2 = ( ), 𝐼3 = (0 1 0).
0 1
0 0 1

Properties of identity matrix


For any 𝑚 × 𝑛 matrix 𝐴, we have
𝐴𝐼𝑛 = 𝐴, 𝐼𝑚 𝐴 = 𝐴.
Therefore, an identity matrix plays a role of "1" in the matrix world.
Page 17 of 114

3. Upper Triangular, Lower Triangular and diagonal matrix


 A square matrix is said to be an upper triangular matrix if all lower off-
diagonal entries are 0.
Lower Off-
1 2 3 Diagonal Entries
Diagonal Entries
(0 3 1 )
0 0 2
 A square matrix is said to be a lower triangular matrix if all upper-off-
diagonal entries are 0.
1 0 0 Upper Off-
( 2 3 0) Diagonal Entries
−1 1 2
 A square matrix is said to be a diagonal matrix if all off-diagonal entries are
0 (In other words, the diagonal matrix is both upper triangular and lower
triangular).
1 0 0
(0 3 0)
0 0 2
Page 18 of 114

Remark about diagonal matrix


If the given matrix 𝐴 is diagaonal, there is a simple formula regarding the power of
this matrix.

For any positive integer 𝑛 and a 𝑚 × 𝑚 diagonal matrix 𝐴, we have

𝑎1 0 ⋯ 0 𝑛 (𝑎1 )𝑛 0 ⋯ 0
0 𝑎2 ⋯ 0 0 (𝑎2 )𝑛 ⋯ 0
( ) =( ).
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
0 0 ⋯ 𝑎𝑚 0 0 ⋯ (𝑎𝑚 )𝑛
For example:

2 0 0 4 24 0 0
(0 −1 0) = ( 0 (−1)4 0)
0 0 3 0 0 34
 One has to be careful that the above formula can be applied to diagonal matrix
ONLY!
Page 19 of 114

4. Symmetric matrix and skew-symmetric matrix

 We say a square matrix 𝐴 is symmetric if and only if 𝐴𝑇 = 𝐴. For example:


1 0 −1 𝑇 1 0 −1
( 0 2 3 ) =( 0 2 3 )
−1 3 1 −1 3 1

 We say a square matrix 𝐵 is skew-symmetric (anti-symmetric) if and only if


𝐴𝑇 = −𝐴. For example:
0 2 −1 𝑇 0 −2 1 0 2 −1
(−2 0 −3) = ( 2 0 3) = − (−2 0 −3).
1 3 0 −1 −3 0 1 3 0
Page 20 of 114

Example 10
1 𝑥
Let 𝐴 = ( ). Suppose 𝐴 is symmetric, find the values of 𝑥. Is 𝐴 skew-
3 2
symmetric?

Solution

Note that 𝐴 is symmetric, thus 𝐴𝑇 = 𝐴


1 3 1 𝑥
⇒( )=( )
⏟𝑥 2 ⏟ 3 2
𝐴𝑇 𝐴

By comparing the entries (1,2)th , we have 𝑥 = 3.


On the other hand, 𝐴 is not skew-symmetric because
1 3 1 3
𝐴𝑇 = ( ) ≠ −( ) = −𝐴.
3 2 3 2
Page 21 of 114

Inverse of a matrix – Motivation and Definition

 In real number world, we can solve the equation 𝑎𝑥 = 𝑏 for 𝑥 by multiplying


1
both sides of equations by (which is also called multiplicative inverse of 𝑎):
𝑎
1 1 𝑏
𝑎𝑥 = 𝑏 ⇒ ( ) 𝑎 𝑥 = ( ) 𝑏 ⇒ 𝑥 = .
⏟𝑎 𝑎 𝑎
=1
 Let’s consider the following system of linear equations:
2𝑥 − 2𝑦 + 𝑧 = 3
{ 𝑥 + 𝑦 − 𝑧 = 1.
4𝑥 + 𝑦 + 𝑧 = 0
Using the matrix multiplication, one can rewrite the above system in the
following “matrix form”:
2𝑥 − 2𝑦 + 𝑧 = 3 2 −2 1 𝑥 3
{ 𝑥 + 𝑦 − 𝑧 = 1 ⇒ (1 1 −1) (𝑦) = (1) ⇒ 𝑨𝒙 = 𝒃
4𝑥 + 𝑦 + 𝑧 = 0 4 1 1 𝑧 0
2 −2 1 𝑥 3
where 𝐴 = (1 1 −1), 𝒙 = (𝑦) and 𝑏 = (1).
4 1 1 𝑧 0
Page 22 of 114

Intuitively, one may follow the method as in the single equation case and solve
for 𝒙 by multiplying the whole equation by the matrix 𝐴−1 :
𝑨−𝟏 (𝑨𝒙) = 𝑨−𝟏 𝒃 ⇒ (𝑨 −𝟏 −𝟏
⏟ 𝑨) 𝒙 = 𝑨 𝒃 ⇒ 𝒙 = 𝑨 𝒃
−𝟏

𝑰𝒏
𝑥 2 −2 1 −1 3
⇒ (𝑦) = (1 1 −1) (1).
𝑧 4 1 1 0
= 𝐴−1 𝐵 ⇒ 𝒙 = 𝐴−1 𝐵.
Such the matrix 𝐴−1 is called (multiplicative) inverse of the matrix 𝐴. In the
coming section, we shall study the inverse of a square matrix in more detail.
Page 23 of 114

Definition (Inverse of a square matrix)

Let 𝐴 be 𝑛 × 𝑛 square matrix, the inverse matrix of 𝐴 is a 𝑛 × 𝑛 matrix 𝐵


such that

𝐵𝐴 = 𝐴𝐵 = 𝐼𝑛
where 𝐼𝑛 is a 𝑛 × 𝑛 identity matrix. If such matrix 𝐵 exists, we denote this
matrix 𝐵 by 𝐴−1 .

Remark:
 One has to be careful that the inverse of matrix is defined on square matrix only.
The inverse of a rectangular matrix (say 5 × 6 matrix) is not defined.
 The inverse of some matrices may not exist (see example below). These matrices
are called singular matrices (or non-invertible matrix).
 On the other hand, we say the matrix is non-singular (or invertible) if its inverse
exists.
Page 24 of 114

Example 11
2 1 −1 −1
Let 𝐴 = ( ) and 𝐵 = ( ) be two matrices.
−3 −1 3 2
(a) Find 𝐴𝐵 and 𝐵𝐴.
(b) Is 𝐴 non-singular (invertible)? Explain your answer.
Solution
(a) By direction calculation, we find that
2 × (−1) + 1 × 3 2 × (−1) + 1 × 2 1 0
𝐴𝐵 = ( )=( ).
(−3) × (−1) + (−1) × 3 (−3) × (−1) + (−1) × 2 0 1
(−1) × 2 + (−1) × (−3) (−1) × 1 + (−1) × (−1) 1 0
𝐵𝐴 = ( )=( ).
3 × 2 + 2 × (−3) 3 × 1 + 2 × (−1) 0 1
(b) Since 𝐴𝐵 = 𝐵𝐴 = 𝐼2 , hence 𝐵 is the inverse of 𝐴 (i.e. 𝐵 = 𝐴−1 ) and the
matrix 𝐴 is invertible.
Page 25 of 114

Example 12
0 0
Show that there is no inverse for zero matrix 0 = ( ).
0 0
Solution:
𝑎 𝑏
For any square matrix 𝑀 = ( ), we have
𝑐 𝑑
0 0 𝑎 𝑏 0×𝑎+0×𝑐 0×𝑏+0×𝑑 0 0
0𝑀 = ( )( )=( )=( ) ≠ 𝐼2 .
0 0 𝑐 𝑑 0×𝑎+0×𝑐 0×𝑏+0×𝑑 0 0
0 0
Since there is no matrix 𝑀 such that 0𝑀 = 𝐼2 , hence the inverse of 0 = ( )
0 0
0 0
does not exist. In other word, 0 = ( ) is singular (or not invertible)
0 0
Page 26 of 114

Example 13 (Harder Example)

Let 𝐴 be a square matrix such that 𝐴3 − 𝐴 + 𝐼𝑛 = 0, show that 𝐴 is invertible and


find 𝐴−1 .

Solution:
IDEA: To show the matrix is invertible, one can rewrite the equation into the form
𝐴(? ? ) = (? ? )𝐴 = 𝐼𝑛 . Then (??) will be the desired inverse.

Note that

𝐴3 − 𝐴 + 𝐼𝑛 = 0 ⇒ 𝐴3 − 𝐴 = −𝐼𝑛
⇒ 𝐴 − 𝐴3 = 𝐼𝑛
⇒ 𝐴 (⏟𝐼𝑛 − 𝐴2 ) = (⏟𝐼𝑛 − 𝐴2 ) 𝐴 = 𝐼𝑛 .
?? ??

Therefore 𝐴 is invertible and 𝐴−1 = 𝐼𝑛 − 𝐴2 .


Page 27 of 114

The following shows some important properties of inverse:

Properties of inverse matrix

Let 𝐴, 𝐵 be two 𝑛 × 𝑛 non-singular (invertible) square matrix, then

1. (𝐴−1 )−1 = 𝐴
1
1.2. (𝑐𝐴)−1 = 𝐴−1 where 𝑐 is any non-zero scalar.
𝑐
3. (𝐴𝐵)−1 = 𝐵−1 𝐴−1 (NOT 𝐴−1 𝐵−1 !)
Reason:
Since (𝐴𝐵)(𝐴𝐵)−1 = (𝐴𝐵)(𝐵−1 𝐴−1 ) = 𝐴𝐼𝑛 𝐴−1 = 𝐴𝐴−1 = 𝐼𝑛 .
4. (𝐴𝑇 )−1 = (𝐴−1 )𝑇 (i.e. you can reverse the order of inverse and
transpose.)
Page 28 of 114

Questions:

 Is there any efficient way to check whether a given square matrix 𝐴 is non-
singular (invertible) or not? (i.e. Does its inverse exist?)

 Is there any efficient way to find the inverse of an invertible matrix (instead of
trial by error)?

To answer those questions, we need a notation called determinant of matrix.


Given an 𝑛 × 𝑛 square matrix 𝐴, then

(1) If det 𝐴 = 0, then the matrix 𝐴 is singular (not invertible)


(2) If det 𝐴 ≠ 0, then the matrix 𝐴 is non-singular (invertible) and its
inverse is given by
−1
1
𝐴 = adj 𝐴.
det 𝐴
Page 29 of 114

Determinant of a square matrix


We start to define the determinant of a 2 × 2 square matrix
Definition (Determinant of a 𝟐 × 𝟐 matrix)
𝑎11 𝑎12
The determinant of a 2 × 2 square matrix 𝐴 = (𝑎 𝑎22 ), denoted by
21
det 𝐴 or |𝐴|, is defined as follows:

det 𝐴 = |𝐴| = 𝑎11 𝑎22 − 𝑎12 𝑎21 .

Example 14
2 3 1 0
det ( ) = 2(−4) − (3)(1) = −11, det ( ) = 1(3) − 2(0) = 3.
1 −4 2 3
Page 30 of 114

Determinant for an 𝒏 × 𝒏 matrix (𝒏 ≥ 𝟑)


We need to define two quantities:
Let 𝐴 be an 𝑛 × 𝑛 square matrix, we define
 The minor of the element 𝒂𝒊𝒋 , denoted by 𝑀𝑖𝑗 , is the determinant of a
(𝑛 − 1) × (𝑛 − 1) submatrix of 𝐴 obtained by deleting 𝑖 th row and 𝑗 th
1 2 3
column of 𝐴. As an example, we let 𝐴 = (4 5 6). Then
7 8 9
1 2 3
5 6
𝑀11 = det (4 5 6) = det ( ) = 5(9) − 6(8) = −3,
8 9
7 8 9
1 2 3
1 2
𝑀23 = det (4 5 6) = det ( ) = 1(8) − 2(7) = −6.
7 8
7 8 9
 The cofactor of the element 𝒂𝒊𝒋 , denoted by 𝐴𝑖𝑗 , is defined as
𝐴𝑖𝑗 = (−1)𝑖+𝑗 𝑀𝑖𝑗 .
Page 31 of 114

The determinant of an 𝑛 × 𝑛 matrix (𝑛 ≥ 3) can be defined as follows:


Definition (Determinant of an 𝒏 × 𝒏 matrix)

Let 𝐴 be an 𝑛 × 𝑛 square matrix (where 𝑛 ≥ 3), the determinant of 𝐴 is defined as


𝑅1
det 𝐴 =
⏞ 𝑎11 𝐴11 + 𝑎12 𝐴12 + 𝑎13 𝐴13 + ⋯ + 𝑎1𝑛 𝐴1𝑛 .
(We say that the determinant of 𝐴 is expanded along the 1st row)
Remark:
In general, one can compute the determinant of 𝐴 by expanding along any row or
any column, i.e.
𝑅𝑖
⏞ 𝑎𝑖1 𝐴𝑖1 + 𝑎𝑖2 𝐴𝑖2 + ⋯ + 𝑎𝑖𝑛 𝐴𝑖𝑛 (along 𝑖 th row)
det 𝐴 =
or
𝐶𝑗
⏞ 𝑎1𝑗 𝐴1𝑗 + 𝑎2𝑗 𝐴2𝑗 + ⋯ + 𝑎𝑛𝑗 𝐴𝑛𝑗 (along 𝑗 th column).
det 𝐴 =
Page 32 of 114

Example 15
1 0 2
Compute the determinant of 𝐴 = (1 1 2).
3 −1 1
Solution

We can compute the determinant by expanding along the 1st row:


𝑅1
det 𝐴 =
⏞ 𝑎11 𝐴11 + 𝑎12 𝐴12 + 𝑎13 𝐴13
1 2 1 2
1 × [(−1)1+1 det (
= ⏟ 0 × [(−1)1+2 det (
)] + ⏟ )] + ⏟
2
⏟ −1 1 ⏟ 3 1
𝑎 11 𝑎 12 𝑎 13
𝐴11 =(−1)1+1 𝑀11 𝐴12 =(−1)1+2 𝑀12
1 1
× [(−1)1+3 det ( )]
⏟ 3 −1
𝐴13 =(−1)1+3 𝑀13

= 1 × (1(1) − 2(−1)) + 0 + 2 × [1(−1) − (1)(3)] = −5.


Page 33 of 114

Example 16
Compute the determinant
1 3 −2
det (0 0 3)
2 −2 4
(a) By expanding along the 1st row.
(b) By expanding along the 2nd row.
Solution:
(a) By expanding the determinant along the first row, we have
1 3 −2 𝑅1
det (0 0 3 )=⏞ 𝑎⏟11 𝐴11 + 𝑎⏟12 𝐴12 + 𝑎⏟13 𝐴13
2 −2 4 1 3 −2
0 3 0 3
= ⏟ 1 [(−1)1+1 det ( )] + ⏟3 [(−1)1+2 det ( )]
⏟ −2 4 ⏟ 2 4
𝑎11 𝑎 12
𝐴11 =(−1)1+1 𝑀11 𝐴12 =(−1)1+2 𝑀12
0 0
⏟ [(−1)1+3 det (
+ −2 )] = 1(6) + 3(6) + (−2)0 = 24.
⏟ 2 −2
𝑎 13
𝐴13 =(−1)1+3 𝑀13
Page 34 of 114

(b) By expanding the determinant along the second row, we have


1 3 −2 𝑅2
det (0 0 3 )=⏞ 𝑎⏟
21 𝐴21 + 𝑎⏟
22 𝐴22 + 𝑎⏟23 𝐴23
2 −2 4 0 0 3
1 3
= ⏟3 [(−1)2+3 det ( )] = 3(8) = 24.
⏟ 2 −2
𝑎 23
𝐴23 =(−1)2+3 𝑀23

Remark

In this example, we observe that the computation is relatively easier if one expands
the determinant along the second row. It is simply because there are quite a number
of "0" in the second row so that one does not need to compute so many confactors
𝐴𝑖𝑗 .

Therefore, one should expand the determinant along the row (or column) with
largest number of "0" in it so that the computation cost is minimized.
Page 35 of 114

Example 17
0 2 3
Compute the determinant of 𝐵 = (0 1 2).
0 −1 2
Solution

Although one can obtain the answer by expanding along the 1st row, it may be
easier if one choose to expand along the 1st column.

We expand the determinant along the first column, we get


𝐶1
det 𝐵 =
⏞ 𝑏11 𝐴11 + 𝑏21 𝐴21 + 𝑏31 𝐴31
= 0 × 𝐴11 + 0 × 𝐴21 + 0 × 𝐴31
= 0.
Page 36 of 114

Example 18
1 0 2 3
0 2 1 0
Compute the determinant of 𝐴 = ( ).
2 1 0 1
−1 1 1 0
Solution
We expand the determinant along the 2nd row:
𝑅2 0 2 1 0
⏞ 𝑎⏞
det 𝐴 = 21 𝐴21 + 𝑎⏞
22 𝐴22 + 𝑎⏞
23 𝐴23 + 𝑎⏞
24 𝐴24
1 2 3 1 0 3
= 2 × [(−1 )2+2 det ( 2 0 1)] + 1 × [(−1)2+3
det ( 2 1 1)]
−1 1 0 −1 1 0
2 3 1 2
= 2 × [2 × (−1)2+1 det ( ) + 1 × (−1)2+3 det ( )]
1 0 −1 1
1 1 2 1
−1 × [1 × (−1)1+1 det ( ) + 3 × (−1)1+3 det ( )] = ⋯ = −2.
1 0 −1 1
Page 37 of 114

Application of Determinant #1 – Finding inverse of a square matrix


Theorem 1 (Existence of inverse matrix)
Given an 𝑛 × 𝑛 square matrix 𝐴, if

(1) det 𝐴 = 0, then the matrix is singular (not invertible).


(2) det 𝐴 ≠ 0, then the matrix is non-singular (invertible).

Theorem 2 (General formula of inverse of matrix)

Let 𝐴 be an 𝑛 × 𝑛 invertible square matrix, then its inverse 𝐴−1 is given by

𝐴11 𝐴12 ⋯ 𝐴1𝑛 𝑇


1 1 𝐴 𝐴22 ⋯ 𝐴2𝑛
𝐴−1 = adj 𝐴 = ( 21 ) .
det 𝐴 det 𝐴 ⋮ ⋮ ⋱ ⋮
𝐴𝑛1 𝐴𝑛2 ⋯ 𝐴𝑛𝑛
where 𝐴𝑖𝑗 is the cofactor of the entry 𝑎𝑖𝑗 .

𝐴11 𝐴12 ⋯ 𝐴1𝑛 𝑇


1 1 𝐴 𝐴22 ⋯ 𝐴2𝑛
𝐴−1 = 𝑎𝑑𝑗 𝐴 = ( 21 )
det 𝐴 det 𝐴 ⋮ ⋮ ⋱ ⋮
Page 38 of 114

How to memorize the inverse matrix formula?


Although the formula looks complicated, one can memorize this formula in the
following way:
The entries of 𝐴 (𝑎𝑖𝑗 ) are
replaced by its cofactor (𝐴𝑖𝑗 )
in 𝐴−1
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝐴11 𝐴12 ⋯ 𝐴1𝑛 𝑇
𝑎21 𝑎22 ⋯ 𝑎2𝑛 1 𝐴 𝐴22 ⋯ 𝐴2𝑛
𝐴=( ⋮ 𝐴−1 = ( 21 )
⋮ ⋱ ⋮ ) det 𝐴 ⋮ ⋮ ⋱ ⋮
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝐴𝑛1 𝐴𝑛2 ⋯ 𝐴𝑛𝑛

1
There are two extra terms and
det 𝐴
the transpose 𝑇 above the matrix
Page 39 of 114

Example 19
1 3
Show that the matrix ( ) is invertible and find its inverse.
2 4
Solution
1 3
Step 1: Show that the matrix ( ) is invertible.
2 4
1 3 1 3
Note that det ( ) = 1 × 4 − 2 × 3 = −2 ≠ 0, so ( ) is invertible.
2 4 2 4
Step 2: To find the inverse, we first compute all cofactors, note that
𝐴11 = (−1)1+1 (4) = 4, 𝐴12 = (−1)1+2 (2) = −2,
𝐴21 = (−1)2+1 (3) = −3, 𝐴22 = (−1)2+2 (1) = 1.
Thus the inverse is given by

1 3 −1 1 𝐴11 𝐴12 𝑇 1 4 −2 𝑇 −2 3/2


( ) = ( ) = ( ) =( ).
2 4 det 𝐴 𝐴21 𝐴22 −2 −3 1 1 −1/2
Page 40 of 114

Example 20
1 −1 2
Let 𝐴 = (1 1 0 ) be a 3 × 3 matrix. Find the inverse of 𝐴 if it exists.
0 1 −1
Solution:
We first check whether the inverse exists by computing the determinant of 𝐴:

By expanding the determinant along the first row, we have


𝑅1
1 0 1 0 1 1
det 𝐴 =
⏞ 1 × det ( ) − (−1) × det ( ) + 2 × det ( )
⏟ 1 −1 ⏟ 0 −1 ⏟ 0 1
=1×(−1)−(1×0) =1×(−1)−(0×0) 1×1−(0×1)
= 1 × (−1) − (−1)(−1) + 2(1) = 0.
Since det 𝐴 = 0, we can conclude that 𝐴 is not invertible (or 𝐴 is singular) and its
inverse 𝐴−1 does not exist.
Page 41 of 114

Example 21
3 2 6
Let 𝐴 = (1 1 2). Show that the matrix is invertible and find 𝐴−1 .
2 2 5
Solution:
Step 1: Show that the matrix is invertible.
𝑅1
1 2 1 2 1 1
Note that det 𝐴 =
⏞ 3 det ( ) − 2 det ( ) + 6 det ( ) = 1 ≠ 0. Hence the
2 5 2 5 2 2
matrix 𝐴 is invertible.

Step 2: Find the inverse 𝐴−1 .

Note that the cofactors are given by


1 2 1 2
𝐴11 = (−1)1+1 det ( ) = 1, 𝐴12 = (−1)1+2 det ( ) = −1
2 5 2 5
1 1 2 6
𝐴13 = (−1)1+3 det ( ) = 0, 𝐴21 = (−1)2+1 det ( )=2
2 2 2 5
Page 42 of 114

3 6 3 2
𝐴22 = (−1)2+2 det ( ) = 3, 𝐴23 = (−1)2+3 det ( ) = −2
2 5 2 2
2 6 3 6
𝐴31 = (−1)3+1 det ( ) = −2, 𝐴32 = (−1)3+2 det ( )=0
1 2 1 2
3 2
𝐴33 = (−1)3+3 det ( ) = 1.
1 1
Hence, the inverse is given by

1 𝐴11 𝐴12 𝐴13 𝑇 1 1 −1 0 𝑇 1 2 −2


𝐴−1 = (𝐴21 𝐴22 𝐴23 ) = ( 2 3 −2) = (−1 3 0 ).
det 𝐴 𝐴 𝐴32 𝐴33 1
31 −2 0 1 0 −2 1
Page 43 of 114

Example 22
Using the inverse of matrix to solve the following system of linear equations
3𝑥 + 2𝑦 + 6𝑧 = 1
{ 𝑥 + 𝑦 + 2𝑧 = 3 .
2𝑥 + 2𝑦 + 5𝑧 = 1
Solution
One can rewrite the above system into the matrix form:
3𝑥 + 2𝑦 + 6𝑧 = 1 3 2 6 𝑥 1
{ 𝑥 + 𝑦 + 2𝑧 = 3 ⇒ (1 1 2) (𝑦) = (3).
2𝑥 + 2𝑦 + 5𝑧 = 1 ⏟2 2 5 𝑧 1
𝐴
1 2 −2
For Example 21, we know that 𝐴 is invertible and 𝐴−1 = (−1 3 0 ). Thus,
0 −2 1
𝑥 1 2 −2 1 5
(𝑦) = (−1 3 0 ) (3) = ( 8 ).
𝑧 0 −2 1 1 −5
Page 44 of 114

Remark of Example 22
 This method only works for the system which the number of equations equals
the number of unknowns so that the coefficient matrix 𝐴 is a square matrix (say
in this example, we have 3 equations and 3 unknowns).

 This method will fail when the number of unknowns does not match with the
number of equations. For example
𝑥
2𝑥 − 𝑦 + 𝑧 = 3 2 −1 1 3
{ ⇒ ( ) (𝑦) = ( ).
𝑥+𝑦+𝑧 =1 ⏟1 1 1 1
𝑧
not square matrix
or the coefficient matrix is not invertible
𝑥+ 𝑦=1 1 1 𝑥 1
{ ⇒ ( ) (𝑦) = ( ).
3𝑥 + 3𝑦 = 2 ⏟3 3 2
not invertible
To solve those equations, we shall apply a more general method (called Gaussian
Elimination) which will be discussed later.
Page 45 of 114

Example 23
3 1 1 3
Let 𝐴 = ( ) and 𝐵 = ( ).
−2 1 2 2
−1 0
(a) Show that 𝐴−1 𝐵𝐴 = ( ).
0 4
(b) Hence, evaluate 𝐵100 .
Solution:

(a) By some calculation (Exercise!!), one can obtain


1 1 −1
𝐴−1 = ( )
5 2 3
Then using multiplication rule, we have
−1
1 1 −1 1 3 3 1
𝐴 𝐵𝐴 = ( )( )( )
5 2 3 2 2 −2 1
1 −1 1 3 1 1 −5 0 −1 0
= ( )( )= ( )=( )
5 8 12 −2 1 5 0 20 0 4
Page 46 of 114

(b) From (a), we observe that


−1 0 −1 0 −1
𝐴−1 𝐵𝐴 = ( ) ⇒ 𝐴(𝐴−1 𝐵𝐴)𝐴−1 = 𝐴 ( )𝐴
0 4 0 4
−1 0 −1
⇒ 𝐵 = 𝐴( )𝐴
0 4
Then
𝐵100
=𝐼2
−1 0 ⏞−1 −1 0 −1 −1 0 −1 −1 0 −1
= 𝐴( )𝐴 𝐴( )𝐴 𝐴( )𝐴 …𝐴( )𝐴
⏟ 0 4 0 4 0 4 0 4
−1 0 −1
100 𝐴( )𝐴 ′𝑠
0 4
−1 0 100 −1
= 𝐴( ) 𝐴
0 4
3 1 (−1)100 0 1 1 −1
=( )( )[ ( )]
−2 1 0 4 100 5 2 3
1 3 + 2 × 4100 −3 + 3 × 4100
=⋯= ( 100 100 ).
5 −2 + 2 × 4 2+3×4
Page 47 of 114

Application of Determinant #2 -- Computing vector product


The determinant is also useful in computing vector product of two vectors. Given
two vectors 𝑎⃗ = 𝑎1 𝑖⃗ + 𝑎2 𝑗⃗ + 𝑎3 𝑘⃗⃗ and 𝑏⃗⃗ = 𝑏1 𝑖⃗ + 𝑏2 𝑗⃗ + 𝑏3 𝑘⃗⃗ in a plane, one can
compute the vector product 𝑎⃗ × 𝑏⃗⃗ using direct expansion:
𝑎⃗ × 𝑏⃗⃗ = (𝑎1 𝑖⃗ + 𝑎2 𝑗⃗ + 𝑎3 𝑘⃗⃗) × (𝑏1 𝑖⃗ + 𝑏2 𝑗⃗ + 𝑏3 𝑘⃗⃗)
= 𝑎1 𝑏1 (𝑖⃗ × 𝑖⃗) + 𝑎1 𝑏2 (𝑖⃗ × 𝑗⃗) + 𝑎1 𝑏3 (𝑖⃗ × 𝑘⃗⃗) + 𝑎2 𝑏1 (𝑗⃗ × 𝑖⃗) + 𝑎2 𝑏2 (𝑗⃗ × 𝑗⃗)
+ 𝑎2 𝑏3 (𝑗⃗ × 𝑘⃗⃗) + 𝑎3 𝑏1 (𝑘⃗⃗ × 𝑖⃗) + 𝑎3 𝑏2 (𝑘⃗⃗ × 𝑗⃗) + 𝑎3 𝑏3 (𝑘⃗⃗ × 𝑘⃗⃗)
= (𝑎2 𝑏3 − 𝑎3 𝑏2 )𝑖⃗ − (𝑎1 𝑏3 − 𝑎3 𝑏1 )𝑗⃗ + (𝑎1 𝑏2 − 𝑎2 𝑏1 )𝑘⃗⃗
𝑎2 𝑎3 𝑎1 𝑎3 𝑎2 𝑅1
𝑎1 𝑖⃗ 𝑗⃗ 𝑘⃗⃗
= det (𝑏 ⃗⃗ ⏞ det (𝑎
2 𝑏3 ) 𝑖⃗ − det (𝑏1 𝑏3 ) 𝑗⃗ + det (𝑏1
𝑏2 ) 𝑘 = 1 𝑎2 𝑎3 ).
𝑏1 𝑏2 𝑏3
Hence, the vector product can be computed via determinant
𝑖⃗ 𝑗⃗ 𝑘⃗⃗
𝑎⃗ × 𝑏⃗⃗ = det (𝑎1 𝑎2 𝑎3 )
𝑏1 𝑏2 𝑏3
Page 48 of 114

Example 24
Let 𝑎⃗ = 5𝑖⃗ − 𝑘⃗⃗ and 𝑏⃗⃗ = 𝑖⃗ + 2𝑗⃗ − 𝑘⃗⃗ be two vectors, compute 𝑎⃗ × 𝑏⃗⃗.

Solution:
Using the fact in the previous fact, we obtain

𝑖⃗ 𝑗⃗ 𝑘⃗⃗
𝑎⃗ × 𝑏⃗⃗ = det (5 0 −1)
1 2 −1
0 −1 5 −1 5 0 ⃗⃗
= det ( ) 𝑖⃗ − det ( ) 𝑗⃗ + det ( )𝑘
2 −1 1 −1 1 2
= 2𝑖⃗ + 4𝑗⃗ + 10𝑘⃗⃗.
Page 49 of 114

Example 25 (Computation of triple scalar product using determinant)


Let 𝑎⃗ = 𝑎1 𝑖⃗ + 𝑎2 𝑗⃗ + 𝑎3 𝑘⃗⃗, 𝑏⃗⃗ = 𝑏1 𝑖⃗ + 𝑏2 𝑗⃗ + 𝑏3 𝑘⃗⃗ and 𝑐⃗ = 𝑐1 𝑖⃗ + 𝑐2 𝑗⃗ + 𝑐3 𝑘⃗⃗ be three
vectors. Show that
𝑎1 𝑎2 𝑎3
𝑎⃗ ∙ (𝑏⃗⃗ × 𝑐⃗) = det (𝑏1 𝑏2 𝑏3 ).
𝑐1 𝑐2 𝑐3
Solution:
𝑖⃗ 𝑗⃗ 𝑘⃗⃗
𝑎⃗ ∙ (𝑏⃗⃗ × 𝑐⃗) = 𝑎⃗ ⋅ det (𝑏1 𝑏2 𝑏3 )
𝑐1 𝑐2 𝑐3
𝑅1
𝑏 𝑏3 𝑏 𝑏3 𝑏 𝑏2 ⃗⃗
⏞ = (𝑎1 𝑖⃗ + 𝑎2 𝑗⃗ + 𝑎3 𝑘⃗⃗) ⋅ [det ( 2
= ) 𝑖⃗ − det ( 1 ) 𝑗⃗ + det ( 1 ) 𝑘]
𝑐2 𝑐3 𝑐1 𝑐3 𝑐1 𝑐2
𝑏 𝑏3 𝑏 𝑏3 𝑏 𝑏2
= 𝑎1 × det ( 2 ) − 𝑎2 × det ( 1 ) + 𝑎3 × det ( 1 )
𝑐2 𝑐3 𝑐1 𝑐3 𝑐1 𝑐2
𝑅1 𝑎1 𝑎2 𝑎3
⏞ det (𝑏1 𝑏2 𝑏3 ).
=
𝑐1 𝑐2 𝑐3
Page 50 of 114

Shortcut in computing determinant: Properties of Determinant


The following properties are useful in computing the determinant:

1. If all the elements in a row (or column) are zero, then its determinant is 0.
𝑎1 𝑎2 𝑎3 𝑎1 0 𝑏1
det ( 0 0 0 ) = 0 and det (𝑎2 0 𝑏2 ) = 0
𝑏1 𝑏2 𝑏3 𝑎3 0 𝑏3
2. The sign of determinant 𝐴 is changed if one interchanges any two rows (or
columns)
𝑏1 𝑏2 𝑏3 𝑅1⟷𝑅2 𝑎1 𝑎2 𝑎3
det (𝑎1 𝑎2 𝑎3 ) = ⏞ − det (𝑏1 𝑏2 𝑏3 )
𝑐1 𝑐2 𝑐3 𝑐1 𝑐2 𝑐3

3. (Determinant of product of matrices) For any two 𝑛 × 𝑛 square matrices 𝐴, 𝐵,


we have
det 𝐴𝐵 = det 𝐴 det 𝐵 and det 𝐴𝑇 = det 𝐴.
Page 51 of 114

4. (Determinant of inverse) If 𝐴 is invertible square matrix, we have


1
det(𝐴−1 ) = .
det 𝐴

5. (Powerful properties) The value of determinant is unchanged if multiple of one


row (column) is added to another row (column).
𝑎1 𝑎2 𝑎3 𝑅2 +𝑘𝑅1 𝑎1 𝑎2 𝑎3
det (𝑏1 + 𝑘𝑎1 𝑏2 + 𝑘𝑎2 𝑏3 + 𝑘𝑎3 ) = ⏞ det (𝑏1 𝑏2 𝑏3 ).
𝑐1 𝑐2 𝑐3 𝑐1 𝑐2 𝑐3
𝑎1 𝑎2 + 𝑘𝑎1 𝑎3 𝐶2 +𝑘𝐶1 𝑎1 𝑎2 𝑎3
det (𝑏1 𝑏2 + 𝑘𝑏1 𝑏3 ) = ⏞ det (𝑏1 𝑏2 𝑏3 ).
𝑐1 𝑐2 + 𝑘𝑐1 𝑐3 𝑐1 𝑐2 𝑐3
Page 52 of 114

6. For any scalar 𝑘, we have


𝑘𝑎11 𝑘𝑎12 ⋯ 𝑘𝑎1𝑛 𝑎11 𝑎12 ⋯ 𝑎1𝑛
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑎21 𝑎22 ⋯ 𝑎2𝑛
det ( ) = 𝑘 det ( ⋮ ⋮ ⋱ ⋮ ),
⋮ ⋮ ⋱ ⋮
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛

𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑘𝑎11 𝑘𝑎12 ⋯ 𝑘𝑎1𝑛


𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑘𝑎21 𝑘𝑎22 ⋯ 𝑘𝑎2𝑛
det [𝑘 ( ⋮ ⋮ ⋱ ⋮ )] = det ( )
⋮ ⋮ ⋱ ⋮
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑘𝑎𝑛1 𝑘𝑎𝑛2 ⋯ 𝑘𝑎𝑛𝑛
𝑎11 𝑎12 ⋯ 𝑎1𝑛
𝑎21 𝑎22 ⋯ 𝑎2𝑛
= 𝑘 𝑛 det ( ⋮ ⋮ ⋱ ⋮ ).
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛
Page 53 of 114

Example 26

Let 𝐴 be a square matrix with det 𝐴 = 5. Find the value of (i) det(𝐴𝑇 𝐴), (ii)
det(𝐴5 ) and (iii) det(𝐴−1 ).

Solution:
Using the properties of determinant (3 and 4), we obtain

det(𝐴𝑇 𝐴) = det(𝐴𝑇 ) det 𝐴 = (det 𝐴) det 𝐴 = 5(5) = 25.


det(𝐴5 ) = det(𝐴 ⋅ 𝐴 ⋅ 𝐴 ⋅ 𝐴 ⋅ 𝐴) = (det 𝐴)(det 𝐴)(det 𝐴)(det 𝐴)(det 𝐴) = (det 𝐴)5
= 55 = 3125.
1 1
det(𝐴−1 ) = = .
det 𝐴 5
Page 54 of 114

Example 27
IDEA:
1 2 3 “Generate” some "0" in a particular row/
Compute det (4 5 6)
column so that the computation of
2 −1 3
determinant can be simplified.
Solution:
𝑅2 −4𝑅1
1 2 3 𝑅3 −2𝑅1 1 2 3
det (4 5 6) = ⏞ det (4 − 4(1) 5 − 4(2) 6 − 4(3))
2 −1 3 2 − 2(1) −1 − 2(2) 3 − 2(3)
1 2 3
= det (0 −3 −6)
0 −5 −3
𝐶1
−3 −6 2 3
⏞ 1 × [(−1)1+1 det (
= )] + 0 × [(−1)2+1 det ( )] + 0
−5 −3 −5 −3
2 3
× [(−1)3+1 det ( )]
−3 −6
= 1 × (−3 × (−3) − (−5) × (−6)) = 9 − 30 = −21.
Page 55 of 114

Example 28
1 −1 2 1
3 0 1 1 IDEA:
Compute the determinant det ( ) “Generate” some "0" in
1 −1 1 2
2 7 1 0 first row

Solution:
𝐶2 +𝐶1
𝐶3 −2𝐶1
1 −1 + 1 2 − 2 1−1
1 −1 2 1 𝐶4 −𝐶1
3 0 1 1 3 0+3 1−6 1−3
det ( ) =
⏞ det ( )
1 −1 1 2 1 −1 + 1 1 − 2 2−1
2 7 1 0 2 7+2 1−4 0−2
1 0 0 0 𝑅
1 3 −5 −2
3 3 −5 −2
= det ( )=⏞ 1 × det (0 −1 1)
1 0 −1 1
9 −3 −2
2 9 −3 −2
𝐶1
−1 1 −5 −2
=
⏞ 3 × det ( ) + 9 × det ( ) = 15 − 63 = −48.
−3 −2 −1 1
Page 56 of 114

Example 29
1 1 1
Factorize det ( 𝑎 𝑏 𝑐)
𝑎2 𝑏2 𝑐2
Solution:
𝐶2 −𝐶1
1 1 1 𝐶3 −𝐶1 1 1−1 1−1
det ( 𝑎 𝑏 𝑐) =
⏞ det ( 𝑎 𝑏−𝑎 𝑐−𝑎 )
𝑎2 𝑏2 𝑐2 𝑎2 𝑏 2 − 𝑎2 𝑐 2 − 𝑎2
1 0 0 𝑅1
𝑏−𝑎 𝑐−𝑎
= det ( 𝑎 𝑏−𝑎 𝑐−𝑎 )=⏞ 1 × [(−1)1+1 det ( 2 )]
𝑏 − 𝑎2 𝑐 2 − 𝑎2
𝑎2 𝑏 2 − 𝑎2 2
𝑐 −𝑎 2

𝑏−𝑎 𝑐−𝑎 1 1
= det ( ) = (𝑏 − 𝑎)(𝑐 − 𝑎) det ( )
(𝑏 − 𝑎)(𝑏 + 𝑎) (𝑐 − 𝑎)(𝑐 + 𝑎) 𝑎+𝑏 𝑐+𝑎
= (𝑏 − 𝑎)(𝑐 − 𝑎)[(1)(𝑐 + 𝑎) − (𝑎 + 𝑏)(1)]
= (𝑏 − 𝑎)(𝑐 − 𝑎)(𝑐 − 𝑏) = (𝑎 − 𝑏)(𝑏 − 𝑐)(𝑐 − 𝑎).
Page 57 of 114

Example 30
𝑎 1 1
Factorize det (1 𝑎 1).
1 1 𝑎
Solution
𝑎 1 1 𝑅1⟷𝑅3 1 1 𝑎
det (1 𝑎 1) =⏞ − det (1 𝑎 1)
1 1 𝑎 𝑎 1 1
𝑅2 −𝑅1
𝑅3 −𝑎𝑅1 1 1 𝑎 1 1 𝑎
=
⏞ − det ( 1 − 1 𝑎−1 1 − 𝑎 ) = − det (0 𝑎 − 1 −(𝑎 − 1))
𝑎 − 𝑎(1) 1 − 𝑎(1) 1 − 𝑎(𝑎) 0 1−𝑎 1 − 𝑎2
𝐶1
𝑎 − 1 −(𝑎 − 1) 1 −1
⏞ − 1 × (−1)1+1 det (
= ) = − (𝑎 − 1) det ( )
1−𝑎 1 − 𝑎2 1−𝑎 (1 − 𝑎)(1 + 𝑎)
1 −1
= −(𝑎 − 1)(1 − 𝑎) det ( ) = (𝑎 − 1)2 [(1)(1 + 𝑎) − (1)(−1)]
1 1+𝑎
= (𝑎 − 1)2 (𝑎 + 2).
Page 58 of 114

Example 31
𝑎 𝑏 𝑐
1
Show that det (𝑏 𝑐 𝑎 ) = − (𝑎 + 𝑏 + 𝑐)[(𝑎 − 𝑏)2 + (𝑏 − 𝑐)2 + (𝑐 − 𝑎)2 ].
2
𝑐 𝑎 𝑏
Solution
𝑎 𝑏 𝑐 𝑅1 +𝑅2 +𝑅3 𝑎+𝑏+𝑐 𝑎+𝑏+𝑐 𝑎+𝑏+𝑐
det (𝑏 𝑐 𝑎) =
⏞ det ( 𝑏 𝑐 𝑎 )
𝑐 𝑎 𝑏 𝑐 𝑎 𝑏
𝐶2 −𝐶1
1 1 1 𝐶3 −𝐶1 1 0 0
= (𝑎 + 𝑏 + 𝑐 ) det (𝑏 𝑐 ⏞ (𝑎 + 𝑏 + 𝑐 ) det (𝑏 𝑐 − 𝑏
𝑎) = 𝑎 − 𝑏)
𝑐 𝑎 𝑏 𝑐 𝑎−𝑐 𝑏−𝑐
𝑅1
𝑐−𝑏 𝑎−𝑏
⏞ (𝑎 + 𝑏 + 𝑐 ) [1 × det (
= )]
𝑎−𝑐 𝑏−𝑐
= −(𝑎 + 𝑏 + 𝑐)(𝑎2 + 𝑏2 + 𝑐 2 − 𝑎𝑏 − 𝑏𝑐 − 𝑐𝑎)
1
= − (𝑎 + 𝑏 + 𝑐)[(𝑎 − 𝑏)2 + (𝑏 − 𝑐 )2 + (𝑐 − 𝑎)2 ]
2
Page 59 of 114

System of Linear Equations


A system of 𝑚 linear equations in 𝑛 unknowns, 𝑥1 , 𝑥2 , … , 𝑥𝑛 is a set of
equations of the form
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎 𝑥 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
{ 21 1 .

𝑎𝑚1 𝑥1 + 𝑎𝑚2 𝑥2 + ⋯ + 𝑎𝑚𝑛 𝑥𝑛 = 𝑏𝑚
Here, 𝑎𝑖𝑗 ′𝑠 are the coefficients of the system and 𝑏𝑖 ′𝑠 are called the non-
homogeneous terms of the system.
 If at least one of 𝑏𝑖 ′𝑠 is non-zero, the system is called a non-homogeneous
system of linear equations.
 If all 𝑏𝑖 ′𝑠 are all zero, the system is called homogeneous system of linear
equations.
Page 60 of 114

Some examples of system of linear equations and its solutions


Example 32 (Unique Solution)
2𝑥 − 𝑦 = 3
{
𝑥+𝑦 =3
One can use the method of elimination by adding the first equation to the second
equation. We obtain 3𝑥 = 6 ⇒ 𝑥 = 2 and 𝑦 = 3 − 𝑥 = 1. This is the only solution
of the system.
Example 33 (No Solution)
𝑥 + 𝑦+ 𝑧=2
{
2𝑥 + 2𝑦 + 2𝑧 = 5
One can obtain from first equation that 2𝑥 + 2𝑦 + 2𝑧 = 4. This contradicts to the
second equation.
Hence, the system has no solution.
Page 61 of 114

Example 34 (Infinite many solutions)


𝑥+ 𝑦=2
{
2𝑥 + 2𝑦 = 4
The second equation is redundant and we only have one equation governing 𝑥 and
𝑦, i.e. 𝑥 + 𝑦 = 2.

In fact, this system has infinitely many solutions, i.e.


𝑥 = 2 − 𝑡, 𝑦 = 𝑡
where 𝑡 is any real number.
(For example, (𝑥, 𝑦) = (2,0), (1,1), (3, −1), (−3,5) are all possible solutions).
Page 62 of 114

A system of linear equations may have either no solutions, unique solutions or


infinitely many solutions.
 We say a system is consistent if the system has at least one solution (one or
infinitely many).
 We say a system is inconsistent if the system has no solution.

Question
 How do we determine whether a given system has no solution, a unique solution
or infinitely many solutions?
 How do we obtain a solution of a given system efficiently?

Answer: Gaussian Elimination.


Page 63 of 114

Matrix Representation of the system


𝑥1
𝑥2
𝑎
Using the fact that ( 11 𝑎12 ⋯ 𝑎1𝑛 ) ( ) = 𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 (can

𝑥𝑛
be verified by direct matrix multiplication) , we can express the system in the
following form:
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1 𝑏1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2 𝑏2
( ⋮ ⋮ ⋱ ⋮ ) ( ⋮ ) = ( )

⏟𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 ⏟𝑥𝑛 ⏟𝑏𝑚
𝑨 𝒙 𝒃

𝑨 is called the coefficient matrix, 𝒙 is called an unknown vector and 𝒃 is called the
known vector.
Page 64 of 114

Example 35
The matrix representation of the system
2𝑥 + 5𝑦 = 3
{
𝑥− 𝑦=1
is given by
2 5 𝑥 3
( ) (𝑦) = ( ).
1 −1 1
The matrix representation of the system
𝑥 − 2𝑦 + 𝑧 = 0
{
3𝑥 −𝑧 =1
is given by
𝑥
1 −2 1 0
( ) (𝑦) = ( ).
3 0 −1 𝑧 1
Page 65 of 114

Given a matrix representation of the system 𝑨𝒙 = 𝒃, we can define the


corresponding augmented matrix as
(𝑨 | 𝒃)
or
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑏1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑏
( ⋮ ⋮ ⋱ ⋮ | 2 ).

𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 𝑏𝑚

This matrix plays a crucial role in analyzing the solutions of a given system.
Page 66 of 114

Gaussian Elimination
Motivation
Suppose we would like to solve the following equations:
𝑥 + 𝑦 = 1 … … (1)
{
2𝑥 + 3𝑦 = 2 … … (2)
One can adopt the method of elimination by multiplying equation (1) by a factor of 2
and subtract from the equation (2):
𝑥+ 𝑦=1 𝑥+𝑦 =1
{ ⇒ { .
2𝑥 + 3𝑦 = 2 𝑦=0
One can obtain from last equation that 𝑦 = 0. Then one obtains 𝑥 = 1 using the
first equation.
Page 67 of 114

Consider another system of linear equations


𝑥+ 𝑦+ 𝑧= 4
{2𝑥 − 4𝑦 + 𝑧 = −5.
3𝑥 − 4𝑦 + 5𝑧 = 0
One can use the same method to solve the system. There are a lot ways of doing this:
(Approach 1: Eliminate 𝑧 first)
𝑥+ 𝑦+ 𝑧= 4 𝑥+ 𝑦+𝑧 = 4 𝑥+ 𝑦+𝑧 = 4 𝑦=2
{2𝑥 − 4𝑦 + 𝑧 = −5 ⇒ { 𝑥 − 5𝑦 = −9 ⇒ {𝑥 − 5𝑦 = −9 ⇒ {𝑥 = 1
3𝑥 − 4𝑦 + 5𝑧 = 0 −2𝑥 − 9𝑦 = −20 −19𝑦 = −38 𝑧=1
(Approach 2: Eliminate 𝑦 first)
𝑥+𝑦+ 𝑧 = 4
𝑥+ 𝑦+ 𝑧= 4 𝑥+𝑦+ 𝑧 = 4 𝑧=1
6𝑥 + 5𝑧 = 11
{2𝑥 − 4𝑦 + 𝑧 = −5 ⇒ {6𝑥 + 5𝑧 = 11 ⇒ { 19 19 ⇒ {
𝑥 = 1.
3𝑥 − 4𝑦 + 5𝑧 = 0 7𝑥 + 9𝑧 = 16 𝑧= 𝑦=2
6 6
Page 68 of 114

When we encounter a bigger system (more unknown and more equations) or


“irregular” system (infinite many solutions or no solution), we need a more
systematic elimination procedure so that the solution of a system can be obtained
easily.
Step 1: Eliminate 𝑥 (first variable) in the 2nd and 3rd equation
𝑥 + 𝑦 + 𝑧 = 4 (2)−2×(1) 𝑥 + 𝑦 + 𝑧 = 4
(3)−3×(1)
{2𝑥 − 4𝑦 + 𝑧 = −5 → { −6𝑦 − 𝑧 = −13
3𝑥 − 4𝑦 + 5𝑧 = 0 −7𝑦 + 2𝑧 = −12
Step 2: Eliminate 𝑦 (second variable) in the 3rd equation
𝑥+ 𝑦+ 𝑧= 4 6×(3)
𝑥+ 𝑦+ 𝑧= 4 (3)−7×(2) 𝑥 + 𝑦 + 𝑧 = 4
{ −6𝑦 − 𝑧 = −13 → { −6𝑦 − 𝑧 = −13 → { −6𝑦 − 𝑧 = −13 .
−7𝑦 + 2𝑧 = −12 −42𝑦 + 12𝑧 = −72 19𝑧 = 19
Then we can solve backward and obtain 𝑧 = 1, 𝑦 = 2 and 𝑥 = 1.
Such process is called Gaussian Elimination Method.
Page 69 of 114

Roughly speaking, Gaussian Elimination is a solution technique which uses the


method of elimination (also called elementary transformation or elementary row
operation) and transforms a given system into a specific form (known as row echelon
form in matrix form) which is easy to obtain, i.e.
′ ′ ′
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1 𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1′
′ ′
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2′
{ ⇒ {
⋮ ⋮
𝑎𝑚1 𝑥1 + 𝑎𝑚2 𝑥2 + ⋯ + 𝑎𝑚𝑛 𝑥𝑛 = 𝑏𝑚 ′
𝑎𝑚𝑛 𝑥𝑛 = 𝑏𝑚
or in augmented form
′ ′ ′ ′ ′
𝑎11 𝑎12 𝑎13 ⋯ 𝑎1,𝑛−1 𝑎1𝑛 𝑏1′
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑏1 ′ ′ ′ ′
𝑎21 𝑎22 ⋯ 𝑎2𝑛 0 𝑎22 𝑎23 ⋯ 𝑎2,𝑛−1 𝑎2𝑛 𝑏2′
𝑏2 | ′
( ⋮ | )⇒ 0 ′ ′ ′ .
⋮ ⋱ ⋮ ⋮ 0 𝑎33 ⋯ 𝑎3,𝑛−1 𝑎3𝑛 | 𝑏3
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 𝑏𝑚 ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮

( 0 0 0 ⋯ 0 ′
𝑎𝑚𝑛 𝑏𝑚 )
Page 70 of 114

Definition (Row Echelon Form & Reduced Row Echelon Form)


A (augmented) matrix representation of the row echelon form has the following two
properties:

𝑎 ∗ ∗ ∗ ∗ ∗ ∗ ∗
0 𝑏 ∗ ∗ ∗ ∗ ∗ ∗
All entries below each pivot 0 0 0 𝑐 ∗ ∗ ∗ ∗
(the first non-zero entry of 0 0 0 0 0 𝑑 ∗ ∗
each row) are all zero.
(0 0 0 0 0 0 𝑒 ∗)

Each pivot lies to the right of the


pivot in the row above.

Remark:
The number of pivots is also called the rank of the matrix.
Page 71 of 114

As an example, we suppose that the augmented matrix of a linear system is


transformed into echelon form as follows:
2 6 1 1
(0 3 −1 |2).
0 0 1 3
It is equivalent to the following linear system of equations
2𝑥 + 6𝑦 + 𝑧 = 1
{ 3𝑦 − 𝑧 = 2 .
𝑧=3
5
One can solve the equation backwards and get 𝑧 = 3, 𝑦 = and 𝑥 = −6.
3

The matrix is of reduced row echelon form if it is in row echelon form, the pivot is 1 in
each non-zero row and all entries above each pivot are all zero.
Remark:
The reduced row echelon form of a matrix is unique.
Page 72 of 114

Some Notions: Elementary transformation & elementary row operations


Roughly speaking, elementary transformations are simply the operations that we
carried out in solving the system. The corresponding action in augmented matrix
form is called elementary row operations.
Elementary Transformation Elementary Row Operation

(1) Interchange two equations (1) Interchange two rows


2𝑥 − 𝑦 = 2 (1)↔(2) 𝑥 + 𝑦 = 1 2 −1 2 𝑅1 ↔𝑅2 1 1 1
{ → { ( | ) → ( | )
𝑥+𝑦 =1 2𝑥 − 𝑦 = 2 1 1 1 2 −1 2

(2) Multiply an equation by 𝒄 ≠ 𝟎 (2) Multiply a row by 𝒄 ≠ 𝟎


2𝑥 − 𝑦 = 2 2×(2) 2𝑥 − 𝑦 = 2 2 −1 2 2𝑅2 2 −1 2
{ → { . ( | ) → ( | )
𝑥+𝑦 =1 2𝑥 + 2𝑦 = 2 1 1 1 2 2 2

(3) Addition of a scalar multiple of any (3) Addition of a scalar multiple of any
equation to another equation. row to another row.
2𝑥 − 𝑦 = 2 (2)+(1) 2𝑥 − 𝑦 = 2 2 −1 2 𝑅2 +𝑅1 2 −1 2
e. g. {
𝑥+𝑦=1
→ { . (
1 1
| ) →
1
(
3 0
| )
3
3𝑥 =3
.
Page 73 of 114

Example 36
Using Gaussian elimination, solve the following system of linear equations
𝑥 + 2𝑦 − 4𝑧 = −4
{ 5𝑥 − 3𝑦 − 7𝑧 = 6 .
3𝑥 − 2𝑦 + 3𝑧 = 11
Solution:
We first express the system in augmented form
1 2 −4 −4
(5 −3 −7 | 6 )
3 −2 3 11

We perform the Gaussian Elimination as follows:


Page 74 of 114

Standard Form Augmented Matrix Form

𝑥 + 2𝑦 − 4𝑧 = −4 1 2 −4 −4
{ 5𝑥 − 3𝑦 − 7𝑧 = 6 (5 −3 −7 | 6 )
3𝑥 − 2𝑦 + 3𝑧 = 11 3 −2 3 11
𝑅2 −5𝑅1
(2)−5×(1)
𝑥 + 2𝑦 − 4𝑧 = −4 𝑅3 −3𝑅1
1 2 −4 −4
(3)−3×(1) → (0 −13 13 | 26 )
→ { −13𝑦 + 13𝑧 = 26
−8𝑦 + 15𝑧 = 23 0 −8 15 23
1 2 −4 −4
𝑥 + 2𝑦 − 4𝑧 = −4 𝑅2 / −13
(2)÷−13 → (0 1 −1 |−2)
→ { 𝑦 − 𝑧 = −2
0 −8 15 23
−8𝑦 + 15𝑧 = 23
𝑅3 +8𝑅2 1 2 −4 −4
(3)+8×(2) 𝑥 + 2𝑦 − 4𝑧 = −4 → (0 1 −1 |−2)
→ { 𝑦 − 𝑧 = −2 0 0 7 7
7𝑧 = 7

By solving backward, we get 𝑧 = 1, 𝑦 = −1, 𝑥 = 2.


Page 75 of 114

Example 37
4𝑦 − 𝑧 = 5
Solve {2𝑥 + 𝑦 + 3𝑧 = 13 using Gaussian Elimination.
𝑥 − 2𝑦 + 2𝑧 = 3
Solution
0 4 −1 5
We first express the system in augmented form: (2 1 3 |13)
1 −2 2 3
We perform the Gaussian Elimination as follows:
Standard Form Augmented Matrix Form
4𝑦 − 𝑧 = 5 0 4 −1 5
{2𝑥 + 𝑦 + 3𝑧 = 13 (2 1 3 |13)
𝑥 − 2𝑦 + 2𝑧 = 3 1 −2 2 3
𝑥 − 2𝑦 + 2𝑧 = 3 𝑅1 ↔𝑅3 1 −2 2 3
(1)↔(3)
→ {2𝑥 + 𝑦 + 3𝑧 = 13 → (2 1 3 |13)
4𝑦 − 𝑧 = 5 0 4 −1 5
Page 76 of 114

(2)−2×(1)
𝑥 − 2𝑦 + 2𝑧 = 3 𝑅2 −2𝑅1 1 −2 2 3
→ { 5𝑦 − 𝑧 = 7 → (0 5 −1 |7)
4𝑦 − 𝑧 = 5 0 4 −1 5
𝑥 − 2𝑦 + 2𝑧 = 3 1 −2 2 3
(2)÷5 1 7
𝑅2 /5 1 7
→ { 𝑦− 𝑧= → (0 1 − | )
5 5 5 5
4𝑦 − 𝑧 = 5 0 4 −1 5
1 −2 2 3
𝑥 − 2𝑦 + 2𝑧 = 3 1 7
1 7 𝑅3 −4𝑅2 0 1 −
(3)−4×(2) 𝑦− 𝑧= → 5 || 5
→ 5 5 1 3
1 3 0 0 − −
− 𝑧=− ( 5 5)
{ 5 5

By solving backward, we get 𝑧 = 3, 𝑦 = 2, 𝑥 = 1.


Page 77 of 114

Example 38 (The system has infinitely many solutions)


𝑥 + 𝑦 − 2𝑧 = 2
Solve { .
2𝑥 + 2𝑦 − 3𝑧 = 1
Solution
1 1 −2 2
The augmented matrix is given by ( | ).
2 2 −3 1
Using Gaussian Elimination, we have
1 1 −2 2 𝑅2−2𝑅1 1 1 −2 2
( | )→ ( | )
2 2 −3 1 0 0 1 −3
Solving backward, we get 𝑧 = −3 and 𝑥 + 𝑦 − 2𝑧 = 2 ⇒ 𝑥 + 𝑦 = −4.
We only have one equation governing 𝑥 and 𝑦. So there are infinite many solutions
of the system and the general solution is given by
𝑥 = −4 − 𝑡, 𝑦 = 𝑡, 𝑡 is any real number.
Page 78 of 114

In Example 38, there is a column with no pivot (column 2) in the echelon form.
1 1 −2 2
( | )
0 0 1 −3
We observe that the corresponding variable 𝑦 can take any values, 𝑦 is also called
“free variable”.
In general, if there is column which does not have any pivots, then the corresponding
unknown will be the free variable (if the system is consistent). Hence, the system has
infinite number of solutions.
As an example, if the echelon form of the system is
1 3 4 1 2 1 𝑥1 + 3𝑥2 + 4𝑥3 + 𝑥4 + 2𝑥5 = 1
(0 0 1 2 3 |2) or { 𝑥3 + 2𝑥4 + 3𝑥5 = 2.
0 0 0 0 3 3 3𝑥5 = 3
So 𝑥2 , 𝑥4 are the “free variables” and the general solution is given by
𝑥5 = 1, 𝑥4 = 𝑡, 𝑥3 = −1 − 2𝑡, 𝑥2 = 𝑠, 𝑥1 = 3 − 3𝑠 + 7𝑡.
Page 79 of 114

Example 39 (The system has no solutions)


Solve the following system
𝑥 − 2𝑦 + 3𝑧 = 2
{2𝑥 + 3𝑦 − 2𝑧 = 5.
4𝑥 − 𝑦 + 4𝑧 = 1
Solution:
1 −2 3 2
The augmented matrix is (2 3 −2 |5). Then using Gaussian elimination, we
4 −1 4 1
have
1 −2 3 2 𝑅𝑅2−2𝑅
−4𝑅
1 1 −2 3 2 𝑅3−𝑅2 1 −2 3 2
3 1
(2 3 −2 |5) → (0 7 −8 | 1 ) → (0 7 −8 | 1 ).
4 −1 4 1 0 7 −8 −7 0 0 0 −8
Since the last row is of the type (0 0 0 | 𝑏) with 𝑏 = −8 ≠ 0, hence the system has
no solution.
Page 80 of 114

Solution of System of Linear Equations: A brief summary


Given a system of linear equations, one can adopt the Gaussian Elimination to
transform the system into Row Echelon form. The solution of the system can be
studied easily by investigating the row echelon form of the system.

Case 1: There is a row with (0 0 ⋯ 0 |𝑏) (where 𝑏 ≠ 0) in the


echelon form of the augmented matrix:

 This row corresponds to the equation:


0𝑥1 + 0𝑥2 + ⋯ + 0𝑥𝑛 = 𝑏 ⇒ 0 = 𝑏.
 Since 𝑏 ≠ 0, this implies the system has no solutions (or inconsistent).
If case 1 does not happen, then the system has solution (consistent). It remains to
check whether the system has unique solution or infinitely many solutions. To check
this, we check whether there is column with no pivots.
Page 81 of 114

Case 2A: There is a column with no pivot:

 The corresponding variables in such columns (with no pivot) are “free variables”
(see Example 38).
 The system has infinitely many solutions.
Case 2B: There are no columns with no pivot:

 There is no free variables and the echelon form of augmented matrix is given
below
𝑎 ∗ ∗ ∗ ∗
0 𝑏 ∗ ∗ ∗
( | )
0 0 𝑐 ∗ ∗
0 0 0 𝑑 ∗
 Every unknown is determined uniquely by solving backward.
 The system has a unique solution.
Page 82 of 114

Row Echelon Form of augmented matrix

There is a row with There is no rows with


(0 0 … 0|𝑏) and 𝑏 ≠ 0 (0 0 … 0|𝑏) and 𝑏 ≠ 0

The system has solutions


The system has no solution
(consistent)

There is no column There is a column


with no pivot with no pivot

The system has a The system has infinitely


unique solution many solutions
Page 83 of 114

Example 40
Solve the following system
𝑥1 + 2𝑥2 − 3𝑥3 + 𝑥5 = 2
{ 2𝑥1 + 4𝑥2 + 𝑥4 − 2𝑥5 = 3 .
3𝑥1 + 6𝑥2 + 5𝑥3 + 𝑥4 − 𝑥5 = 1
Solution
1 2 −3 0 1 2
The corresponding augmented matrix is (2 4 0 1 −2 |3). Using Gaussian
3 6 5 1 −1 1
Elimination, we reduce the system into row echelon form:
1 2 −3 0 1 2 𝑅𝑅2−2𝑅
−3𝑅
1 1 2 −3 0 1 2
3 1
(2 4 0 1 −2 |3) → (0 0 6 1 −4 |−1)
3 6 5 1 −1 1 0 0 14 1 −4 −5
1 2 −3 0 1 2
1 2 −3 0 1 2 1 4 1
𝑅2 /6 1 4 1 𝑅 −14𝑅 0 0 1 − −
6 || 6 .
3 2
→ (0 0 1 − |− ) → 6
6 6 6 8 32 16
0 0 14 1 −4 −5 0 0 0 − −
( 6 6 6)
Page 84 of 114

Since there are columns (2nd column and 5th column) with no pivot, the system should
have infinitely many solutions.
The corresponding unknowns 𝑥2 and 𝑥5 will be free variables. We take 𝑥2 = 𝑠
and 𝑥5 = 𝑡, where 𝑠, 𝑡 are real numbers. The corresponding system is
𝑥1 + 2𝑥2 − 3𝑥3 + 𝑥5 = 2
1 4 1
𝑥3 + 𝑥4 − 𝑥5 = −
6 6 6.
8 32 16
{ − 𝑥4 + 𝑥5 = −
6 6 6
1 1
Solving the equations backwards, we obtain 𝑥4 = 2 + 4𝑡, 𝑥3 = − , 𝑥1 = − 2𝑠 − 𝑡
2 2
and the general solution vector becomes:
1
𝑥1 2 −2 −1
𝑥2 0 1 0
𝒙 = 𝑥3 = −
1 +𝑠 0 +𝑡 0 .
𝑥4 2 0 4
2
(𝑥5 ) (
⏟0 )
⏟( 0 ) (1)
general solution of the
particular
homogeneous system
solution
Page 85 of 114

1
2
0
Note that 𝒙𝒑 = − 1 is a particular solution of the nonhomogeneous system (𝑠 =
2
2
(0)
𝑡 = 0), so that 𝑨(𝒙 − 𝒙𝒑 ) = 𝒃 − 𝒃 = 𝟎 and 𝒙 − 𝒙𝒑 is the general solution of the
corresponding homogeneous system:
𝑥1 + 2𝑥2 − 3𝑥3 + 𝑥5 = 0
{ 2𝑥1 + 4𝑥2 + 𝑥4 − 2𝑥5 = 0 .
3𝑥1 + 6𝑥2 + 5𝑥3 + 𝑥4 − 𝑥5 = 0
−2 −1
1 0
Thus 0 and 0 are two linearly independent solutions of the above
0 4
(0) (1)
homogeneous system.
Page 86 of 114

Example 41
Find all values of 𝑐 for which the following system is consistent.
𝑥 + 2𝑦 − 𝑧 = 𝑐
{ −𝑥 + 4𝑦 + 𝑧 = 𝑐 2
𝑥 + 8𝑦 − 𝑧 = 𝑐 3
Solution:
1 2 −1 𝑐
To start with, we first transform the augmented matrix (−1 4 1 |𝑐 2 ) into
1 8 −1 𝑐 3
echelon form using Gaussian Elimination.
1 2 −1 𝑐 𝑅2+𝑅1 1 2 −1 𝑐
𝑅 3 −𝑅1
(−1 4 1 |𝑐 2 ) → (0 6 0 |𝑐 2 + 𝑐 )
1 8 −1 𝑐 3 0 6 0 𝑐3 − 𝑐
𝑅3 −𝑅2 1 2 −1
𝑐
→ (0 6 0 | 𝑐 2 + 𝑐 ).
0 0 0 𝑐 3 − 𝑐 2 − 2𝑐
Page 87 of 114

The system is consistent if there is no row with (0 0 0|𝑏), 𝑏 ≠ 0. This implies that
𝑐 3 − 𝑐 2 − 2𝑐 = 0 ⇔ 𝑐 (𝑐 2 − 𝑐 − 2) = 0 ⇔ 𝑐 (𝑐 − 2)(𝑐 + 1) = 0
⇒ 𝑐 = 0 or 𝑐 = 2 or 𝑐 = −1.
Remark: Since the column 3 has no pivot, the system has infinitely many solutions
(with 𝑧 as the free variable) if the system is consistent.
Example 42
We consider the following system of linear equations
𝑥 − 2𝑦 + 𝑧 = 1
{𝑥 − 𝑦 + 2𝑧 = 2.
𝑦 + 𝑐2𝑧 = 𝑐
Determine all values of 𝑐 for each of the following cases:
(a) The system has unique solution.
(b) The system has no solution.
(c) The system has infinitely many solutions.
Page 88 of 114

Solution:
1 −2 1 1
The corresponding augmented matrix is given by (1 −1 2 |2). We first
0 1 𝑐2 𝑐
reduce the system into row echelon form using Gaussian Elimination.
1 −2 1 1 𝑅2−𝑅1 1 −2 1 1 𝑅3−𝑅2 1 −2 1 1
(1 −1 2 |2) → (0 1 1 |1) → (0 1 1 | 1 )
0 1 𝑐2 𝑐 0 1 𝑐2 𝑐 0 0 𝑐2 − 1 𝑐 − 1
(a) The system has a unique solution only when there is no column with no pivot.
This implies 𝑐 2 − 1 ≠ 0 ⇒ 𝑐 ≠ ±1.

(b) The system has no solutions only when there is a row of the type (0 0 0|𝑏)
with 𝑏 ≠ 0. This implies 𝑐 2 − 1 = 0 and 𝑐 − 1 ≠ 0.
So we get 𝑐 = −1.

(c) Finally, the system has infinitely many solutions only when (i) there is a column
with no pivot and (ii) no row with (0 0 0|𝑏), 𝑏 ≠ 0. These imply 𝑐 2 − 1 = 0
and 𝑐 − 1 = 0. So we get 𝑐 = 1.
Page 89 of 114

Cramer’s Rule
This method provides an alternative to find the solution of a linear system when the
number of equations equal to number of unknowns.
We consider the system of linear equations with 𝑛 equations and 𝑛 unknowns,
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎 𝑥 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
{ 21 1 … (∗)

𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
In matrix form, we have 𝑨𝒙 = 𝒃.
The coefficient matrix 𝑨 is now a 𝑛 × 𝑛 square matrix.
If det 𝑨 ≠ 0, then 𝑨 is invertible (non-singular) and 𝑨−1 exists.
Then one can obtain the solution vector 𝒙 by multiplying both sides by 𝑨−1 , i.e.
𝑨−1 𝑨𝒙 = 𝑨−1 𝒃 ⇒ 𝒙 = 𝑨−𝟏 𝒃.
Using the formula of 𝑨−1 , we get
Page 90 of 114

𝐴11 𝐴12 ⋯ 𝐴1𝑛 𝑇 𝑏1 𝐴11 𝐴21 ⋯ 𝐴𝑛1 𝑏1


1 𝐴 𝐴22 ⋯ 𝐴2𝑛 𝑏2 1 𝐴 𝐴22 ⋯ 𝐴𝑛2 𝑏
𝒙= ( 21 ) ( ) = ( 12 ) ( 2)
det 𝑨 ⋮ ⋮ ⋱ ⋮ ⋮ det 𝑨 ⋮ ⋮ ⋱ ⋮ ⋮
𝐴𝑛1 𝐴𝑛2 ⋯ 𝐴𝑛𝑛 𝑏𝑛 𝐴1𝑛 𝐴2𝑛 ⋯ 𝐴𝑛𝑛 𝑏𝑛
𝐴11 𝑏1 + 𝐴21 𝑏2 + ⋯ + 𝐴𝑛1 𝑏𝑛
1 𝐴 𝑏 + 𝐴22 𝑏2 + ⋯ + 𝐴𝑛2 𝑏𝑛
= ( 12 1 )
det 𝑨 ⋮
𝐴1𝑛 𝑏1 + 𝐴2𝑛 𝑏2 + ⋯ + 𝐴𝑛𝑛 𝑏𝑛
where 𝐴𝑖𝑗 is the cofactor of the element 𝑎𝑖𝑗 .

Theorem (Cramer’s Rule)


Let 𝑨 be the coefficient matrix of the system of linear equations 𝑨𝒙 = 𝒃.
If det 𝑨 ≠ 0, then the system has a unique solution given by
𝐴1𝑖 𝑏1 + 𝐴2𝑖 𝑏2 + ⋯ + 𝐴𝑛𝑖 𝑏𝑛
𝑥𝑖 = , 𝑖 = 1, 2, … , 𝑛
det 𝑨
where 𝐴𝑖𝑗 is the cofactor of 𝑎𝑖𝑗 .
Page 91 of 114

Remark about Cramer’s Rule:


By the definition of determinant, one can express the numerator 𝐴1𝑖 𝑏1 + 𝐴2𝑖 𝑏2 +
⋯ + 𝐴𝑛𝑖 𝑏𝑛 as
𝑎11 ⋯ 𝑎1,𝑖−1 𝑏1 𝑎1,𝑖+1 ⋯ 𝑎𝑛1
𝑎21 ⋯ 𝑎2,𝑖−1 𝑏2 𝑎2,𝑖+1 ⋯ 𝑎𝑛2
𝐴1𝑖 𝑏1 + 𝐴2𝑖 𝑏2 + ⋯ + 𝐴𝑛𝑖 𝑏𝑛 = det ( )
⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
𝑎𝑛1 ⋯ 𝑎𝑛,𝑖−1 𝑏𝑛 𝑎𝑛,𝑖+1 ⋯ 𝑎𝑛𝑛
which is the determinant of the matrix obtained by replacing the elements in 𝑖 th
𝑏1
𝑏
column of matrix 𝑨 by the column vector ( 2 ).

𝑏𝑛
Page 92 of 114

Example 43
Solve the following system of linear equations by Cramer’s Rule
5𝑥 + 2𝑦 = 13
{ .
2𝑥 − 3𝑦 = 9
Solution:
5 2 13
Note that 𝑨 = ( ) and 𝒃 = ( ). Using Cramer’s rule, we have
2 −3 9
13 2
det ( ) 13 × (−3) − 9 × 2 −57
𝑥= 9 −3 = = = 3,
det 𝑨 5 × (−3) − 2 × 2 −19
5 13
det ( )
𝑦= 2 9 = 5 × 9 − 2 × 13 = 19 = −1.
det 𝑨 5 × (−3) − 2 × 2 −19
Page 93 of 114

Application of Gaussian Elimination #1 – Finding the inverse of matrix (Gauss Jordan


Method)
The method of Gaussian Elimination provides an alternative of finding the inverse of
an invertible matrix.
1 1 2
As an example, we would like to find the inverse of 𝑨 = (1 2 0). We let 𝑿 =
1 1 1
𝑥1 𝑦1 𝑧1
(𝑥2 𝑦2 𝑧2 ) be the inverse of 𝑨. According to the definition of inverse, 𝑿 must
𝑥3 𝑦3 𝑧3
satisfy
𝑨𝑿 = 𝑰𝟑 or
1 1 2 𝑥1 𝑦1 𝑧1 1 0 0
(1 2 0) (𝑥2 𝑦2 𝑧2 ) = (0 1 0).
1 1 1 𝑥3 𝑦3 𝑧3 0 0 1
Page 94 of 114

This system can be separated into three systems:


1 1 2 𝑥1 1 1 1 2 𝑦1 0 1 1 2 𝑧1 0
(1 2 0) (𝑥2 ) = (0) , (1 2 0) (𝑦2 ) = (1), (1 2 0) (𝑧2 ) = (0)
1 1 1 𝑥3 0 1 1 1 𝑦3 0 1 1 1 𝑧3 1
In augmented matrix form, we have
1 1 2 1 1 1 2 0 1 1 2 0
(1 2 0 |0) , (1 2 0 |1) , (1 2 0 |0).
1 1 1 0 1 1 1 0 1 1 1 1
We can apply Gaussian Elimination to solve each system above.
1 1 2
Since we handle the same coefficient matrix (1 2 0) for each system, it would
1 1 1
be easier if we put three augmented matrices into a single augmented matrix, i.e.
1 1 2 1 0 0
(1 2 0 |0 1 0).
1 1 1 0 0 1
Page 95 of 114

Using Gaussian Elimination, we get


1 1 2 1 0 0 𝑅𝑅2−𝑅 1 1 1 2 1 0 0
3 −𝑅1
(1 2 0 |0 1 0) → (0 1 −2 |−1 1 0)
1 1 1 0 0 1 0 0 −1 −1 0 1
−𝑅3 1 1 2 1 0 0
→ (0 1 −2 |−1 1 0 )
0 0 1 1 0 −1
𝑅1 −2𝑅3
𝑅2 +2𝑅3
1 1 0 −1 0 2
→ (0 1 0 | 1 1 −2)
0 0 1 1 0 −1
𝑅1 −𝑅2 1 0 0 −2 −1 4
→ (0 1 0 |1 1 −2) … … (∗∗)
0 0 1 1 0 −1
1 0 0 −2
Then (0 1 0 | 1 ) gives 𝑥1 = −2, 𝑥2 = 1, 𝑥3 = 1.
0 0 1 1
1 0 0 −1
(0 1 0 | 1 ) gives 𝑦1 = −1, 𝑦2 = 1, 𝑦3 = 0.
0 0 1 0
Page 96 of 114

1 0 0 4
(0 1 0 |−2) gives 𝑧1 = 4, 𝑧2 = −2, 𝑧3 = −1.
0 0 1 −1
So the inverse is given by
−2 −1 4
𝑿 = 𝑨−𝟏 =( 1 1 −2)
1 0 −1
which also equals the matrix on the R.H.S. of augmented matrix (∗∗).

General Procedure in finding the inverse of 𝑨 using Gaussian Elimination:


Step 1: We first write the augmented matrix

𝑎11 𝑎12 ⋯ 𝑎1𝑛 1 0 0 0


𝑎21 𝑎22 ⋯ 𝑎2𝑛 |0 1 0 0
⋮ ⋮ ⋱ ⋮ |⋮ ⋮ ⋱ ⋮
𝑎
⏟𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 ⏟
0 0 0 1
( 𝑨 𝑰𝒏 )
Page 97 of 114

Step 2: Use elementary row operations to transform the matrix into row echelon
form
1 ∗ ⋯ ∗ ∗ ∗ ∗ ∗
0 1 ⋯ ∗ ∗ ∗ ∗ ∗
( | ).
⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
0 0 ⋯ 1 ∗ ∗ ∗ ∗
Step 3: Finally, we use elementary row operations to transform the augmented
matrix into the form which the matrix on the L.H.S. is an identity matrix 𝐼𝑛 .
Then the matrix on the R.H.S. will be the inverse 𝑨−𝟏 .

1 0 ⋯ 0 ∗ ∗ ∗ ∗
0 1 ⋯ 0 |∗ ∗ ∗ ∗
⋮ ⋮ ⋱ ⋮ |⋮ ⋮ ⋱ ⋮

0 0 ⋯ 1 ∗⏟ ∗ ∗ ∗
( 𝑰𝑛 𝑨−𝟏 )
This method is called Gauss Jordan Method.
Page 98 of 114

Example 44
Find the inverse of the matrix
3 2 6
𝑨 = (1 1 2).
2 2 5
Solution
We first write down the augmented matrix
3 2 6 1 0 0
(1 1 2 |0 1 0)
2 2 5 0 0 1
Using elementary row operations, we have
3 2 6 1 0 0 𝑅1↔𝑅2 1 1 2 0 1 0
(1 1 2 | 0 1 0) → (3 2 6 |1 0 0)
2 2 5 0 0 1 2 2 5 0 0 1
𝑅2 −3𝑅1
𝑅3 −2𝑅1
1 1 2 0 1 0
→ (0 −1 0 |1 −3 0)
0 0 1 0 −2 1
Page 99 of 114

−𝑅2 1 1 2 0 1 0
→ (0 1 0 |−1 3 0)
0 0 1 0 −2 1
𝑅1 −2𝑅3 1 1 0 0 5 −2
→ (0 1 0 |−1 3 0)
0 0 1 0 −2 1
𝑅1 −𝑅2 1 0 0 1 2 −2
→ (0 1 0 |−1 3 0 ).
0 0 1 0 −2 1
Since the L.H.S. becomes an identity matrix, therefore the inverse of 𝑨 is given by
1 2 −2
𝑨−𝟏 = (−1 3 0 ).
0 −2 1
Page 100 of 114

Example 45
Find the inverse of the matrix
1 −2 0 0
2 −3 3 1
𝐵=( )
0 1 2 −2
−1 1 1 3
Solution:
1 −2 0 0 1 0 0 0 𝑅2−2𝑅1 1 −2 0 0 1 0 0 0
2 −3 3 1 0 1 0 0 𝑅4+𝑅1 0 1 3 1 −2 1 0 0
( | )→ ( | )
0 1 2 −2 0 0 1 0 0 1 2 −2 0 0 1 0
−1 1 1 3 0 0 0 1 0 −1 1 3 1 0 0 1
𝑅3 −𝑅2 1 −2 0 0 1 0 0 0
𝑅4 +𝑅2 0 1 3 1 −2 1 0 0
→ ( | )
0 0 −1 −3 2 −1 1 0
0 0 4 4 −1 1 0 1
Page 101 of 114

1 −2 0 0 1 0 0 0
𝑅4 +4𝑅3 0 1 3 1 −2 1 0 0
→ ( | )
0 0 −1 −3 2 −1 1 0
0 0 0 −8 7 −3 4 1
−𝑅3 1 −2 0 0 1 0 0 0
𝑅4 /(−8) 0 1 3 1 −2 1 0 0
→ ( | )
0 0 1 3 −2 1 −1 0
0 0 0 1 −7/8 3/8 −1/2 −1/8
𝑅2 −𝑅4 1 −2 0 0 1 0 0 0
𝑅3 −3𝑅4 0 1 3 0 −9/8 5/8 1/2 1/8
→ ( | )
0 0 1 0 5/8 −1/8 1/2 3/8
0 0 0 1 −7/8 3/8 −1/2 −1/8
1 −2 0 0 1 0 0 0
𝑅2 −3𝑅3 0 1 0 0 −3 1 −1 −1
→ ( | )
0 0 1 0 5/8 −1/8 1/2 3/8
0 0 0 1 −7/8 3/8 −1/2 −1/8
Page 102 of 114

1 0 0 0 −5 2 −2 −2
𝑅1 +2𝑅2 0 1 0 0 −3 1 −1 −1
→ ( | ).
0 0 1 0 5/8 −1/8 1/2 3/8
0 0 0 1 −7/8 3/8 −1/2 −1/8
Thus the inverse of the matrix 𝐵 is found to be
−5 2 −2 −2
−3 1 −1 −1
𝐵−1 =( ).
5/8 −1/8 1/2 3/8
−7/8 3/8 −1/2 −1/8
Remark:
Comparing with the cofactor method that we used in previous section, Gauss-Jordan
method provides a simpler way in finding the inverse of matrices with larger size. If
one wishes to compute 𝐵−1 using cofactor method in the previous example, one
needs to compute 16 cofactors (determinant of 3 × 3 sub-matrices) in order to
obtain the answer!
Page 103 of 114

Example 46 (Gauss-Jordan Method on non-invertible matrix)


1 2
Find the inverse of ( )
2 4
Solution:
Note that
𝑅2 −2𝑅1
1 2 1 0 1 2 1 0
( | ) ~
⏞ ( | )
2 4 0 1 0 0 −2 1
We see that the last row is of the form (0 0|𝑏1 𝑏2 ), 𝑏1 , 𝑏2 ≠ 0. There is no solution
for the system.
Hence the inverse does not exist!
Page 104 of 114

Application of Gauss Elimination #2: Checking the Linear Independency of vectors


One can use the following fact to check the linear independency of vectors:

Theorem (General procedure of checking linear independency)


The vectors 𝑎⃗⃗⃗⃗⃗,
1 𝑎⃗⃗⃗⃗⃗,
2 ⋯ , ⃗⃗⃗⃗⃗𝑎𝑛 are linearly independent if and only if the
equation 𝑥1 𝑎
⃗⃗⃗⃗⃗1 + 𝑥2 𝑎 𝑎𝑛 = ⃗0⃗ has only trivial solution (i.e. 𝑥1 =
⃗⃗⃗⃗⃗2 + ⋯ + 𝑥𝑛 ⃗⃗⃗⃗⃗
𝑥2 = ⋯ = 𝑥𝑛 = 0).

On the other hand, if the equation 𝑥1 𝑎 ⃗⃗⃗⃗⃗1 + 𝑥2 𝑎 𝑎𝑛 = ⃗0⃗ has other


⃗⃗⃗⃗⃗2 + ⋯ + 𝑥𝑛 ⃗⃗⃗⃗⃗
solutions 𝑥1 , 𝑥2 , … , 𝑥𝑛 (other than the trivial solution). Then the vectors
𝑎
⃗⃗⃗⃗⃗,
1 ⃗⃗⃗⃗⃗⃗,
𝑎2 ⋯ , ⃗⃗⃗⃗⃗
𝑎𝑛 are linearly dependent.

One can use the Gaussian Elimination to solve the equation 𝑥1 𝑎


⃗⃗⃗⃗⃗1 + 𝑥2 𝑎
⃗⃗⃗⃗⃗2 + ⋯ +
𝑎𝑛 = ⃗0⃗.
𝑥𝑛 ⃗⃗⃗⃗⃗
Page 105 of 114

Example 47

Let 𝑎⃗ = 3𝑖⃗ + 2𝑗⃗, 𝑏⃗⃗ = 𝑖⃗ − 𝑘⃗⃗ and 𝑐⃗ = 2𝑖⃗ + 3𝑗⃗ + 4𝑘⃗⃗ be three vectors, determine
whether these three vectors are linearly independent.
Solution:
We need to solve the following equation for 𝑥1 , 𝑥2 , 𝑥3 .
𝑥1 𝑎⃗ + 𝑥2 𝑏⃗⃗ + 𝑥3 𝑐⃗ = ⃗0⃗
⇒ (3𝑥1 + 𝑥2 + 2𝑥3 )𝑖⃗ + (2𝑥1 + 3𝑥3 )𝑗⃗ + (−𝑥2 + 4𝑥3 )𝑘⃗⃗ = 0𝑖⃗ + 0𝑗⃗ + 0𝑘⃗⃗

By comparing the coefficients, we get


3𝑥1 + 𝑥2 + 2𝑥3 = 0
{2𝑥1 + 3𝑥3 = 0.
−𝑥2 + 4𝑥3 = 0
Page 106 of 114

Using Gaussian Elimination, we get


3 1 2 0 𝑅3/3 1 1/3 2/3 0 𝑅2−2𝑅1 1 1/3 2/3 0
(2 0 3 |0) → (2 0 3 |0) → (0 −2/3 5/3 |0)
0 −1 4 0 0 −1 4 0 0 −1 4 0
2
𝑅2 /(− ) 1 1/3 2/3 0 𝑅3+𝑅2 𝑅3+𝑅2 1 1/3 2/3 0
3
→ (0 1 −5/2 |0) ~ ⏞ → (0 1 −5/2 |0)
0 −1 4 0 0 0 3/2 0
The corresponding system is
1 2
𝑥1 + 𝑥2 + 𝑥3 = 0
3 3
5
𝑥2 − 𝑥3 = 0 ⇒ 𝑥3 = 0, 𝑥2 = 0, 𝑥1 = 0.
2
3
{ 𝑥 =0
2 3
Since the system has only trivial solution, the vectors are linearly independent.
Page 107 of 114

Example 48

Determine if the vectors 𝑎⃗ = 𝑖⃗ + 5𝑗⃗ − 2𝑘⃗⃗, 𝑏⃗⃗ = 𝑖⃗ − 𝑘⃗⃗, 𝑐⃗ = −2𝑖⃗ + 10𝑗⃗ are linearly
independent.
Solution:
We consider the following equations:

𝑥1 𝑎⃗ + 𝑥2 𝑏⃗⃗ + 𝑥3 𝑐⃗ = ⃗0⃗

⇒ (𝑥1 + 𝑥2 − 2𝑥3 )𝑖⃗ + (5𝑥1 + 10𝑥3 )𝑗⃗ + (−2𝑥1 − 𝑥2 )𝑘⃗⃗ = ⃗0⃗


𝑥1 + 𝑥2 − 2𝑥3 = 0
⇒ { 5𝑥1 + 10𝑥3 = 0
−2𝑥1 − 𝑥2 =0
Page 108 of 114

Using Gaussian Elimination, we have


1 1 −2 0 𝑅𝑅2−5𝑅
+2𝑅
1 1 1 −2 0 𝑅2/(−5) 1 1 −2 0
3 1
(5 0 10 |0) → (0 −5 20 |0) → (0 1 −4 |0)
−2 −1 0 0 0 1 −4 0 0 1 −4 0
𝑅3 −𝑅2 1 1 −2 0
→ (0 1 −4 |0)
0 0 0 0
Since the 3rd column does not have any pivot, the corresponding variable 𝑥3 is a
free variable, we take 𝑥3 = 𝑡, 𝑡 is real. Then we have 𝑥2 = 4𝑡 and 𝑥1 = −2𝑡.

Since the equation 𝑥1 𝑎⃗ + 𝑥2 𝑏⃗⃗ + 𝑥3 𝑐⃗ = ⃗0⃗ has non-trivial solution (say when 𝑡 = 1,
we have 𝑥1 = −2, 𝑥2 = 4 and 𝑥3 = 1). Thus the vectors 𝑎⃗, ⃗⃗⃗ 𝑏 and 𝑐⃗ are linearly
dependent.
Page 109 of 114

Example 49
1 1 −3
2 1 0
Let 𝑎⃗ = ( ), 𝑏⃗⃗ = ( ), 𝑐⃗ = ( ) be three vectors in 4-D space. Determine if
0 1 1
−3 1 0
the vectors are linearly independent.
Solution
We consider the following equations:
1 1 −3 0
2 1 0 0
𝑥1 𝑎⃗ + 𝑥2 𝑏⃗⃗ + 𝑥3 𝑐⃗ = ⃗0⃗ ⇒ 𝑥1 ( ) + 𝑥2 ( ) + 𝑥3 ( ) = ( )
0 1 1 0
−3 1 0 0
𝑥1 + 𝑥2 − 3𝑥3 0 𝑥1 + 𝑥2 − 3𝑥3 = 0
2𝑥1 + 𝑥2 0 2𝑥1 + 𝑥2 =0
⇒( )=( )⇒{
𝑥2 + 𝑥3 0 𝑥2 + 𝑥3 = 0
−3𝑥1 + 𝑥2 0 −3𝑥1 + 𝑥2 =0
Page 110 of 114

Using Gaussian Elimination, we get


1 1 −3 0 𝑅2−2𝑅1 1 1 −3 0 𝑅3+𝑅2 1 1 −3 0
2 1 0 0 𝑅4+3𝑅1 0 −1 6 0 𝑅4+4𝑅2 0 −1 6 0
( | )→ ( | )→ ( | )
0 1 1 0 0 1 1 0 0 0 7 0
−3 1 0 0 0 4 −9 0 0 0 15 0
1 1 −3 0 1 1 −3 0
𝑅3 /7 0 −1 6 0 𝑅4−15𝑅3 0 −1 6 0
→ ( | )→ ( | )
0 0 1 0 0 0 1 0
0 0 15 0 0 0 0 0
𝑥1 + 𝑥2 − 3𝑥3 = 0
The corresponding system is { − 𝑥2 + 6𝑥3 = 0 . Solving the equations backward,
𝑥3 = 0
we get 𝑥3 = 0, 𝑥2 = 0 and 𝑥1 = 0.
Since the system has only trivial solution, the vectors are linearly independent.
Page 111 of 114

Review Example 1
Solve the following system
2𝑥 + 𝑦 − 3𝑧 = 8
{ 5𝑥 + 3𝑦 + 𝑧 = 12 .
3𝑥 − 2𝑦 + 5𝑧 = −1
Solution: Using Gaussian Elimination, we have
2 1 −3 8 𝑅1/2 1 1/2 −3/2 4
(5 3 1 | 12 ) → (5 3 1 | 12 )
3 −2 5 −1 3 −2 5 −1
𝑅2 −5𝑅1 1 1/2 −3/2
𝑅3 −3𝑅1
4 𝑅3+7𝑅2 1 1/2 −3/2 4
→ (0 1/2 17/2 | −8 ) → (0 1/2 17/2 | −8 )
0 −7/2 19/2 −13 0 0 69 −69
1 17
Solving backward, we get 69𝑧 = −69 ⇒ 𝑧 = −1; 𝑦+ 𝑧 = −8 ⇒ 𝑦 = 1; 𝑥 +
2 2
1 3
𝑦 − 𝑧 = 4 ⇒ 𝑥 = 2.
2 2
Page 112 of 114

Review Example 2
Solve the system
𝑥− 𝑦− 𝑧+ 𝑤=1
{ 3𝑥 + 2𝑦 − 𝑤 = 0.
−𝑥 − 9𝑦 − 5𝑧 + 7𝑤 = 5
Solution:
Using the Gaussian Elimination method again, we get
1 −1 −1 1 1 𝑅𝑅2−3𝑅 1 1 −1 −1 1 1
3 +𝑅1
(3 2 0 −1| 0) → (0 5 3 −4| −3)
−1 −9 −5 7 5 0 −10 −6 8 6
𝑅3 +2𝑅2 1 −1 −1 1 1
→ (0 5 3 −4| −3).
0 0 0 0 0
Note that the 3rd column and 4th column have no pivots, the corresponding
variables 𝑧 and 𝑤 are free variables.
Page 113 of 114

To obtain the full solution, we write 𝑧 = 𝑠 and 𝑤 = 𝑡 where 𝑠, 𝑡 are two real
numbers. From the second equation (second row), we have
−3 − 3𝑧 + 4𝑤 −3 − 3𝑠 + 4𝑡
5𝑦 + 3𝑧 − 4𝑤 = −3 ⇒ 𝑦 = = .
5 5
From the first equation, we get
2 + 2𝑠 − 𝑡
𝑥−𝑦−𝑧+𝑤 =1⇒𝑥 =1+𝑦+𝑧−𝑤 = .
5
𝑥 2/5 2/5 −1/5
𝑦 −3/5 −3/5 4/5
The general solution vector: ( 𝑧 ) = ( )+𝑠 ( )+( ) 𝑡.
0 1 0
𝑤 ⏟ 0 ⏟ 0 1
particular two linearly independent
solution solutions of the corresponding
homogeneous system
Page 114 of 114

Review Example 3
1 −2 0
Using Gauss-Jordan Method to find the inverse of 𝐴 = (0 2 3).
4 2 3
Solution
1 −2 0 1 0 0 𝑅3 −4𝑅1 1 −2 0 1 0 0
(0 2 3 |0 1 0) → (0 2 3 | 0 1 0)
4 2 3 0 0 1 0 10 3 −4 0 1

𝑅3 −5𝑅2 1 −2 0 1 0 0 𝑅 𝑅/(−12)
2 /2
1 −2 0 1 0 0
3
→ (0 2 3 |0 1 0) → (0 1 3/2 | 0 1/2 0 )
0 0 −12 −4 −5 1 0 0 1 1/3 5/12 −1/12

3
𝑅2 − 𝑅3 1 −2 0 1 0 0 1 0 0 0 −1/4 1/4
𝑅1 +2𝑅2

2
(0 1 0 |−1/2 −1/8 1/8 ) → 0 1 0 ||−1/2 −1/8 1/8
0 0 1 1/3 5/12 −1/12 0 0 1 ⏟1/3 5/12 −1/12
( 𝐴−1 )

You might also like