### Definition

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):

therefore:

And so on. E.g.:

### Laplace expansion

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.:

Now we will make use of determinants and along the way introduce the notion of inverse matrix.

### Inverse matrix

A matrix is inverse to matrix , if , where is the identity matrix (the matrix with ones on the diagonal and zeros everywhere else). The inverse matrix is denoted as . Since and , we see that . This implies that only matrices with non-zero determinants can have their inverses. Therefore we call such matrices invertible.

How to calculate the inverse of a given matrix? We have mentioned recently that the operations on rows of a matrix leading to the reduced “stair-like” for is actually multiplication by a matrix. Imagine that we transform the matrix consisting of matrix along with the identity matrix into the reduced “stair-like” form. Since is a square matrix with non-zero determinant, we will get identity matrix on the left side: . But notice that if is the matrix of rows operations, then . Therefore and . The first equation implies that . The second that . So we get the inverse matrix on the right after those operations!

E.g. let us calculate the inverse of the following matrix:

So:

And therefore:

### Determining one element of the inverse matrix

If you do not need the whole matrix but some elements only, the following method seems useful. It uses the adjugate matrix to the given one. The adjugate matrix is a matrix in which in -th row and -th column we have the determinant of matrix (matrix without -th row and -th column, there is no mistake there, a transposition plays a role here) multiplied by . The following equation holds:

Therefore if we would like to calculate the value in the second row and first column of from the previous example we cross out the second column an the first row of and calculate the determinants, and get:

which agrees with the result obtained by the first method!

### Cramer’s rule

Given a system of equations with variables we may try to solve it with Cramer’s rule. Let be the matrix of this system without the column of free coefficients. Let be the matrix , in which instead of -th column we put the column of free coefficients. Then:

- if , the system has exactly one solution. The solution is given by the following formula: ,
- if , and at least one of is not equal to , the system has no solutions,
- if and for every , , there can be zero or infinitely many solutions — Cramer’s method does not give any precise answer.

E.g. let us solve the following system of equations:

Therefore:

Since , this system has exactly one solution. To determine it we calculate the other determinants:

And so , , .