lesson5
lesson5
1. Cofactor expansion
The determinant of a square matrix A is a real number, denoted by det(A),
which has many interesting fundamental properties. In this section, we will first
explain how to compute this number.
Definition 1.1. When A is a 1 × 1 matrix A = (a), the determinant of A is defined
by:
det(A) = a.
( )
a b
When A is a 2 × 2 matrix A = , the determinant of A is defined by:
c d
det(A) = ad − bc.
Definition 1.2. When A is a 3 × 3 matrix:
a b c
A= d e f
g h i
the determinant of A is defined by:
( ) ( ) ( )
e f b c b c
det(A) = a × det − d × det + g × det .
h i h i e f
Example 1.3.
−2 1 2
A= 7 0 1
1 2 −3
det(A) = −2 × (0 − 2) − 7 × (−3 − 4) + 1 × (1 − 0) = 4 + 49 + 1 = 54.
As we can see in Definition 1.2, the determinant of a 3 × 3 matrix A is defined
by using determinants of smaller 2 × 2 matrices which are ”contained inside” A.
This leads us to the following definition.
Definition 1.4. Let A be an n × n matrix and fix two numbers i and j such that
1 ≤ i ≤ n and 1 ≤ j ≤ n.
The submatrix Ai,j is the (n − 1) × (n − 1) matrix obtained from A by removing
row i and column j.
Example 1.5.
−2 1 2
A= 7 0 1
1 2 −3
There are 9 submatrices of A:
( ) ( ) ( )
0 1 7 1 −2 1
A1,1 = A1,2 = ... A3,3 = .
2 −3 1 −3 7 0
1
We are now ready to define the determinant of an n × n matrix A for any
natural number n: we will do it by induction on n, using the determinants of the
submatrices Ai,j .
( )
a1,1 a1,2
Notice that when A is a 2 × 2 matrix A = , the submatrices A1,1
a2,1 a2,2
and A2,1 are:
A1,1 = (a2,2 ) and A2,1 = (a1,2 )
and therefore:
det(A) = a1,1 det(A1,1 ) − a2,1 det(A2,1 ) = a1,1 a2,2 − a2,1 a1,2 .
Similarly, when A is a 3 × 3 matrix with coefficients (ai,j ) with 1 ≤ i ≤ 3 and
1 ≤ j ≤ 3, the formula in Definition 1.2 is equivalent to:
det(A) = a1,1 det(A1,1 ) − a2,1 det(A2,1 ) + a3,1 det(A3,1 ).
and the definition of the determinant of an n × n matrix will be a generalization of
this formula.
and of:
∑
n ∑
n+1
(−1)i+j+k−1 ak,1 ai,j det(A{i,k},{1,j} ).
k=1 i=k+1
and of:
∑
n ∑
n+1
(−1)i+j+k ak,1 ai,j det(A{i,k},{1,j} )
i=1 k=i+1
so one can see that both formulas are equal, and therefore the cofactor
expansion along column j of A is equal to det(A):
∑
n+1
det(A) = (−1)i+j ai,j det(Ai,j )
i=1
and
∑ n+1
n+1 ∑
(−1)i+j+k ak,1 ai,j det(A{i,k},{1,j} ).
k=i+1 j=2
Now let us look at the cofactor expansion along row i of A:
∑
n+1
(−1)i+j ai,j det(Ai,j )
j=1
where the matrices A{i,k},{1,j} are as above. Finally, the cofactor expansion
along row i is equal to the sum of (−1)i+1 ai,1 det(Ai,1 ) and of the two sums:
∑∑
n+1 i−1
(−1)i+j+k−1 ak,1 ai,j det(A{i,k},{1,j} )
j=2 k=1
and
∑ n+1
n+1 ∑
(−1)i+j+k ak,1 ai,j det(A{i,k},{1,j} ).
j=2 k=i+1
By the previous discussion, this sum is equal to det(A) so we have proved
that the cofactor expansion along row i of A is equal to det(A):
∑
n+1
det(A) = (−1)i+j ai,j det(Ai,j )
j=1
Example 2.3.
2 3 0 6
0 −5 9 −1
A=
0
.
0 −1 0
0 0 0 3
One can easily check that:
det(A) = 2 × (−5) × (−1) × 3 = 30.
The following proposition is also important and concerns the transpose.
Proposition 2.4. For any n × n matrix A, we have:
det(t A) = det(A).
Proof. We will prove the proposition by induction on n.
• When n = 1, the result is clear since t A = A.
• Suppose that the result is true for some n and let A be an (n + 1) × (n + 1)
matrix. Set
B =t A.
B has coefficients bi,j for all integers i and j between 1 and n + 1 and
bi,j = aj,i .
We compute det(B) by cofactor expansion along the first row and get:
det(B) = b1,1 det(B1,1 )−b1,2 det(B1,2 )+b1,3 det(B1,3 )+...+(−1)n+2 b1,n+1 det(B1,n+1 ).
For each j such that 1 ≤ j ≤ n + 1 we obviously have:
b1,j = aj,1
by definition of the transpose and
B1,j =t Aj,1
because B1,j is the matrix t A from which row 1 and column j have been
removed, but row 1 of t A is column 1 of A and column j of t A is row j
of A so t B1,j is the matrix A from which row j and column 1 have been
8
removed, that is Aj,1 . Now since the matrices Aj,1 are n × n matrices, by
induction hypothesis
det(Aj,1 ) = det(t Aj,1 ) = det(B1,j )
so finally
det(B) = a1,1 det(A1,1 )−a2,1 det(A2,1 )+a3,1 det(A3,1 )+...+(−1)n+2 an+1,1 det(An+1,1 )
which is the cofactor expansion along the first column of A so
det(B) = det(A).
• By induction on n, we have proved the proposition for all integers n and
for all n × n matrices.
□
5. The comatrix
In this section, we want to describe another new method to compute the inverse
of an n × n matrix A, by using only determinants. We begin by constructing the
matrix of the cofactors of A.
Definition 5.1. Let n ≥ 2 be an integer and A an n × n matrix. The comatrix
of A is the n × n matrix whose entries are the cofactors Ci,j of A (see Definition
1.8). It is denoted by Com(A).
14
Example 5.2 (Example 1.3).
−2 1 2
A= 7 0 1
1 2 −3
We compute the cofactors one by one and get:
−2 22 14
Com(A) = 7 4 5 .
1 16 −7
The following proposition shows all the importance of the comatrix.
Proposition 5.3. Let n ≥ 2 be an integer and A an n × n matrix. The following
formula holds:
t
Com(A)A = At Com(A) = det(A)In .
Proof. Set B = At Com(A) and let bi,j be the entries of B, for 1 ≤ i ≤ n and
1 ≤ j ≤ n. The diagonal entries of B are:
bi,i = ai,1 Ci,1 + ai,2 Ci,2 + ... + ai,n Ci,n
and this is exactly the cofactor expansion along row i of A, so
bi,i = det(A)
for each i. Now let us fix i and j such that i ̸= j and compute:
bi,j = ai,1 Cj,1 + ai,2 Cj,2 + ... + ai,n Cj,n .
By looking closely at this formula, we see that it is the cofactor expansion along
row j of a matrix D. All the rows of D except row j are equal to the corresponding
rows of A, and row j of D is equal to row i of A. It follows that the rows i and
j of the matrix D are identical and thus by Corollary 3.3 we have det(D) = 0. It
follows that
bi,j = 0 when i ̸= j.
Thus B = det(A)In . The other way around is proved similarly. □
The following theorem gives a general formula to compute the inverse of an n × n
matrix.
Theorem 5.4. Let n ≥ 2 be an integer and A an n × n matrix.
• If det(A) = 0 then A is not invertible.
• If det(A) ̸= 0 then A is invertible and its inverse is given by the formula:
1 t
A−1 = Com(A).
det(A)
Proof. The first part of the theorem is proved in Theorem 4.1. The second part
follows directly from Proposition 5.3. □
Example 5.5. When ( )
a b
A=
c d
is a 2 × 2 matrix we get:
( )
d −c
Com(A) =
−b a
15
and det(A) = ad − bc, so when det(A) ̸= 0 we get:
( )
−1 1 d −b
A = .
ad − bc −c a
Example 5.6 (Example 1.3).
−2 1 2
A= 7 0 1
1 2 −3
We have det(A) = 54 and Com(A) has been computed in Example 5.2 above:
−2 22 14
Com(A) = 7 4 5 .
1 16 −7
It follows that:
−2 7 1
54 54 54
−2 7 1
1
A −1
= 22 4 16 =
22
54
4
54
16
54
.
54
14 5 −7
14 5 −7
54 54 54
Example 5.7.
1 −2 2
A= 1 −1 3
2 −4 5
We compute
det(A) = 1 × (−5 + 12) − 1 × (−10 + 8) + 2 × (−6 + 2) = 1
and
7 1 −2
Com(A) = 2 1 0
−4 −1 1
and so
7 2 −4
A−1 = 1 1 −1 .
−2 0 1
6. Cramer’s formulas
Theorem 5.4 provides us with a new method for solving systems of linear equa-
tions, under some conditions.
Definition 6.1. A system of linear equations is called a Cramer system if the
following two conditions are satisfied:
• The number of variables is equal to the number of equations.
• The coefficient matrix of the system is invertible.
More precisely, a Cramer system has the following form:
a1,1 x1 + a1,2 x2 +... + a1,n xn = b1
a2,1 x1 + a2,2 x2 +... + a2,n xn = b2
... ... ... ... ...
an,1 x1 + an,2 x2 +... + an,n xn = bn
16
The coefficient matrix of the system is the square matrix:
a1,1 a1,2 ... ... a1,n
a2,1 a2,2 ... ... a2,n
A= ...
... ... ...
an,1 an,2 ... ... an,n
and A is invertible, therefore the system has a unique solution which is:
−
→ −
→
x = A−1 b .
By looking closely at this equation and by using Theorem 5.4, we obtain the fol-
lowing theorem.
Theorem 6.2 (Cramer’s formulas). Let n ≥ 2 be an integer, A an n×n invertible
−
→
matrix and b a column vector in Rn . The system of linear equation
−
→
A− →
x = b
has a unique solution
x1
−
→ x2
x =
...
xn
which can be computed by the following formulas:
−
→→
det(−
→v 1 ...−
→
v i−1 b −v i+1 ...−
→
v n)
xi =
det(A)
for each i such that 1 ≤ i ≤ n. Here
−
→
v 1, −
→
v 2 , ..., −
→
vn
denote the columns of the matrix A and
−
→→
(−
→
v 1 ...−
→
v i−1 b −
v i+1 ...−
→
v n)
denotes the n × n matrix obtained from A by deleting column i and replacing it
−
→
with the column vector b .
Proof. By Theorem 5.4, A being invertible, det(A) ̸= 0 and the following formula
gives the solution:
−
→ 1 t −
→
x = Com(A) b .
det(A)
Therefore, for each i the variable xi is given by the formula:
1
xi = (b1 C1,i + b2 C2,i + ... + bn Cn,i )
det(A)
and the numerator of this expression is exactly the cofactor expansion along column
i of a matrix whose columns are all equal to the columns of A except column i which
−
→
is equal to the column vector b . The result follows. □
We give a few examples of practical computations. Notice that this method only
works for Cramer systems. The other cases need to be solved by more general
methods, as described in previous lessons.
17
Example 6.3.
{
x1 + x2 =3
3x1 − x2 =5
This is a Cramer system, because its coefficient matrix
( )
1 1
A=
3 −1
is clearly invertible with det(A) = −4. We compute the solution with Cramer’s
formulas: ( )
3 1
det
5 −1 −8
x1 = = =2
det(A) −4
( )
1 3
det
3 5 −4
x2 = = = 1.
det(A) −4
Example 6.4.
x1 + x2 + x3 =0
2x1 − x2 − x3 =6
x1 + 2x2 − x3 =7
Here, the coefficient matrix is:
1 1 1
A= 2 −1 −1
1 2 −1
so first we need to compute det(A). We do it by the row reduction method, using
only transvections:
1 1 1 1 1 1 1 1 1 1 1 1
2 −1 −1 ∼ 0 −3 −3 ∼ 0 1 −11 ∼ 0 1 −11
1 2 −1 0 1 −2 0 1 −2 0 0 9
It follows that det(A) = 9 and the matrix A is invertible. So the system is a Cramer
system and we can solve it with the formulas:
0 1 1
det 6 −1 −1
7 2 −1 18
x1 = = =2
det(A) 9
1 0 1
det 2 6 −1
1 7 −1 9
x2 = = =1
det(A) 9
1 1 0
det 2 −1 6
1 2 7 −27
x3 = = = −3.
det(A) 9
18
Example 6.5.
x1 + x2 =3
3x1 − x2 −4x4 = 5
−x1 + 2x2 − x3 =0
3x1 + 2x2 − x3 −4x4 = 8
First we compute the determimant of the coefficient matrix
1 1 0 0
3 −1 0 −4
A= −1
2 −1 0
3 2 −1 −4
and we obtain by row reduction, using only transvections:
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
3 −1 0 −4 0 −4 0 −4 0 −1 −1 −4 0 −1 −1 −4
∼ ∼ ∼
−1 2 −1 0 0 3 −1 0 0 3 −1 0 0 0 −4 −12
3 2 −1 −4 0 −1 −1 −4 0 −1 −1 −4 0 0 0 0
which gives
det(A) = 0.
This system is not a Cramer system, and cannot be solved by using Cramer’s
formulas. It has infinitely many solutions.
19