Lecture 6 Math 221 

Determinates- General Discussion 

 

We want to now study a way to assign a real or complex number to a square array of real or complex numbers.  The motivation comes from solving a system of n equations in n unknowns. 

We will look at a system of two equation in two unknowns 

 

                                   Typesetting:-mrow(Typesetting:-mi(
                                   Typesetting:-mrow(Typesetting:-mi(
If we multiply the first row by Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( and subtract it from the second row and replace the second row by the difference we obtain
 

 

                                  Typesetting:-mrow(Typesetting:-mi(
                     Typesetting:-mrow(Typesetting:-mi(
We are assuming here that Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( is not zero.  The two quantities
 

Typesetting:-mrow(Typesetting:-mi(    and  Typesetting:-mrow(Typesetting:-mi(  will soon be defined in terms of determine.The coefficient matrix of the system of equations is then  

Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( and we define the determinant of the matrix to be Typesetting:-mrow(Typesetting:-mi(
Now the determinant of the matrix Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( would be Typesetting:-mrow(Typesetting:-mi( .  The solution y can be written as the quotient of two determinants.  We will come back to this at the end
 

of our discussion of determinants.   

 

The determinant of the matrix  E =  Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( will be det(E) = 1(-5) - (2)(-2) = -5 +4 = -1 

 

Laplace Expansion of Determinants 

In order to evaluate the determinant of square arrays of numbers larger than 2 we must first discuss 

the Laplace expansion of a determinant.   

 

We will look at a general 3 x 3 matrix  A =  

Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( .  The Laplace expansion is a way to reduce the 3x3 matrix to a sum of scalar products times 2x2 matrices.  Our first expansion will be using the second column.  We will need to look at the following submatrices.  

Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( = Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(, Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( = Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( and Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( = Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(.  Laplace's expansion  

will give then the following results  

det(A) = Typesetting:-mrow(Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo( * Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(*  Typesetting:-mrow(Typesetting:-mi( + Typesetting:-mrow(Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo(* Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(* Typesetting:-mrow(Typesetting:-mi( + Typesetting:-mrow(Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo(* Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(* Typesetting:-mrow(Typesetting:-mi(  but this expansion works for any row or column.  We would get the same number if we used the first row. 

Before we can do this we will need to define some different submatrices 

Typesetting:-mrow(Typesetting:-mi(, Typesetting:-mrow(Typesetting:-mi(   (we can use the Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( defined above) 

 

det(A) = Typesetting:-mrow(Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo(* Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi(* Typesetting:-mrow(Typesetting:-mi( + Typesetting:-mrow(Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo(* Typesetting:-mrow(Typesetting:-mi( + Typesetting:-mrow(Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo(* Typesetting:-mrow(Typesetting:-mi(
 

We apply this to a few examples at this time. 

 

> with(linalg):
 

> with(LinearAlgebra):
 

> A:=<<1|-3|4>,<-3|2|1>,<3|5|4>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> A1[1,1]:=delcols(delrows(A,1..1),1..1);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> A1[1,2]:=delcols(delrows(A,1..1),2..2);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> A1[1,3]:=delcols(delrows(A,1..1),3..3);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> DA:=det(A1[1,1])-(-3)*det(A1[1,2]) +4* det(A1[1,3]);
 

-126
 

You need to get down how to use the Laplace expansion as in the above set of commands.  The determinate is found by using the Laplace expansion using the first row.  The answer is check by using the Maple command for the determinate.   

> det(A);
 

-126
 

> A1[2,2]:=delcols(delrows(A,2..2),2..2);
 

`:=`(A1[Typesetting:-mn(
 

> A1[3,2]:=delcols(delrows(A,3..3),2..2);
 

`:=`(A1[Typesetting:-mn(
 

> DAa:=-(-3)*det(A1[1,2]) + 2*det(A1[2,2]) - 5*det(A1[3,2]);
 

-126
 

The second set of commands is to find the determinate by using the Laplace expansion about the second column.  You must obtain the same answer by using the correct expansion about any row or column.  Notice that we do not have to find A1[1,2} in the second expansion since it is has been calculated for the first expansion.   

Special Properties and Matrices 

We want to look at upper and low triangular matrices.  

 

> AU:=<<1|3|-40>,<0|4|50>,<0|0|20>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

Expand about the first column or last row.  Why? 

> AU1[1,1]:=delcols(delrows(AU,1..1),1..1);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> DAU1:=1*4*20;
 

80
 

> det(AU);
 

80
 

Notice this is just the product of the diagonal elemnts of the matrix AU.   

What happens if we have a lower triangular or diagonal matrix.? 

 

> AL:=<<-5|0|0>,<3|4|0>,<3/4|-1/400|3>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

Again we can take the producto of the diagonal which is the same as expanding about the first row of AL. 

> DAL:=(-5)*4*3;
 

-60 (3.1)
 

> det(AL);
 

-60
 

> AD:=DiagonalMatrix(<-1/2,8,1/4>,3,3);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> DAD:=(-1/2)*8*1/4;
 

-1 (3.2)
 

> det(AD);
 

-1
 

The value of the determinate for all upper triangular, lower triangular and diagonal matrices follow the same pattern as the above examples .  The value of the determinate is thus the product of the diagonal elements.   

 

We will now consider some properties of matrices that will help answer the question.   Notice that A and B differ only in the second row.  Also C have the same first and third row as A and B.  The third row of C is the sum of the elements of the elements in the second row of A and B.  The following property is one where determinates and matrices are completely different.   

A:=<<1|3|1>,<3|2|1>,<-2|3|1>>; 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> B:=<<1|3|1>,<-2|1|1>,<-2|3|1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> C:=<<1|3|1>,<1|3|2>,<-2|3|1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> det(A);
 

-3
 

> det(B);
 

-6
 

> det(A)+det(B);
 

-9
 

> det(C);
 

-9
 

The sum of the det(A) and det(B) is thus equal to the det(C).  Stop and think about what has just happened.  This tell us that the addrow command from Gausselimination will not change the value of the determinate.     

> B2:=mulrow(B,2,2);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> det(B2);
 

-12
 

Notice that we multiplied the second row of the matrix B by 2.  This in turn then means that det(B2) and be obtained from det(B) by 2*det(B).  Next we look at what happens when we swap any two row.  The swap for that follows interchanges row 2 and row 3.   

> A2:=swaprow(A,2,3);
 

`:=`(A2, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn(
 

> det(A2);
 

3
 

The sign of the new matrix obtained from the old by interchanging two row changes the sign of the det(A) but not the magnitude.  The above set of operations can now be summerized as follows:  

1.  If two matrices are the same except for one row then the sum of the determinants is equal to the matrix of the determinant obtained by adding the elements in the row which is different and leaving all the other members of the matrix the same.  addrow operations.   

 

2.  Multiplying a row by a scalar will mean that the determinant of the new matrix is exactly that scalar times the original matrix.  mulrow command  

 

3.  Interchanging row will change the sign of the matrix.   swaprow command.   

 

 

What happens if a matrix has a row of column of all zeros. 

Typesetting:-mrow(Typesetting:-mi( ?  You can answer this by expanding using the Laplace expansion of the matrix E using the second row.   As you can see the answer is zero. 

 

Next question is what happens if you have two row or columns that are proportional? 

 

 

>  F:=<<1|3|4>,<1/3|1|4/3>,<3|4|1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> F1:=addrow(F,1,2,-1/3);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

Hence, a matrix with a zero column or row has a determinate that is zero.  Also, a matrix with two columns or row that are proportional has a determinate that is zero.   We now want to look at what happens if we use Gauss elimination on a matrix to turn the matrix into a upper triangular matrix. 

 

A; 

Matrix(%id = 1246260)
 

> AA:=addrow(A,1,2,-3);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> det(AA);
 

-3
 

> AA2:=addrow(AA,1,3,2);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> AA3:=addrow(AA2,2,3,9/7);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

 

> DAA3:=1*(-7)*(3/7);
 

-3 (3.3)
 

> det(AA3);
 

-3
 

We can see that each Gauss elimination step does not change the value of the determinate.  If we have to do a row swap then we must change the sign of the determinate of the new matrix.  There were no swap row commands or mulrow commands here.  So the det(A) and det(DAA3) should be exactly the same.   

> Aa:=<<1|3|1>,<2|6|3>,<3|10|2>>;
 

Typesetting:-mrow(Typesetting:-mverbatim( (3.4)
 

> Aa1:=addrow(Aa,1,2,-2);
 

Typesetting:-mrow(Typesetting:-mverbatim( (3.5)
 

> Aa2:=addrow(Aa1,1,3,-3);
 

Typesetting:-mrow(Typesetting:-mverbatim( (3.6)
 

> Aa3:=swaprow(Aa2,2,3);
 

Typesetting:-mrow(Typesetting:-mverbatim( (3.7)
 

>
 

> det(Aa3);
 

1 (3.8)
 

> det(Aa);
 

-1 (3.9)
 

We need to keep track of all row switches if we are trying to use row operations to find the value of a determinate.  This also illustrate that taking the shortcut of gausselim will over look row swaps and hence give us the wrong answer.   

 

We will now look at the determinate of a square matrix along with its transpose. 

> AT:=A^%T;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> det(AT);
 

-3
 

Why do you expect them to be the same? 

This is because the Laplace expansion of A about the first row is the same as expanding the transpose about  its first column.   

What can you in general say about a matrix that has a zero diagonal? 

 

> G:=<<0|-5|3>,<2|0|1>,<3|1|0>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> det(G);
 

-9
 

> G1:=addrow(G,2,3,-3/2);
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

The answer now becomes  (-2)*(15/2 -3)  or -15 +6 = -9 as we predicted.   

 

Also another property of matrices that is need for the remainder of our work is the following 

Let us look at what happens if we take the product of two say 3x3 matrices and then look at the product of the determinant.  How is it related to the product of each matrix.  

 

> A;
 

Matrix(%id = 1246260)
 

> B;
 

Matrix(%id = 1251984)
 

> H:=A.B;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> det(H);
 

18
 

> det(A)*det(B);
 

18
 

It is true in general that det(A*B) = det(A)*det(B). 

 

 

We want to return to see how we can use determinants to solve square system of equations or systems of equations were the number of equations is equal to the number of unknowns.   


Consider the following system
 

Typesetting:-mrow(Typesetting:-mi(  

Typesetting:-mrow(Typesetting:-mi(
 

> A:=<<3|5>,<-4|7>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> b:=<2,4>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> Delta:=det(A);
 

41
 

Replace the first column of A with the b vector and call it X.  

> X:=<<2|5>,<4|7>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

Next, replace the ceond column of A the the vector b but use the first column of A.  The call the new matrix Y.   

> Y:=<<3|2>,<-4|4>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

The x value of the system will be the det(X)/Delta and the y value will be the det(Y)/Delta.   

> x:=det(X)/Delta;
 

-`/`(6, 41)
 

> y:=det(Y)/Delta;
 

`/`(20, 41)
 

We check our answer using gaussjord.   

> gaussjord(<A|b>);
 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn(
 

>
 

The above process of finding the x and y values as the quotient of determinants is call Crammer's Rule.  

The numerator determinate is always found by replacing the column in the coefficient matrix by the column were the variable appears by the right hand side column and then finding its determinate.  So to find the x value you replace the first column of the coefficient matrix with the right hand side and for the y value you replace the second column by the right hand side.  Both determinants are then divided by the determinate of the coefficient matrix to produce the desired value of x and y.    If you look on page 38 and 39 of your Maple manual you will find the steps to solve a 3x3 system using Crammer's Rule.    Notice that the 3x3 example in the Maple manual in your text uses the old notation for matrices and agumenting  a vector with a matrix.    

Exercises 1.6 

Exercises are due on September 19,  2008.  The exercises are to be done in Maple11 or Maple 12following the instruction for each problem.  You can hand in a hard copy of the worksheet or e-mail me a copy.   

1.6.1 (use text to find the answer.  Give the product and difference.  Not just the answer.  1.6.5 expand about the second row and use det command to check your answer.  1.6.9 expand about the fourth column. Use det to check your answer. 1.6..13.  1.6.20 (state why you obtained your answer . You should be able to answer 1.6.13 and 1.6.20 without using Maple.  This is an illustration of one of the fundamental properties).  1.6.23, 1.6.32, 1.6.40. For problems 1.6.23, 1.6.32 and 1.6.40 you can use the det command.