The 2x2 Determinant

Chapter 18, Matrices and Determinants

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 2×22 \times 2 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 2×22 \times 2 matrix,

det⁡(abcd)=ad−bc.\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: det⁡(A)\det(A) or the vertical-bar shorthand ∣abcd∣\begin{vmatrix} a & b \\ c & d \end{vmatrix}.

The geometric meaning

Take the two columns of AA as vectors in the plane: 𝐮=(a,c)\mathbf{u} = (a, c) and 𝐯=(b,d)\mathbf{v} = (b, d). They span a parallelogram. The signed area of that parallelogram equals det⁡(A)\det(A). Absolute value gives the area; the sign tells you orientation, positive means 𝐮\mathbf{u} rotates counterclockwise to reach 𝐯\mathbf{v}, negative means clockwise.

Where this shows up
  • Computer Graphics: The signed area of a parallelogram is det⁡(acbd)\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 ∂(x,y)/∂(u,v)\partial(x,y)/\partial(u,v) measures how a change-of-coordinates scales areas; this is what makes polar-coordinate integration r dr dθr\,dr\,d\theta 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.

Determinant AreaInteractive figure, enable JavaScript to interact.

(Drag the green 𝐮\mathbf{u} or orange 𝐯\mathbf{v}. The shaded parallelogram is what the unit square [0,1]×[0,1][0,1] \times [0,1] becomes after the linear map AA. When 𝐮\mathbf{u} and 𝐯\mathbf{v} 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 𝐮\mathbf{u} and 𝐯\mathbf{v} 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=1ad−bc(d−b−ca).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: AA−1=IA A^{-1} = I falls out.

Two useful identities

Without proof at this stage, two identities you will use again and again:

  • Product rule: det⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A) \det(B).
  • Transpose rule: det⁡(AT)=det⁡(A)\det(A^T) = \det(A).

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 AA scales area by det⁡(A)\det(A) and BB scales by det⁡(B)\det(B), then applying them in either order scales by the product.

Try it

  • Predict first: for 𝐮=(3,1)\mathbf{u} = (3, 1) and 𝐯=(1,4)\mathbf{v} = (1, 4), what is det⁡(3114)\det\begin{pmatrix} 3 & 1 \\ 1 & 4 \end{pmatrix}? Drag the columns to set those values and verify the readout shows det⁡=11\det = 11 with parallelogram area =11= 11.
  • Predict first: when 𝐯\mathbf{v} is a scalar multiple of 𝐮\mathbf{u}, what should det⁡\det equal, and what does that say about the matrix? Slide 𝐯\mathbf{v} until it lines up with 𝐮\mathbf{u} and verify the parallelogram collapses and det⁡=0\det = 0 (the matrix is singular).
  • Drag the columns to a configuration where det⁡=6\det = 6 exactly (e.g., 𝐮=(3,0)\mathbf{u} = (3, 0), 𝐯=(0,2)\mathbf{v} = (0, 2)).
  • By hand, find the inverse of (2153)\begin{pmatrix} 2 & 1 \\ 5 & 3 \end{pmatrix}. Check A−1A=IA^{-1} A = I.

Pause: if det⁡(A)=0\det(A) = 0, the matrix sends the unit square to something with zero area. Geometrically, what does that mean for the equation A𝐱=𝐛A\mathbf{x} = \mathbf{b}, can you always recover 𝐱\mathbf{x} uniquely?

Try it in code

PYTHON · OPTIONALRun ▷1deffactorial(n):2ifn <= 1:3return14returnn * factorial(n - 1)Write a working solution, click Run, see the test results inline.

A trap to watch for

The product rule det⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A)\det(B) tempts beginners to write det⁡(A+B)=det⁡(A)+det⁡(B)\det(A + B) = \det(A) + \det(B). Wrong. Test with A=B=I2A = B = I_2: det⁡(A+B)=det⁡(2I2)=4\det(A + B) = \det(2I_2) = 4, but det⁡(A)+det⁡(B)=1+1=2\det(A) + \det(B) = 1 + 1 = 2. 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 1×11 \times 1 "matrix" (a)(a) with the scalar aa. They look identical and behave identically under arithmetic, but in formulas like det⁡(cA)=cndet⁡(A)\det(cA) = c^n \det(A) the dimension nn matters. For a 2×22 \times 2 matrix you get det⁡(cA)=c2det⁡(A)\det(cA) = c^2 \det(A); for 1×11 \times 1 it is just cdet⁡(A)c \det(A). Always check the size before applying a scalar rule.

What you now know

You can compute the determinant of any 2×22 \times 2 matrix, interpret it as the signed area of the parallelogram spanned by the columns, decide invertibility by checking for zero, and write down A−1A^{-1} when it exists. The next section catalogues the properties of 2×22 \times 2 determinants, row swaps, row scaling, the effect of cAcA, 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, Section 2, the canonical definition of det⁡\det for the 2×22 \times 2 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 det⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A)\det(B).

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.