Defining determinants¶
A determinant is a function that takes in a square matrix and outputs a number. For $2 \times 2$ matrices, it represents the area of a parallelogram with the vectors as sides, possibly with a minus sign front.
TODO: define in detail, add animation, explain
The determinant of a $3 \times 3$ matrix is the volume of a parallelepiped, possibly with a minus sign in front. A parallelepiped is similar to a parallelogram in 2D, and looks like this:
TODO: find animation and put it here
A 3D determinant is positive when (TODO: finish this definition)
Examples:
- If a $2 \times 2$ determinant contains the same row twice, it is zero, because the parallelogram is flat, and it has zero area. This also happens if one row is a multiple of the other. The same works with $3 \times 3$ determinants.
- The determinant of the $2 \times 2$ identity matrix is $$ \det\begin{bmatrix}\red1&\red0\\\blue0&\blue1\end{bmatrix}=1, $$ because the first row $\red{(1,0)}$ and the second row $\blue{(0,1)}$ form the sides of a square with side length $1$ and area $1^2 = 1$, and an arrow from $\red{(1,0)}$ to $\blue{(1,0)}$ along the square goes counter-clockwise. (TODO: draw picture)
- $\det(I)=1$ works with $3 \times 3$ determinants too. The unit vectors are the sides of a cube, with side length 1 and therefore volume $1^3 = 1$. (TODO: sign of determinant) (TODO: draw picture)
- Let's swap the rows of the $2 \times 2$ identity matrix. The rows are still the sides of a square, so the area remains the same, but the arrow from top row to bottom row now goes in a different direction. TODO: draw picture Therefore $$ \det\begin{bmatrix}\blue0&\blue1\\\red1&\red0\end{bmatrix} = -1. $$ This happens when swapping the rows of any $2 \times 2$ determinant. It also works when swapping any two rows of a $3 \times 3$ determinant: the volume obviously doesn't change, and the sign flips in all cases, because of how it is defined. Let me know if you want to see more details about this.
Linearity¶
TODO: doubling first row doubles determinant
TODO: -2 times first row --> -2 times determinant
TODO: adding rows
Defining $n \times n$ determinants¶
As explained at the end of the introduction page, it is often useful to use linear algebra with higher dimensions than 2 or 3. To do that, we will next define $n \times n$ determinants in a way that works regardless of size.
An $n$-dimensional determinant, denoted with $\det$, is any function that takes $n \times n$ matrices as inputs and outputs numbers, and satisfies these properties:
- $\det(I) = 1$.
- Swapping any two rows of a matrix changes the sign of the determinant, but does not affect the absolute value.
- The determinant is linear as a function of each row. In other words, if $f$ is a function that takes in a vector $\vec v$ and outputs a determinant with $\vec v$ as one of the rows, then $f(\vec v +\vec w) = f(\vec v) + f(\vec w)$.
Based on the derivations on this page, what we called "$2 \times 2$ determinant" and "$3 \times 3$ determinant" are determinants, according to this definition.
TODO: explain what goes on in the following, and write it in mathjax:
det[[a,b,c],[d,e,f],[g,h,i]] =color(red)(adet[[1,0,0],[d,e,f],[g,h,i]]) +bdet[[0,1,0],[d,e,f],[g,h,i]] +cdet[[0,0,1],[d,e,f],[g,h,i]] >--- color(red)(adet[[1,0,0],[d,e,f],[g,h,i]]) =ad[[1,0,0],[1,0,0],[g,h,i]] +ae[[1,0,0],[0,1,0],[g,h,i]] +af[[1,0,0],[0,0,1],[g,h,i]] >--- ae[[1,0,0],[0,1,0],[g,h,i]] =aegdet[[1,0,0],[0,1,0],[1,0,0]] +aeh[[1,0,0],[0,1,0],[0,1,0]] +aei[[1,0,0],[0,1,0],[0,0,1]]