If we use the letters p, q, r, ..., x to represent the elements of a 3×3 matrix:

( p q r )

( s t u )

( v w x )

then we calculate the determinant as follows:

p(tx-uw)-q(sx-uv)+r(sw-tv). The elements outside the parentheses form the top row. The middle element of the top row is negated as you can see. The contents of the parentheses is controlled by the element at the top of the column. Element p eliminates the p row and p column, leaving products formed by multiplying elements in the remaining 2×2 matrix. Similarly q eliminates the q row and column, and r eliminates the r row and column.