### Computation of Determinant

##### 1. Row/Column operations

In general, determinants are defined for square matrices. Nonsquare matrices do not have determinants. Except for 2 by 2 or perhaps 3 by 3 matrices, the determinant is never computed by the formula in the definition. The computation is usually done by combining two methods.

- row/column operations to simply matrices (i.e., creating zeros)
- cofactor expansion to reduce the size of matrices

We discuss the first method in this section and the second method in the next section.

The row operations change the determinant as follows. The change by the column operations is similar.

`A` changed to `B` by |
determinant changed by |

`r`[row `i`] + [row `j`] |
`det`**B** = `det`**A** |

[row `i`] ↔ [row `j`] |
`det`**B** = - `det`**A** |

`d`[row `i`], `d` ≠ 0 |
`det`**B** = `d det`**A** |

The proof of the property will be given here, after the rigorous definition of determinants.

For the column operations on 2 by 2 matrices, the changes can be explained by the geometric meaning of the determinant. We will see later that `det`**A** = `det`**A**^{T}, which means that there is no difference between rows and columns as long as the determinant is concerned. Then the geometric explaination also applies to the row operations.

The following pictures compare `det`[**u v**] (the red part) with `det`[**u** r**u** + **v**] (the blue part). The left one has `r` > 0, and the right one has `r` < 0. In either case, the red and the blue parallelograms have the same base and height. Moreover, the orientation from `u` to `v` is the same as the orientation from `u` to `r`**u** + **v** (you are encouraged to draw the pictures for the case `u` moves to `v` in clockwise direction). With the same volume and orientation, we conclude `det`[**u** r**u** + **v**] = `det`[**u v**].

The following picture compares `det`[**u v**] with `det`[**v u**]. The switching of the two vectors do not change the parallelogram. Howover, the orientation from `v` to `u` (the blue arrow) is the opposite of the orientation from `u` to **v** (the red arrow). With the same volume and different orientation, we conclude `det`[**v u**] = - `det`[**u v**].

The following pictures compare `det`[**u v**] (the red part) with `det`[`d`**u v**] (the blue part). The left one has `d` > 0, and the area of the blue parallelogram is `d` times of the red one. Moreover, the orientation from **u** to `v` is the same as the orientation from `d`**u** to `v`. Thus we conclude `det`[`d`**u v**] = `d det`[**u v**] for the case `d` > 0. The right picture shows the case `d` < 0. In this case, the area of the blue parallelogram is |`d`| = - `d` times of the red one. On the other hand, the orientation from **u** to `v` is different from the orientation from `d`**u** to `v`. Therefore `det`[`d`**u v**] = - |`d`|`det`[**u v**] = `d det`[**u v**].

Example The determinant

`det`[ |
6 |
2 |
] = 6×3 - (-1)×2 = 20 |

-1 |
3 |

consists of 2 terms. If we do 6[row 2] + [row 1], then

`det`[ |
6 |
2 |
] = `det`[ |
0 |
20 |
] = 0×3 - (-1)×20 = - (-1)×20
= 20 |

-1 |
3 |
-1 |
3 |

consists of only one term. We see from the example that
the more zeros we create, the fewer terms we need to compute.

The advantage of using row/column operations in computing
the determinants is more apparent for 3 by
3 matrices. For example,

`det`[ |
1 |
-1 |
1 |
] = (-1)×(-1)×1 + 1×3×3
- 1×1×1 - 1×(-1)×3 = 12 |

3 |
1 |
-1 |

1 |
3 |
0 |

consists of essentially 4 terms (the terms containing zero are omitted). If
we use (-3)[col 1] + [col 2] and [row 1] + [row 2], then we get

`det`[ |
1 |
-1 |
1 |
] = `det`[ |
1 |
-4 |
1 |
] = `det`[ |
1 |
-4 |
1 |
] = - 1×(-12)×1 = 12. |

3 |
1 |
-1 |
3 |
-8 |
-1 |
4 |
-12 |
0 |

1 |
3 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |