# How do you find a determinant of a square matrix in maths?

For a 2x2 matrix, with elements a, b, c and , the determinant is ad - bc.

However, for larger matrices it is more complicated. It would have been neater to illustrate this if I could use subscripts but the browser that we are required to use is pretty basic and therefore rubbish!

Suppose the elements of an n*n matrix are x(i,j) where i is the row and j is the column. Consider the product x(1, j1)*x(2,j2)*...*x(n,jn) where all the all the js are different. [This is the product of n elements of the matrix such that there is one element from each row and one from each column.] There are n! = n*(n-1)*...*2*1 such terms.

Now swap pairs of these term so that the js are in ascending order. For each swap, change the sign of the term so a term requiring an odd number of swaps will have a negative sign and one requiring an even number (including 0 swaps) will be positive.

Add these terms together.

The following is an illustration for a 3x3 matrix. The 3! = 3*2*1 = 6 terms are:

t1 = x(1,1)*x(2,2)*x(3,3)

t2 = x(1,1)*x(2,3)*x(3,2) = - x(1,1)*x(3,2)*x(2,3) swap second and third

t3 = x(1,2)*x(2,1)*x(3,3) = - x(2,1)*x(1,2)*x(3,3) swap first and second

t4 = x(1,2)*x(2,3)*x(3,1) = x(3,1)*x(1,2)*x(2,3) swap first and third, swap second and new third

t5 = x(1,3)*x(2,1)*x(3,2) = x(2,1)*x(3,2)*x(1,3) swap first and second, swap new second and third

t6 = x(1,3)*x(2,2)*x(3,1) = - x(3,1)*x(2,2)*x(1,3) swap first and third.

The determinant is t1+t2+t3+t4+t5+t6

= x(1,1)*x(2,2)*x(3,3) - x(1,1)*x(3,2)*x(2,3) - x(2,1)*x(1,2)*x(3,3) + x(3,1)*x(1,2)*x(2,3) + x(2,1)*x(3,2)*x(1,3) - x(3,1)*x(2,2)*x(1,3)

Group theory ensures that the order in which you do the swaps and the parity (odd or even number) is determined by the order of the js and so fixed for each of these terms. Half the terms will be positive and half negative.