The 2x2 Determinant
Learning objectives
- Compute the determinant of a 2x2 matrix
- Interpret the determinant geometrically as a signed area
- Determine when a 2x2 matrix is invertible
Every square matrix has a single number attached to it called the determinant. That number answers two questions at once: is the matrix invertible? and how much does the matrix stretch area? The formula for the case is short enough to memorise; the picture behind it is short enough to draw on a napkin. Together they unlock the rest of the chapter.
The formula
For a matrix,
\det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc.
Cross-multiply along the main diagonal (top-left to bottom-right), subtract the cross-multiply along the off-diagonal. Either notation works: or the vertical-bar shorthand \begin{vmatrix} a & b \\ c & d \end{vmatrix}.
The geometric meaning
Take the two columns of as vectors in the plane: and . They span a parallelogram. The signed area of that parallelogram equals . Absolute value gives the area; the sign tells you orientation, positive means rotates counterclockwise to reach , negative means clockwise.
- Computer Graphics: The signed area of a parallelogram is \det\begin{pmatrix} a & c \\ b & d \end{pmatrix}; this is how a polygon-fill algorithm tests whether a triangle is wound clockwise or counter-clockwise.
- Physics: The Jacobian determinant measures how a change-of-coordinates scales areas; this is what makes polar-coordinate integration give the right answer.
- Computer Vision: Detecting features (Harris corner detector) uses the determinant of the structure tensor; a vanishing determinant signals a flat patch with no detectable corner.
(Drag the green or orange . The shaded parallelogram is what the unit square [0,1] \times [0,1] becomes after the linear map . When and are nearly parallel the area collapses toward zero; when they cross over each other the centroid label changes to (flipped), that is the sign of the determinant changing.)
The invertibility test
The determinant is zero exactly when the two columns are parallel, when and lie along the same line. In that case the matrix squashes the whole plane onto a single line (or a single point), and there is no way to undo the squashing: the matrix is singular. Otherwise the matrix is invertible, and the inverse has a tidy closed form:
A^{-1} = \frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}.
Swap the diagonal entries, negate the off-diagonal entries, divide through by the determinant. Verify by multiplying: falls out.
Two useful identities
Without proof at this stage, two identities you will use again and again:
- Product rule: .
- Transpose rule: .
The product rule is striking. Matrices generally do not commute, yet their determinants do, because the determinant is a single number, and numbers always commute. Geometrically: if scales area by and scales by , then applying them in either order scales by the product.
Try it
- Predict first: for and , what is \det\begin{pmatrix} 3 & 1 \\ 1 & 4 \end{pmatrix}? Drag the columns to set those values and verify the readout shows with parallelogram area .
- Predict first: when is a scalar multiple of , what should equal, and what does that say about the matrix? Slide until it lines up with and verify the parallelogram collapses and (the matrix is singular).
- Drag the columns to a configuration where exactly (e.g., , ).
- By hand, find the inverse of \begin{pmatrix} 2 & 1 \\ 5 & 3 \end{pmatrix}. Check .
Pause: if , the matrix sends the unit square to something with zero area. Geometrically, what does that mean for the equation , can you always recover uniquely?
Try it in code
A trap to watch for
The product rule tempts beginners to write . Wrong. Test with : , but . The determinant is multiplicative under matrix multiplication, not under addition. There is no useful linear identity for sums of matrices.
A second trap: confusing the "matrix" with the scalar . They look identical and behave identically under arithmetic, but in formulas like the dimension matters. For a matrix you get ; for it is just . Always check the size before applying a scalar rule.
What you now know
You can compute the determinant of any matrix, interpret it as the signed area of the parallelogram spanned by the columns, decide invertibility by checking for zero, and write down when it exists. The next section catalogues the properties of determinants, row swaps, row scaling, the effect of , the consequence of dependent rows, so you can shortcut computations without expanding.
Quick check
Mark section complete →
References
- Lang, S. (1971). Basic Mathematics. Springer. Chapter 17, §2, the canonical definition of for the case.
- Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. Chapter 5: determinants as signed area / volume with the geometric pictures used here.
- Axler, S. (2015). Linear Algebra Done Right (3rd ed.). Springer. Chapter 10: an axiomatic, basis-free treatment of the determinant.
- Hoffman, K.; Kunze, R. (1971). Linear Algebra (2nd ed.). Prentice-Hall. Chapter 5: the full proof of the product rule .