Determinant of square matrices
Associate Professor Pham Huu Anh Ngoc
International University
October 4, 2016
Return
Motivation
When does the linear system
ax + by = e
cx + dy = f have a unique solution?
Solution 1: Multiply the first equation by d and the second equation by
b and subtract d(ax + by ) − b(cx + dy ) = ed − bf . This gives
(ad − bc)x = ed − bf . So the system has a unique solution if and only if
(ad − bc) 6= 0.
Solution
2:Theabove
system
can be rewritten as
a b x e
= . The system has a unique solution if and
c d y f
a b
only if A := is invertible.
c d
Thus, we conclude that
a b
is invertible ⇔ ad − bc 6= 0.
c d
Motivation
When does the linear system
ax + by = e
cx + dy = f have a unique solution?
Solution 1: Multiply the first equation by d and the second equation by
b and subtract d(ax + by ) − b(cx + dy ) = ed − bf . This gives
(ad − bc)x = ed − bf . So the system has a unique solution if and only if
(ad − bc) 6= 0.
Solution
2:Theabove
system
can be rewritten as
a b x e
= . The system has a unique solution if and
c d y f
a b
only if A := is invertible.
c d
Thus, we conclude that
a b
is invertible ⇔ ad − bc 6= 0.
c d
Motivation
When does the linear system
ax + by = e
cx + dy = f have a unique solution?
Solution 1: Multiply the first equation by d and the second equation by
b and subtract d(ax + by ) − b(cx + dy ) = ed − bf . This gives
(ad − bc)x = ed − bf . So the system has a unique solution if and only if
(ad − bc) 6= 0.
Solution
2:Theabove
system
can be rewritten as
a b x e
= . The system has a unique solution if and
c d y f
a b
only if A := is invertible.
c d
Thus, we conclude that
a b
is invertible ⇔ ad − bc 6= 0.
c d
Motivation
When does the linear system
ax + by = e
cx + dy = f have a unique solution?
Solution 1: Multiply the first equation by d and the second equation by
b and subtract d(ax + by ) − b(cx + dy ) = ed − bf . This gives
(ad − bc)x = ed − bf . So the system has a unique solution if and only if
(ad − bc) 6= 0.
Solution
2:Theabove
system
can be rewritten as
a b x e
= . The system has a unique solution if and
c d y f
a b
only if A := is invertible.
c d
Thus, we conclude that
a b
is invertible ⇔ ad − bc 6= 0.
c d
Motivation
a b
In fact, if ad − bc 6= 0 then A := , is invertible and the
c d
inverse of A is given by
1 d −b
A−1 = .
ad − bc −c a
It is easy to check
−1 −1 1 0
AA =A A= = I2
0 1
Determinant of second order
A determinant of second order is denoted and defined by
a b
det = ad − bc
c d
Ex:
1 2
det = 1 × 3 − 2 × 4 = −5
4 3
Notation: The determinant
of a matrix
A is
also denoted by A. For
a b
example, also means det a b .
c d c d
Cramer’s Rule
Theorem: Cramer’s Rule for solving linear systems of two equations in
two unknowns
ax + by = e
cx + dy = f
is
e b a e
f d ed − fb c f af − ec
x= = ; y= =
D D D D
a b
provided D := 6= 0.
c d
Example
Solve the linear system
4x + 3y = 12
2x + 5y = −8
4 3
Solution: Note that D := = 14 6= 0. So the Cramer’s Rule
2 5
gives
12 3 4 12
−8 5 84 2 −8 −56
x = = = 6; y = = = −4.
4 3
14 4 3
14
2 5 2 5
Third-order determinant
A third-order determinant is defined by
a11 a12 a13
a21 a22 a23 = (a11 a22 a33 + a31 a12 a23 + a21 a32 a13 )
a31 a32 a33
−(a31 a22 a13 + a11 a32 a23 + a21 a12 a33 )
or equivalently
a11 a12 a13
= a11 (−1)1+1 a22 a23 1+2 a21 a23
a21 a22 a23 + a12 (−1)
a32 a33 a31 a33
a31 a32 a33
1+3
a21 a22
+a13 (−1)
a31 a32
Third-order determinant
A third-order determinant is defined by
a11 a12 a13
a21 a22 a23 = (a11 a22 a33 + a31 a12 a23 + a21 a32 a13 )
a31 a32 a33
−(a31 a22 a13 + a11 a32 a23 + a21 a12 a33 )
or equivalently
a11 a12 a13
= a11 (−1)1+1 a22 a23 1+2 a21 a23
a21 a22 a23 + a12 (−1)
a32 a33 a31 a33
a31 a32 a33
1+3
a21 a22
+a13 (−1)
a31 a32
a11 a12 a13
a21 a22 a23 = (a11 a22 a33 + a31 a12 a23 + a21 a32 a13 )
a31 a32 a33
−(a31 a22 a13 + a11 a32 a23 + a21 a12 a33 )
Ex:
1 0 1
= 1(−1)(1+1) 0 1 (1+2) 1 1
1 0 1 + 0(−1) +
1 1 1 1
1 1 1
1 0
1(−1)(1+3) = −1 + 1 = 0.
1 1
Ex:
Find the following determinants:
1 3 1 1 2 1
1 0 1 ; 1 2 1 .
1 1 1 1 1 1
Ex:
1 0 1
= 1(−1)(1+1) 0 1 (1+2) 1 1
1 0 1 + 0(−1) +
1 1 1 1
1 1 1
1 0
1(−1)(1+3) = −1 + 1 = 0.
1 1
Ex:
Find the following determinants:
1 3 1 1 2 1
1 0 1 ; 1 2 1 .
1 1 1 1 1 1
Cramer’s Rule for linear systems of three equations
The Cramer’s Rule for linear systems of three equations
a11 x1 + a12 x2 + a13 x3 = b1
a21 x1 + a22 x2 + a23 x3 = b2
a31 x1 + a32 x2 + a33 x3 = b3
is
a11 a12 a13
D1 D2 D3
6= 0)
x1 = ; x2 = x3 = , (D := a21 a22 a23
D D D a31
a32 a33
where
b1 a12 a13 a11 b1 a13 a11 a12 b1
D1 = b2 a22 a23 ;
D2 = a21 b2 a23 ;
D3 = a21 a22 b2 .
b3 a32 a33 a31 b3 a33 a31 a32 b3
Solve the linear system
3x + 2y + 3z = 4
−2x − 4y + 2z = −12
2x + 3z = 0
3 2 3
Solution Note that D := −2 −4 2 = 8 6= 0. The Cramer’s rule
2 0 3
gives
D1 D2 D3
x1 = ; x2 = x3 = ,
D D D
4 2 3 3 4 3
where D1 = −12 −4 2 = 24; D2 = −2 −12 2 =
0 0 3 2 0 3
3 2 4
4; −2 −4 −12 = −16.
2 0 0
Solve the linear system
3x + 2y + 3z = 4
−2x − 4y + 2z = −12
2x + 3z = 0
3 2 3
Solution Note that D := −2 −4 2 = 8 6= 0. The Cramer’s rule
2 0 3
gives
D1 D2 D3
x1 = ; x2 = x3 = ,
D D D
4 2 3 3 4 3
where D1 = −12 −4 2 = 24; D2 = −2 −12 2 =
0 0 3 2 0 3
3 2 4
4; −2 −4 −12 = −16.
2 0 0
Determinant of n-th order
Definition:
Let A = (aij ) be an n × n matrix. For fixed i0 , j0 , the cofactor of ai0 j0 is
(−1)(i0 +j0 ) Mi0 j0 , where Mi0 j0 is the determinant of the submatrix that
results from A by removing the i0 -th row and the j0 -th column.
The determinant Mi0 j0 is called the (i0 j0 )-th minor of A.
Example: Let us consider
1 0 1
1 0 1 .
1 1 1
0 1 1 1 (1+3) 1
0
Then (−1)(1+1) ; (−1)(1+2)
; (−1)
1 1 1 1 1 1
is the cofactor of a11 = 1, a12 = 0, a13 = 1, respectively .
Determinant of n-th order
Definition:
Let A = (aij ) be an n × n matrix. For fixed i0 , j0 , the cofactor of ai0 j0 is
(−1)(i0 +j0 ) Mi0 j0 , where Mi0 j0 is the determinant of the submatrix that
results from A by removing the i0 -th row and the j0 -th column.
The determinant Mi0 j0 is called the (i0 j0 )-th minor of A.
Example: Let us consider
1 0 1
1 0 1 .
1 1 1
0 1 1 1 (1+3) 1
0
Then (−1)(1+1) ; (−1)(1+2)
; (−1)
1 1 1 1 1 1
is the cofactor of a11 = 1, a12 = 0, a13 = 1, respectively .
Definition: (Determinant of n-th order)
Let A = (aij ) be an n × n matrix. Then the determinant of A is defined
by
det A = a11 (−1)(1+1) M11 + a12 (−1)(1+2) M12 + ... + a1n (−1)(1+n) M1n .
Ex:
1 0 1
= 1(−1)(1+1) 0 1 (1+2) 1 1
1 0 1 + 0(−1) +
1 1 1 1
1 1 1
1 0
1(−1)(1+3) = −1 + 1 = 0.
1 1
Definition: (Determinant of n-th order)
Let A = (aij ) be an n × n matrix. Then the determinant of A is defined
by
det A = a11 (−1)(1+1) M11 + a12 (−1)(1+2) M12 + ... + a1n (−1)(1+n) M1n .
Ex:
1 0 1
= 1(−1)(1+1) 0 1 (1+2) 1 1
1 0 1 + 0(−1) +
1 1 1 1
1 1 1
1 0
1(−1)(1+3) = −1 + 1 = 0.
1 1
Expanding a determinant along a row or a column
Theorem Let A = (aij ) be an n × n matrix. Then the determinant of A is
given by
det A = ai1 (−1)(i+1) Mi1 + ai2 (−1)(i+2) Mi2 + ... + ain (−1)(i+n) Min ,
for any i ∈ {1, 2, ..., n}.
(In this case, we say that the determinant is expanded along the i-th row).
Furthermore, one has
det A = a1j (−1)(1+j) M1j + a2j (−1)(2+j) M2j + ... + anj (−1)(n+j) Mnj ,
for any j ∈ {1, 2, ..., n}.
(In this case, we say that the determinant is expanded along the j-th
column).
Expanding a determinant along a row or a column
Theorem Let A = (aij ) be an n × n matrix. Then the determinant of A is
given by
det A = ai1 (−1)(i+1) Mi1 + ai2 (−1)(i+2) Mi2 + ... + ain (−1)(i+n) Min ,
for any i ∈ {1, 2, ..., n}.
(In this case, we say that the determinant is expanded along the i-th row).
Furthermore, one has
det A = a1j (−1)(1+j) M1j + a2j (−1)(2+j) M2j + ... + anj (−1)(n+j) Mnj ,
for any j ∈ {1, 2, ..., n}.
(In this case, we say that the determinant is expanded along the j-th
column).
(Expanding the determinant along the first row)
1 0 1
1 0 1 = 1(−1)(1+1) 0 1 + 0(−1)(1+2) 1 1 +
1 1 1 1
1 1 1
(1+3) 1 0
1(−1) 1 1 = −1 + 1 = 0.
(Expanding the determinant along the second row)
1 0 1
1 0 1 = 1(−1)(2+1) 0 1 + 0(−1)(2+2) 1 1 +
1 1 1 1
1 1 1
1 0
1(−1)(2+3) = −1 + 1 = 0.
1 1
(Expanding the determinant along the third row) .....
(Expanding the determinant along the first row)
1 0 1
1 0 1 = 1(−1)(1+1) 0 1 + 0(−1)(1+2) 1 1 +
1 1 1 1
1 1 1
(1+3) 1 0
1(−1) 1 1 = −1 + 1 = 0.
(Expanding the determinant along the second row)
1 0 1
1 0 1 = 1(−1)(2+1) 0 1 + 0(−1)(2+2) 1 1 +
1 1 1 1
1 1 1
1 0
1(−1)(2+3) = −1 + 1 = 0.
1 1
(Expanding the determinant along the third row) .....
(Expanding the determinant along the first row)
1 0 1
1 0 1 = 1(−1)(1+1) 0 1 + 0(−1)(1+2) 1 1 +
1 1 1 1
1 1 1
(1+3) 1 0
1(−1) 1 1 = −1 + 1 = 0.
(Expanding the determinant along the second row)
1 0 1
1 0 1 = 1(−1)(2+1) 0 1 + 0(−1)(2+2) 1 1 +
1 1 1 1
1 1 1
1 0
1(−1)(2+3) = −1 + 1 = 0.
1 1
(Expanding the determinant along the third row) .....
(Expanding the determinant along the first column)
1 0 1
1 0 1 = 1(−1)(1+1) 0 1 + 1(−1)(1+2) 0 1
1 1 1 +
1 1 1
1
0 1
1(−1)(3+1) = −1 + 1 = 0.
0 1
(Expanding the determinant along the second column)
1 0 1
1 0 1 = 1(−1)(3+2) 1 1
= 0.
1 1
1 1 1
(Expanding the determinant along the third column) .....
(Expanding the determinant along the first column)
1 0 1
1 0 1 = 1(−1)(1+1) 0 1 + 1(−1)(1+2) 0 1
1 1 1 +
1 1 1
1
0 1
1(−1)(3+1) = −1 + 1 = 0.
0 1
(Expanding the determinant along the second column)
1 0 1
1 0 1 = 1(−1)(3+2) 1 1
= 0.
1 1
1 1 1
(Expanding the determinant along the third column) .....
(Expanding the determinant along the first column)
1 0 1
1 0 1 = 1(−1)(1+1) 0 1 + 1(−1)(1+2) 0 1
1 1 1 +
1 1 1
1
0 1
1(−1)(3+1) = −1 + 1 = 0.
0 1
(Expanding the determinant along the second column)
1 0 1
1 0 1 = 1(−1)(3+2) 1 1
= 0.
1 1
1 1 1
(Expanding the determinant along the third column) .....
Properties of Determinants
Theorem
(a) If I is the identity matrix then det I = 1.
(b) If B is obtained from A by interchanging two rows of A then
det B = − det A
(c) If B is obtained from A by adding a multiple of one row of A to
another row then det B = det A
(d) If B is obtained from A by multiplying a row by the number k, then
det B = k det A.
Ex:
2 −8 0 1 −4 0
det 0 1 0 = 2 det 0 1 0 =
0 0 −3 0 0 −3
1 0 0 1 0 0
2 det 0 1 0 = 2(−3) det 0 1 0 = −6.
0 0 −3 0 0 1
Determinant of special matrices
Theorem
a11 0 0 0
0 a11 0 0
det
...
= a11 a22 ...ann .
... ... ...
0 0 ... ann
Ex:
1 0 0
det 0 2 0 = 1 × 2 × 3 = 6.
0 0 3
A square matrix U is said to be upper triangular if the entries below the
main diagonal are zeros.
A square matrix U is said to be lower triangular if all the entries above
the main diagonal are zeros.
Ex: The following matrices are upper triangular:
2 0 1
1 0 0 1 0
0 0
0 0 1
2 0 1
The matrix 0 1 0 is NOT an upper triangular matrix.
1 0 1
The following matrices are lower triangular:
2 0 0
1 0 1 1 0
0 0
1 0 1
2 0 1
The matrix 0 1 0 is NOT a lower triangular matrix.
0 1 1
Theorem
If A is a triangular matrix, either upper or lower. Then det A is the
product of the diagonal entries. That is,
det A = a11 a22 ...ann ,
where a11 , a22 , ..., ann are diagonal entries of the matrix A.
Ex:
2 0 1 2 0 0
det 0 1 0 = 2×1×1 = 2 det 1 1 0 = 2×1×1 = 2.
0 0 1 1 0 1
Calculating determinants by row reduction
Using the properties of determinants, we can calculate the determinant of
a matrix by row reduction.
Main Idea: Reduce the given matrix into a triangular matrix.
Ex:
2 −8 0 1 −4 0
det 0 1 0 = 2 det 0 1 0 =
1 0 −3 1 0 −3
1 0 0
2 det 0 1 0 = 2(−3) = −6.
1 0 −3
Example
(a)
1 0 2 1 0 2
det 2 0 4 = det 0 0 0 =0
0 1 0 0 0 −3
(b)
2 4 0 0 0 −6 1 2 3
det 1 2 3 = det 1 2 3 = − det 0 0 −6
0 1 1 0 1 1 0 1 1
1 2 3
= det 0 1 1 = −6
0 0 −6
Further properties of determinants
1. If two rows of A are the same then det A = 0.
2. If A has an entire row of all zeros det A = 0.
3. If A is an n × n matrix then det(kA) = k n det A.
4. If A is a triangular matrix, either upper or lower then det A is the
product of the diagonal entries. That is,
det A = a11 a22 ...ann ,
5. The square matrix A is invertible if and only if det A 6= 0.
6. det(AB) = det A det B.
Explain the following results:
3 −2 5 0 0 0 0 1 5
4 7 −1 = 0; 0 2 10 = 0; 0 2 10 = 0.
3 −2 5 1 3 3 1 3 3
Example
Calculate
1 0 0 1
2 1 0 0
det
0
1 1 0
0 0 1 2
Solution 1: Expanding the determinant along the first row, we have
1 0 0 1
2 1 0 0 1 0 0
1+1
det
0 1 1 0 = 1(−1)
det 1 1 0
0 1 2
0 0 1 2
2 1 0
+1(−1)1+4 det 0 1 1 = 2 − 2 = 0.
0 0 1
Example
Calculate
1 0 0 1
2 1 0 0
det
0
1 1 0
0 0 1 2
Solution 1: Expanding the determinant along the first row, we have
1 0 0 1
2 1 0 0 1 0 0
1+1
det
0 1 1 0 = 1(−1)
det 1 1 0
0 1 2
0 0 1 2
2 1 0
+1(−1)1+4 det 0 1 1 = 2 − 2 = 0.
0 0 1
Solution 2 Expanding the determinant along the second row, we have
1 0 0 1
2 1 0 0 1
0 0 = 2(−1)2+1 det 1 1
det
0 1 0
1 0
0 1 2
0 0 1 2
1 0 1
+1(−1)2+2 det 0 1 0 = 2 − 2 = 0.
0 1 2
Solution 3 Expanding the determinant along the third row, we have .....
Solution 4 Expanding the determinant along the fourth row, we have ....
Solution 5 Expanding the determinant along the first column, we have
....
Solution 6 Expanding the determinant along the second column, we
have ....
Prove that the linear system
x +y = 1
2x + y = 0
has a unique solution and find the solution. Solution: The given system
can be rewritten in the matrix form as
1 1 x 1
= .
2 1 y 0
1 1 1 1
Moreover, we have = −1 6= 0. Therefore, the matrix
2 1 2 1
is invertible. Thus,
−1
x 1 1 1 −1 1 1 −1
= = = .
y 2 1 0 2 −1 0 2
Hence x = −1, y = 2 is the solution of the system.
Prove that the linear system
x +y = 1
2x + y = 0
has a unique solution and find the solution. Solution: The given system
can be rewritten in the matrix form as
1 1 x 1
= .
2 1 y 0
1 1 1 1
Moreover, we have = −1 6= 0. Therefore, the matrix
2 1 2 1
is invertible. Thus,
−1
x 1 1 1 −1 1 1 −1
= = = .
y 2 1 0 2 −1 0 2
Hence x = −1, y = 2 is the solution of the system.
Prove that the linear system
x +y = 1
2x + y = 0
has a unique solution and find the solution. Solution: The given system
can be rewritten in the matrix form as
1 1 x 1
= .
2 1 y 0
1 1 1 1
Moreover, we have = −1 6= 0. Therefore, the matrix
2 1 2 1
is invertible. Thus,
−1
x 1 1 1 −1 1 1 −1
= = = .
y 2 1 0 2 −1 0 2
Hence x = −1, y = 2 is the solution of the system.
Problems:
(1) Evaluate, showing the details of your work.
14
1 2 0 0
2 5 0 a b
3 4 0 0
(a) 2 0 8 (b) −a 0 c ; (c)
0 0 5 6
5 8 −2 −b −c 0
0 0 7 8
(2) Solve by CRAMER’s rule and check by Gauss elimination and back
substitution
(a)
2x − 5y = 23
4x + 6y = −2
(b)
2x − 3z + w = 30
4x − 5y + 2z = 13
8x − 4y + z + 2w = 42
y − 5z + 3w = 35