In many applications we will use the notion of determinant of a matrix. The determinant of a matrix makes sense for square matrices only and is defined recursively:
where is matrix with -th row and -th column crossed out. So (the determinant is denoted by or by using absolute value style brackets around a matrix):
And so on. E.g.:
The above definition is only a special case of a more general fact called Laplace expansion. Instead of using the first row we can use any row or column (choose always the one with most zeros). So:
for any row . Analogical fact is true for any column.
E.g. for the below matrix it is easiest to use the third column:
Determinant and operations on a matrix
Notice first that from the Laplace expansion we easily get that if a matrix has a row of zeros (or column) its determinant equals zero.
Consider now different operations on rows of a matrix, which we use to calculate a ,,stair-like” form of a matrix. Using Laplace expansion we can prove that swapping two rows multiplies the determinant by — indeed calculating the determinant using the first column we see that the signs in the sum may change, but also the rows in the minor matrices get swapped.
Immediately we can notice that multiplying a row by a number multiplies also the determinant by this number — you can see it easily calculating Laplace expansion using this row.
Therefore multiplying whole matrix by a number multiplies the determinant by this number many times, precisely:
where is a matrix of size .
Notice also, that the determinant of a matrix with two identical rows equals zero, because swapping those rows does not change the matrix but multiplies the determinant by , so , therefore . So because of the row multiplication rule, if two rows in a matrix are linearly dependent, then its determinant equals .
Also the Laplace expansion implies that if matrices , , differ only by -th row in the way that this row in matrix is a sum of -th rows in matrices and , then the determinant of is the sum of determinants of and , e.g.:
But it can be easily seen that in general !
Finally, consider the most important operation of adding to a row another row multiplied by a number. Then we actually deal with the situation described above. The resulting matrix is matrix , which differs from and only by the row we sum to. Matrix is the original matrix and matrix is matrix , in which we substitute the row we sum to with the row we are summing multiplied by a number. Therefore , but has two linearly dependent rows, so and . Therefore the operation of adding a row multiplied by a number to another row does not change the determinant of a matrix.
Finally, the matrix multiplication. All the above operations can be written as multiplication by a special matrix. E.g. swapping of -nd and -rd rows in a matrix of size , is actually the following:
multiplication of the -rd row by scalar , is:
adding to the third row the second multiplied by is:
It is relatively easy to see that even in the general case the matrix, which changes rows has determinant , the matrix multiplying a row by scalar , has determinant , and matrix of adding to a row another row multiplied by a scalar has determinant . Therefore multiplying by those matrices (called the elementary matrices) multiplies the determinant of a matrix by their determinants. Moreover, every matrix can be created by multiplying elementary matrix, which gives the following important conclusion:
Calculating the determinant via triangular form of matrix
If you look closely enough you will see that the Laplace expansion also implies that the determinant of a matrix in an echelon form (usually called triangular for square matrices) equals the product of elements on the diagonal of the matrix, so e.g.:
Because we know how the elementary operations change, to calculate the determinant of a matrix we can calculate a triangular form, calculate its determinant and recreate the determinant of the original matrix. This method is especially useful for large matrices, e.g.:
Therefore, the determinant of the last matrix is . On our way we have swapped rows once and we have multiplied one row by , therefore the determinant of the first matrix equals .
The above fact also implies how to calculate the determinant of a matrix which is in the block form: with left bottom block of zeros. The determinant of such a matrix equals , e.g.: