Determinants




Theoretical Part

For practical applications, you can immediately go to the quick reference part of this page.

With each square matrix corresponds just one number. This number is called the determinant of the matrix. The determinant of a matrix A is denoted det(A) or |A|. Now we'll define this correspondence.

Determinant of a 1 x 1 matrix

De determinant of the matrix is the element itself.
Ex: det([-7]) = -7

Permutation of n ordered elements

Say S is an ordered set of n elements.
A one-one transformation t of the set S onto itself is a permutation of S.
Example:
S = (1, 2, 3, 4, 5) . A permutation t is defined by t(1, 2, 3, 4, 5) = (2, 5, 4, 1, 3)
The permutation, which transforms (2, 5, 4, 1, 3) back to (1, 2, 3, 4, 5) is called the inverse permutation of t.
The set of all the permutations of S is denoted here as PS.

Transposition

A permutation, which interchanges two elements, and fixes all others, is called a transposition.
Example:
S = (1, 2, 3, 4, 5) . The permutation defined by t(1, 2, 3, 4, 5) = (1, 4, 3, 2, 5) is a transposition

Theorem

Every permutation of n ordered elements can be expressed as a sequence of transpositions. If this permutation is a sequence of an even number of transpositions, it is impossible to write this permutation as a sequence of an odd number of transpositions.

Even and odd permutations

If a permutation of n ordered elements can be expressed as an even number of transpositions, then it is called an even permutation. If a permutation of n ordered elements can be expressed as an odd number of transpositions, then it is called an odd permutation.
The inverse permutation has exactly the same number of transpositions as t.
So, if t is even, its inverse is even too.
Example:
S = (1, 2, 3, 4, 5)
t(1, 2, 3, 4, 5) = (1, 3, 4, 2, 5) is an even permutation.
t(1, 2, 3, 4, 5) = (1, 3, 4, 5, 2) is an odd permutation.

Sign of a permutation

The sign of an even permutation t is +1. We write : sgn(t) = +1.
The sign of an odd permutation t is -1. We write : sgn(t) = -1.

The determinant of an n x n matrix

Let S = (1, 2, 3, ... , n)
t is a permutation of S, so t(1, 2, 3, ... , n) = (t(1), t(2), ... , t(n)).
There are n! permutations in the set PS.
A is a n x n matrix with elements ai,j.

Now, with each permutation t of S, create the product
sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) . ... . an,t(n).
There are n! such products.
|A| is defined as the sum of all those products.
 
 |A| =   sum     sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) . ... . an,t(n)
       t in PS
Note that each term of |A| uses each row and each column only once.

Example1 : We want to calculate the determinant of a 2x2 matrix A.
Now n = 2 and there are only two permutations of S = (1,2).
t(1,2) = (1,2) with sgn(t) = +1
t'(1,2) = (2,1) with sign(t') = -1
We have only two terms +1.a1,1 . a2,2 and -1.a1,2 . a2,1
Thus the determinant of A is a1,1 . a2,2 - a1,2 . a2,1
We don't forget the rule :

 
|a  b|
|c  d|

= ad - cb

Example2 : We want to calculate the determinant of a 3x3 matrix A.
Now n = 3 and there are only 6 permutations of S = (1,2,3).
These 6 permutations transform (1, 2, 3) in:

 
(1, 2, 3) (2, 3, 1) (3, 1, 2)    (even permutations)
(3, 2, 1) (1, 3, 2) (2, 1, 3)    (odd permutations)
Now we have six terms to add
 
a1,1 . a2,2 . a3,3 + a1,2 . a2,3 . a3,1 + a1,3 . a2,1 . a3,2
-a1,3 . a2,2 . a3,1 - a1,1 . a2,3 . a3,2 - a1,2 . a2,1 . a3,3
We don't forget the rule :
 
|a  b  c|
|d  e  f|
|g  h  i|

 = aei + bfg + cdh - ceg - afh - bdi
The last rule is known as the Sarrus rule for 3 x 3 determinants.

To calculate larger determinants there are a lot of other methods involving various properties of determinants.

Row and columns of the determinant

If we say the i-th row of a determinant we mean the i-th row of the matrix corresponding with this determinant. If we say the i-th column of a determinant we mean the i-th column of the matrix corresponding with this determinant.

Cofactor of an element ai,j

Now choose a fixed row value i.
In each term of |A|, each row is used once and only once.
Each term of |A| contains exactly one of the factors ai,1; ai,2; ai,3; ... ai,n.
Thus, we can write |A| as a linear polynomial in ai,1; ai,2; ai,3; ... ai,n.
We denote the coefficients respectively Ai,1; Ai,2; Ai,3; ... Ai,n.
These coefficients are called the cofactors. Ai,j is the cofactor of ai,j.
|A| = Ai,1 . ai,1 + Ai,2 . ai,2 + Ai,3 . ai,3 + ... Ai,n . ai,n.

Now consider Ai,j . ai,j. This term uses the i-th row and the j-th column in the factor ai,j. So the cofactor Ai,j is independent of the elements of the i-th row and the elements of the j-th column.
The cofactor Ai,j contains only elements from the matrix obtained from A by crossing out the i-th row and the j-th column.

Remark: If we write |A| = Ai,1 . ai,1 + Ai,2 . ai,2 + Ai,3 . ai,3 + ... Ai,n . ai,n, we say that the determinant is calculated emanating from the i-th row.
Example :

 
|a  b  c|
|d  e  f|
|g  h  i|

 = aei + bfg + cdh - ceg - afh - bdi
Choose for instance row 2.
Each term of |A| contains exactly one of the factors d , e ,f .
Thus, we can write |A| as a linear polynomial in d , e, f.
|A| = (ch-bi)d + (ai-cg)e + (bg-ah)f
ch-bi is the cofactor of d.
ai-cg is the cofactor of e.
bg-ah is the cofactor of f.
Not any cofactor contains an element of the chosen row 2.
The cofactor of d contains neither an element of row 2 nor an element of column 1.

If we write |A| = (ch-bi)d + (ai-cg)e + (bg-ah)f , we say that the determinant is calculated emanating from the second row.
Similarly, we can start with a fixed column and then write |A| as a linear polynomial in a1, j, a2,j, a3,j, ... an,j. Then one finds the same cofactors. So ai,j has a unique cofactor Ai,j.

A matrix A and its transpose have the same determinant.

Let S = (1,2,..., n).
Let B = the transpose of matrix A. bi,j = aj,i.
We know that
 
|B|  =  sum      sgn(t). b1,t(1) . b2,t(2) . b3,t(3) ... bn,t(n)
      t in PS

                   but bi,j = aj,i


     =    sum      sgn(t). at(1),1 . at(2),2 . at(3),3 ... at(n),n.
        t in PS
Consider the last sum.
Since t(1), t(2), ... , t(n) is a permutation of 1, 2, 3 ... n , we can reorder the factors of each term, according to the first index. This can be done using the inverse permutation of t. The permutation t transforms (1, 2, 3 ... n) to (t(1), t(2), ... , t(n)), the inverse permutation t' brings (t(1), t(2), ... , t(n)) back to (1, 2, 3 ... n) and this inverse permutation has exactly the same number of transpositions as t. So sign(t) = sign(t').

Then

 
 |B| =   sum         sgn(t') . a1,t'(1) . a2,t'(2) . a3,t'(3) ... an,t'(n)
      t' inverse of t

 Because  the set of all permutations of S  is the same set of all inverse permutations.
 So we can write

 |B| =    sum     sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... an,t(n)
        t in PS

So, |B| = |A|.

Important result

Appealing on previous property, it is immediate that each property of determinants we'll find for the rows of that determinant, also holds for the columns and each property for the columns holds for the rows.

Interchanging two columns of A

Let S = (1, 2, 3, ...,n)
First, denote t' the permutation transposing only i and j.
Thus t'(1, ... ,i, ... , j, ... , n) = (1, ... , j, ... , i, ... , n).

Sgn(t') = -1 and for each permutation t we have sign(t't) = -sign(t).

Say B is obtained by interchanging the column i and j of A.
For each k we have bk,i = ak,j and bk,j = ak,i or even for each k and each l we have

 
              bk,l  =  ak,t'(l)
We investigate |B|.
We know that
 
|B| = sum     sgn(t). b1,t(1)   . b2,t(2)   . b3,t(3) ...   bn,t(n)
      t in PS

            but bk,l  =  ak,t'(l)

|B| = sum     sgn(t). a1,t't(1) . a2,t't(2) . a3,t't(3) ... an,t't(n)
     t in PS

|B| = sum    -sgn(t't). a1,t't(1) . a2,t't(2) . a3,t't(3) ... an,t't(n)
     t in PS
Since the set of permutations of (1 ... n) is a group, the set of all permutations t and the set of all permutations t" = t't is the same set. Therefore
 
|B| = sum     -sgn(t"). a1,t"(1) . a2,t"(2) . a3,t"(3) ... an,t"(n)
     t" in PS

|B| = sum     -sgn(t) . a1,t(1)  . a2,t(2)  . a3,t(3) ...  an,t(n)
     t in PS

|B| =  -|A|
Conclusion :
When we swap two columns in A, |A| changes sign.
When we swap two rows in A, |A| changes sign.

Multiplying a row of A by a real number

Let S = (1, 2, 3, ...,n)
Say B is obtained by multiplying the i-th row of A by a real number r.
Then bi,k = r . ai,k for each k and fixed i, and if j is not i then bj,k = aj,k
We know that |B|
 
 = sum     sgn(t) . b1,t(1) . b2,t(2) . b3,t(3) ... bi,t(i) ... bn,t(n)
   t in PS

 = sum     sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... r.ai,t(i) ... an,t(n)
   t in PS

 = sum     r sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... ai,t(i) ... an,t(n)
   t in PS

 = r.(  sum    sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... ai,t(i) ... an,t(n))
       t in PS

 = r.|A|
Conclusion :
When we multiply a row in A by a real number r, |A| changes in r.|A|
When we multiply a column in A by a real number r, |A| changes in r.|A|

If A has two equal rows, |A| = 0

If we swap these two rows, the determinant does not change. Appealing on a previous property the determinant changes in its opposite. This is only possible when the determinant = 0.

Addition of two determinants, which differ only from the i-th row

Let S = (1, 2, 3, ...,n)
Say A and B are matrices which are only different in the i-th row.
For all j different from i, and for all k we have aj,k = bj,k.
 
|A| = sum    sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... ai,t(i) ... an,t(n)
     t in PS

|B| = sum    sgn(t) . b1,t(1) . b2,t(2) . b3,t(3) ... bi,t(i) ... bn,t(n)
     t in PS

   = sum     sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... bi,t(i) ... an,t(n)
    t in PS

So |A| + |B|
   = sum  sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... (ai,t(i) + bi,t(i)) ... an,t(n)
   t in PS

   =  determinant of the matrix formed by adding the i-th row from A and B,
    and taking the other elements from A or from B.
The same rule holds for columns
Ex.
 
|a  b  c| |a  b'  c|   |a  b+b'  c|
|d  e  f|+|d  e'  f| = |d  e+e'  f|
|g  h  i| |g  h'  i|   |g  h+h'  i|

Equal determinants

Let A be any square matrix.
 
            | a1,1   a1,2  ....
            | a2,1   a2,2  ....
            |
  |A| =     |
            | ai,1   ai,2  ....
            |
            |
            | aj,1   aj,2  ....
            |
Let B be the matrix formed by replacing in A the i-th row by the j-th row, leaving the jth row unchanged.
 
             | a1,1   a1,2  ....
             | a2,1   a2,2  ....
             |
 |B| =       |
             | aj,1   aj,2  ....
             |
             |
             | aj,1   aj,2  ....
             |
Since B has two equal rows |B| = 0.
Let C be the matrix formed by multiplying the i-th row of B by r, leaving the other elements unchanged.
 
             | a1,1   a1,2  ....
             | a2,1   a2,2  ....
             |
  |C| =      |
             |r.aj,1  r.aj,2  ....
             |
             |
             | aj,1   aj,2  ....
             |
Then |C| = r.|B|=0
A and C differ only from the i-th row, so we can use previous property and we have:
 
             | a1,1   a1,2  ....
             | a2,1   a2,2  ....
             |
|A|+|C| =    |
             |aj,1+r.aj,1  aj,2+r.aj,2  ....
             |
             |
             | aj,1   aj,2  ....
             |
But since |C| = 0 we have |A|+|C| = |A| + 0 = |A|. So, the last determinant is equal to the first one.

Therefore, a determinant does not change if we add a multiple of a row to another row. The same rule holds for columns
Ex.

 
|a  b  c|   |a+rd   b+re   c+rf|
|d  e  f| = | d      e      f  |
|g  h  i|   | g      h      i  |

The cofactor A1, 1

Let A be any square matrix. Let S = (1, 2, 3, ..., n)
We know that
 
|A| =  sum    sgn(t) . a1,t(1) . a2,t(2) . a3,t(3) ... an,t(n).
     t in PS
A1,1 is the coefficient of a1,1 in this sum.
The terms containing a1,1 are the terms with t(1) = 1.

Now, instead of taking the sum for t in PS we only take the sum for t in the set
{t in PS | t(1) = 1} = permutations of S' =(2 ... n).

This sum then gives exactly A1,1 . a1,1.

 
A1,1 . a1,1

  =  sum    sgn(t) . a1,1 . a2,t(2) . a3,t(3) ... an,t(n)
   t in PS'

  =  a1,1 (  sum   sgn(t) a2,t(2) . a3,t(3) ... an,t(n) )
              t in PS'

Thus  A1,1 =

  sum   sgn(t) a2,t(2) . a3,t(3) ... an,t(n)
 t in PS'
This last sum is, by the definition of a determinant, the determinant of the sub-matrix of A obtained from A by crossing out the first row and the first column.

Conclusion:
A1,1 = the determinant of the sub-matrix of A obtained from A by crossing out the first row and the first column.

The cofactor Ai,j

Let A be any square matrix. Focus the element e = ai,j. Interchange in succession row i and i-1; i-1 and i-2; ... until e is on the first row. This demands i-1 steps.

Then we interchange in succession column j and j-1; j-1 and j-2; ... until e is on the first column and on the first row. This demands j-1 steps.

During this process the determinant of the matrix changes i+j-2 times sign.
Now the cofactor of e is the determinant of the sub-matrix of obtained from by crossing out the first row and the first column.

Now we return to the original matrix.
The value of Ai,j = (-1)i+j-2.(the determinant of the sub-matrix of A, obtained from A by crossing out the i-th row and the j-th column).
Or stated simpler:
The value of Ai, j = (-1)i+j.(the determinant of the sub-matrix of A, obtained from A by crossing out the i-th row and the j-th column).

|I| = 1

We can prove this property by complete induction.
It is easy to see that the property holds for the 2 x 2 identity matrix.
Assume that the property holds for the k x k identity matrix, and we'll prove it holds for the (k+1) x (k+1) identity matrix.

Let I be the (k+1) x (k+1) identity matrix and we calculate this matrix emanating from the first row.
|A| = A1,1 . a1,1 + A1,2 . a1,2 + A1,3 . a1,3 + ... A1,n . a1,n.
|A| = A1,1.1 + A1,2.0 + A1,3.0 + ... A1,n.0.
|A| = A1,1
Now, the cofactor A1,1 is the determinant of the k x k identity matrix, and this determinant is 1.

Determinant of a diagonal matrix

It is also easy to prove, as above by complete induction, that the determinant of a diagonal matrix is the product of the diagonal elements.

Determinant of a product of two square matrices

It can be proved that |A|.|B| = |A.B|

Quick Reference

Determinant of a 1x1 matrix

De determinant of a 1x1 matrix is the element itself.

Determinant of a 2x2 matrix

 
|a  b|
|c  d|

 =  ad - cb

Determinant of a 3x3 matrix

The Sarrus rule :
 
|a  b  c|
|d  e  f|
|g  h  i|

 = aei + bfg + cdh - ceg - afh - bdi

Cofactor of ai,j

The cofactor Ai,j is independent of the elements of the i-th row and the elements of the j-th column.
The value of Ai,j = (-1)i+j.(the determinant of the sub-matrix of A, obtained from A by crossing out the i-th row and the j-th column.

Example

Take the 3 x 3 matrix A =

 
[4 5 7]
[1 2 3]
[2 5 6]
We calculate the cofactor corresponding with the element a1,3 = 7.
We delete the first row and the third column.
The cofactor A1,3 = (-1)4.(5 - 4) = 1

Determinant of a nxn matrix

Choose a fixed row value i.
The determinant can be calculated emanating from the i-th row.

|A| = Ai,1 . ai,1 + Ai,2 . ai,2 + Ai,3 . ai,3 + ... Ai,n . ai,n

Ai, j is the cofactor of ai,j.
We say we have unfold the determinant following row i.

Example

Take the 3 x 3 matrix A =

 
[4 5 7]
[1 2 3]
[2 5 6]
We unfold the determinant following row 1.
The three cofactors are -3 , 0 , 1.
|A| = 4.(-3) + 5.0 + 7.1 = -5.

We unfold the determinant following column 3.
The three cofactors are 1, -10, 3.
|A| = 7.1 - 3.10 + 6.3 = -5

Properties

Applying the properties

A few agreements on the data representation which is used here

 
R3  means  row 3
K2  means  column  2

R2 - R3 means:  replace  R2 by R2 - R3  (the value of the determinant does not change)

K2 + 2K3 means:  replace K2 by  K2 + 2.K3  (the value of the determinant does not change)

Examples

 
| x   2m   1 |
| 3   1    1 | =
| x   m    1 |

  R1 - R3       (create zeros)

| 0   m   0 |
| 3   1   1 | =
| x   m   1 |

 unfold the determinant following row 1

m.( -(3-x)) = m(x-3)

--------------------------------

| 1   2   3 |
| 4   5   6 | =
| 7   8   9 |

   R1 - R2 ; R2 - R3

| -3  -3  -3|
| -3  -3  -3| = 0
| 7   8   9 |

---------------------------------

| 1   1+m  -1 |
| 3   3+m  -3 | =
| 5    m   -1 |

   K1 + K3        (create zeros)

| 0   1+m  -1 |
| 0   3+m  -3 | =
| 4    m   -1 |

 unfold the determinant following column 1

0 + 0 + 4.((1+m).(-3) + (3+m))

= -8m

-------------------------------

| m2 + m    m    m3|
|   a        b    c  | =
|   d        e    f  |

    factor  m in the first row



  | m + 1    1    m2|
m.|   a      b    c  | =
  |   d      e    f  |

Factorization of a determinant

We know
If we multiply a row in |A| by a real number r, |A| changes in r.|A|
 
|ra  rb  rc|    |a  b  c|
|d    e   f| =r.|d  e  f|
|g    h   i|    |g  h  i|
We reformulate this property :
If the elements of a row of a determinant have a common factor, we can put this factor in front of the determinant. The same property holds for the elements of a column.

Example

 
| a   a2   a3 |
| b   b2   b3 | =
| c   c2   c3 |

 factor a in  row 1
 factor b in  row 2
 factor c in  row 3


      | 1   a   a2 |
a.b.c.| 1   b   b2 | =
      | 1   c   c2 |

   R1 - R2 ; R2 - R3      (create zeros)

      | 0   a-b   a2-b2 |
a.b.c.| 0   b-c   b2-c2 | =
      | 1   c       c2   |

    factor in row 1
    factor in row 2


                  | 0   1   a+b |
a.b.c.(a-b).(b-c).| 0   1   b+c | =
                  | 1   c   c2 |

  unfold following the first column

a.b.c.(a-b).(b-c).(c-a)

Next steps

Systems of linear equations,
rank of a matrix,
Cramers Rule,
Classification of systems of linear equations,
Investigation of systems with a parameter



Topics and Problems

MATH-abundance home page - tutorial

MATH-tutorial Index

The tutorial address is http://home.scarlet.be/math/

Copying Conditions

Send all suggestions, remarks and reports on errors to Johan.Claeys@ping.be     The subject of the mail must contain the flemish word 'wiskunde' because other mails are filtered to Trash