# Sarrus rule

Sarrus's rule is a method that allows you to quickly calculate the determinant of a square matrix with dimension 3 × 3 or greater.

In other words, Sarrus's rule consists of drawing two sets of two opposite triangles using the elements of the matrix. The first set will be 2 triangles that will cross the main diagonal and the second set will be 2 triangles that will cross the secondary diagonal.

We define:

DP_T1: First triangle that crosses the main diagonal (DP) of the matrix.

DP_T2: Second triangle that crosses the main diagonal (DP) of the matrix.

DS_T1: First triangle that crosses the secondary diagonal (DS) of the matrix.

DS_T2: Second triangle that crosses the secondary diagonal (DS) of the matrix.

### Procedure

Mathematically, we define the Z3 × 3 matrix as:

- We draw the main diagonal (DP) above the Z3 × 3 matrix:

DP = {z11, z22, z33}.

2. We draw the first set of triangles that cross the main diagonal:

- First triangle (marked in red) (T1):

DP_T1 = {z21, z32, z13}.

- Second triangle (marked in white) (T2):

DP_T2 = {z12, z23, z31}.

This second triangle does not need to be marked as it is drawn as the opposite or complementary to the first.

3. Multiplication of the elements of the main diagonal, the first triangle and the second.

- DP = z11z22z33
- T1 = z21z32z13
- T2 = z12z23z31

Once multiplied, we add them:

- DP + T1 + T2 = (z11z22z33) + (z21z32z13) + (z12z23z31)

4. We draw the secondary diagonal (DS) above the Z3 × 3 matrix:

DS = {z31, z22, z13}.

5. We draw the first set of triangles that cross the main diagonal:

- First triangle (marked in pink) (T1):

DP_T1 = {z11, z32, z23}.

- Second triangle (marked in white) (T2):

DP_T2 = {z21, z12, z33}.

This second triangle does not need to be marked as it is drawn as the opposite or complementary to the first.

6. Multiplication of the elements of the secondary diagonal, the first triangle and the second:

- DS = z31z22z13
- T1 = z11z32z23
- T2 = z21z12z33

Once multiplied, we subtract them:

- - DS - T1 - T2 = - (z31z22z13) - (z11z32z23) - (z21z12z33)

7. Once we have the 2 triangles that cross the main diagonal and the 2 triangles that cross the secondary diagonal, we put both results together and we obtain the determinant of the matrix Z3 × 3.

Determinant of Z3 × 3 = | Z3 × 3 | = DP + T1 + T2- DS - T1 - T2 = (z11 z22 z33) + (z21 z32 z13) + (z12 z23 z31) - (z31 z22 z13) - (z11 z32 z23) - (z21z12z33)

## Sarrus rule example

Find the determinant of the matrix A3 × 3: