Monocurl Essays
Series Download

The determinant is how much area gets scaled

A matrix multiplies every area in the plane by one number, ad - bc. That explains its sign, why det(AB) = det(A)det(B), and which matrices can be undone.

23 min·Early college·

AssumesA matrix is a transformation of spaceWhy matrix multiplication is defined the way it is

The unit square (dashed) under a matrix that changes in three stages, ending at the matrix with columns $(3, 1)$ and $(1, 2)$. The green region is where the square has gone, and the number is its area: 1 at the start, 5 at the end.
Monocurl source
let Deform = |a, b, c, d| [
    Lines(Bd, [a, b, c, d]),
    Para(Bd, [a, b, c, d]),
    Arrows(Bd, [a, b, c, d]),
    MatBox([2.6, 0.8, 0], [a, b, c, d], 1),
    center{[2.6, -1.0, 0]} scale{1.5} color{LEAF} Number(a * d - b * c, 2)
]
let go = |&m, a, b, c, d| anim {
    m.a = a
    m.b = b
    m.c = c
    m.d = d
    play Lerp(1.8, [&m])
    play Wait(0.7)
}
mesh ground = Ground(Bd)
mesh deform = Deform(a: 1, b: 0, c: 0, d: 1)
mesh square = UnitSquare(Bd)
mesh label = [center{[2.6, -0.4, 0]} Note("area of the green region", 0.72)]

slide "deform"
    play Wait(0.7)
    play go(&deform, 2, 0, 0, 1.5)
    play go(&deform, 2, 1, 0, 1.5)
    play go(&deform, 3, 1, 1, 2)
    play Wait(1.4)

Uses the shared definitions for this lesson's figures.

Take the matrix

$$ A = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix} $$

and apply it to a shape in the plane: a square, a disc, the outline of a country on a map. The shape is stretched and slanted, and its area changes. Here is a claim that ought to sound too strong. The area is multiplied by 5, whichever shape you chose and wherever it was. And the 5 can be read off the entries: $3 \cdot 2 - 1 \cdot 1$.

That one number is the determinant of $A$. Most courses introduce it as the formula $ad - bc$ and leave its meaning for later. We go the other way: start from the question “how much does this matrix scale area?”, find that the answer is $ad - bc$, and get the determinant’s main properties from the meaning.

Here is what I use from the earlier lessons. A $2 \times 2$ matrix $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ is a transformation of the plane: it sends $\mathbf{i} = (1, 0)$ to its first column $(a, c)$, sends $\mathbf{j} = (0, 1)$ to its second column $(b, d)$, and sends $(x, y)$ to $x\,(a, c) + y\,(b, d)$. Such a map $T$ is linear, meaning $T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v})$ and $T(k\,\mathbf{v}) = k\,T(\mathbf{v})$. The product $AB$ is the matrix of “apply $B$, then $A$”, so $(AB)\mathbf{v} = A(B\mathbf{v})$.

One square speaks for all of them

Why should a single number describe what $A$ does to every area? Start with the simplest region, the unit square with corners $(0, 0)$, $(1, 0)$, $(1, 1)$, $(0, 1)$. Its sides are $\mathbf{i}$ and $\mathbf{j}$, so $A$ sends it to the parallelogram whose sides are the two columns of $A$. In the animation that is the green region.

Now take any other square with horizontal and vertical sides: say its lower-left corner is at $\mathbf{p}$ and its side is $s$. Its points are $\mathbf{p} + x\,\mathbf{i} + y\,\mathbf{j}$ with $0 \le x, y \le s$, and linearity sends them to $A\mathbf{p} + x\,A\mathbf{i} + y\,A\mathbf{j}$. That is the parallelogram with sides $s\,A\mathbf{i}$ and $s\,A\mathbf{j}$, moved to start at $A\mathbf{p}$. It is the green parallelogram scaled by $s$ and shifted, so its area is $s^2$ times the green area. The square’s own area was $s^2$. So every such square, large or small, has its area multiplied by the same factor: the area of the image of the unit square.

A region that can be cut into squares therefore scales by that factor too, and a curved region can be approximated by many small squares. We will come back to make this precise. First we need the factor itself.

Pause and try

The image of the unit square under $A$ is the parallelogram with corners $(0, 0)$, $(3, 1)$, $(4, 3)$ and $(1, 2)$. Find its area with school geometry. One way: draw the smallest rectangle with horizontal and vertical sides that contains it, and subtract what is not parallelogram.

Show answerHide answer

The rectangle runs from $(0, 0)$ to $(4, 3)$ and has area 12. Outside the parallelogram it contains two right triangles with legs 3 and 1 (area 1.5 each), two right triangles with legs 1 and 2 (area 1 each), and two unit squares in the corners. So the parallelogram has area $12 - 3 - 2 - 2 = 5$.

  1. The unit square has gone to the parallelogram with sides (3, 1) and (1, 2).
  2. Box it in. The rectangle from (0, 0) to (4, 3) has area 4 x 3 = 12.
  3. Remove two triangles with legs 3 and 1. Each has area 1.5.
  4. Remove two triangles with legs 1 and 2. Each has area 1.
  5. Remove the two corner squares, each 1 by 1.
  6. What is left is the parallelogram: 12 - 3 - 2 - 2 = 5.
The area of the parallelogram with sides $(3, 1)$ and $(1, 2)$, found by boxing it in a 4 by 3 rectangle and removing two pairs of triangles and two corner squares: $12 - 3 - 2 - 2 = 5$.
Monocurl source
let a = A[0]
let b = A[1]
let c = A[2]
let d = A[3]
let Q = |x, y| P(Bd, [x, y])
let Line2 = |y, tex, col| center{[2.6, y, 0]} Math(tex, 0.9, col)
mesh ground = Ground(Bd)
mesh box = []
mesh pieces = []
mesh para = Para(Bd, A)
mesh arrows = Arrows(Bd, A)
mesh tally = [Line2(1.4, "\text{area} = \ ?", LEAF)]

slide "The unit square has gone to the parallelogram with sides (3, 1) and (1, 2)."
    play Fade(0.5)

slide "Box it in. The rectangle from (0, 0) to (4, 3) has area 4 x 3 = 12."
    box = Outline([Q(0, 0), Q(a + b, 0), Q(a + b, c + d), Q(0, c + d)], INK, 3.5)
    tally = [Line2(1.4, str_join([to_string((a + b) * (c + d)), "\ \text{(rectangle)}"]), INK)]
    play Fade(0.6, [&box, &tally])

slide "Remove two triangles with legs 3 and 1. Each has area 1.5."
    pieces = [
        Shape([Q(0, 0), Q(a, 0), Q(a, c)], AZURE, 0.35, 2),
        Shape([Q(b, d), Q(a + b, c + d), Q(b, c + d)], AZURE, 0.35, 2)
    ]
    tally .= Line2(0.8, str_join(["-\ 2 \times ", to_string(a * c / 2, 1)]), AZURE)
    play Fade(0.6, [&pieces, &tally])

slide "Remove two triangles with legs 1 and 2. Each has area 1."
    pieces .= Shape([Q(0, 0), Q(b, d), Q(0, d)], EMBER, 0.35, 2)
    pieces .= Shape([Q(a, c), Q(a + b, c), Q(a + b, c + d)], EMBER, 0.35, 2)
    tally .= Line2(0.2, str_join(["-\ 2 \times ", to_string(b * d / 2, 1)]), EMBER)
    play Fade(0.6, [&pieces, &tally])

slide "Remove the two corner squares, each 1 by 1."
    pieces .= Shape([Q(a, 0), Q(a + b, 0), Q(a + b, c), Q(a, c)], PLUM, 0.35, 2)
    pieces .= Shape([Q(0, d), Q(b, d), Q(b, c + d), Q(0, c + d)], PLUM, 0.35, 2)
    tally .= Line2(-0.4, str_join(["-\ 2 \times ", to_string(b * c, 1)]), PLUM)
    play Fade(0.6, [&pieces, &tally])

slide "What is left is the parallelogram: 12 - 3 - 2 - 2 = 5."
    tally .= Line2(-1.1, str_join(["=\ ", to_string((a + b) * (c + d) - a * c - b * d - 2 * b * c)]), LEAF)
    play Fade(0.6, [&tally])

Uses the shared definitions for this lesson's figures.

The formula ad - bc

Run the same dissection with letters. Let the columns be $(a, c)$ and $(b, d)$, and suppose for now that the picture looks like the one above: all four numbers positive and the second column steeper than the first. The bounding rectangle is $a + b$ wide and $c + d$ tall. The triangles under and over the first column have legs $a$ and $c$; the triangles beside the second column have legs $b$ and $d$; the corner pieces are $b$ by $c$ rectangles. So

$$ \text{area} = (a + b)(c + d) - 2 \cdot \tfrac12 ac - 2 \cdot \tfrac12 bd - 2bc = ac + ad + bc + bd - ac - bd - 2bc = ad - bc. $$

For our matrix, $3 \cdot 2 - 1 \cdot 1 = 5$. If you have read the lesson on vectors, this is the number $D = u_1 v_2 - u_2 v_1$ that decided whether two vectors $\mathbf{u}, \mathbf{v}$ form a basis.

This is a derivation for one arrangement of the picture, and you should distrust it for others. If $b$ is negative the second column leans left and the pieces sit differently. If the second column is less steep than the first, the formula gives a negative number, which cannot be an area. Try $\begin{pmatrix} 1 & 3 \\ 2 & 1 \end{pmatrix}$, our matrix with its columns swapped: the parallelogram is the same one, of area 5, yet $ad - bc = 1 - 6 = -5$. So $ad - bc$ carries a sign that the area does not, and the sign reacted to the order of the columns. We need an argument that handles every case and explains the sign.

A proof for every case, and what the sign means

The argument uses a different fact about parallelograms: the area is base times height, so sliding one side along its own direction changes nothing. Let $\mathbf{u} = (a, c)$ be the first column and $\mathbf{v} = (b, d)$ the second, and take $\mathbf{u}$ as the base. Slide the opposite side along the direction of $\mathbf{u}$ until the parallelogram stands upright as a rectangle.

Sliding the top side of the parallelogram parallel to the base $\mathbf{u} = (3, 1)$. The base and the height (dashed) do not change, so neither does the area. At the end the orange side is perpendicular to the base and the region is a rectangle.
Monocurl source
let u0 = [3, 1]
let Slide = |t| {
    let w = [1 - 1.5 * t, 2 - 0.5 * t]
    let k = (3 * w[0] + w[1]) / 10
    let foot = times(k, u0)
    return [
        Para(Bd, [3, w[0], 1, w[1]]),
        Dash(P(Bd, w), P(Bd, foot), INK, 2.5),
        Vec(Bd, [0, 0], w, EMBER),
        Vec(Bd, [0, 0], [3, 1], AZURE),
        center{[2.6, -1.0, 0]} scale{1.5} color{LEAF} Number(3 * w[1] - w[0], 2)
    ]
}
mesh ground = Ground(Bd)
mesh rail = Cut(Bd, [1 - 6, 2 - 2], [1 + 6, 2 + 2], SLATE, 2)
mesh upright = Slide(t: 0)
mesh label = [
    center{[2.6, 1.4, 0]} Note("base", 0.74),
    center{[2.6, 0.95, 0]} Math(to_string(sqrt(10), 2), 0.95, AZURE),
    center{[2.6, 0.35, 0]} Note("height", 0.74),
    center{[2.6, -0.1, 0]} Math(to_string(5 / sqrt(10), 2), 0.95, INK),
    center{[2.6, -0.55, 0]} Note("area", 0.74)
]
mesh corner = []

slide "slide"
    play Wait(0.9)
    upright.t = 1
    play Lerp(3.2, [&upright])
    corner = [stroke{INK, 2.5} Polyline([
        P(Bd, [0.24, 0.08]),
        P(Bd, [0.24 - 0.08, 0.08 + 0.24]),
        P(Bd, [-0.08, 0.24])
    ])]
    play Fade(0.4, [&corner])
    play Wait(1.8)

Uses the shared definitions for this lesson's figures.

To compute the upright side we need the direction perpendicular to $\mathbf{u}$. Turning $\mathbf{u} = (a, c)$ a quarter turn counterclockwise gives $\mathbf{n} = (-c, a)$, which has the same length as $\mathbf{u}$ and points to the left of $\mathbf{u}$. Any $\mathbf{v}$ can be split into a part along $\mathbf{u}$ and a part along $\mathbf{n}$, say $\mathbf{v} = s\,\mathbf{u} + h\,\mathbf{n}$. The number $h$ tells us how far $\mathbf{v}$ sticks out sideways, in units of $|\mathbf{n}|$, and it is positive when $\mathbf{v}$ is on the left of $\mathbf{u}$ and negative when it is on the right. We say the pair $\mathbf{u}, \mathbf{v}$ is positively oriented in the first case and negatively oriented in the second.

The proof takes one fact from school geometry on trust, that the area of a parallelogram is base times height. Everything else is the algebra shown. It also explains the swapped columns: exchanging $\mathbf{u}$ and $\mathbf{v}$ keeps the parallelogram and reverses which one is on the left of the other.

The sign has a visible meaning for the whole transformation. Before the map, $\mathbf{j}$ is to the left of $\mathbf{i}$. If $\det A > 0$ the images keep that arrangement, and if $\det A < 0$ they reverse it, which means the plane has been turned over like a sheet of paper: text comes out mirrored.

The second column swings around while the first stays at $(2, 1)$. The signed area shrinks to 0 when the two columns line up and becomes negative once the orange arrow is to the right of the blue one. From then on the letter F is mirror-reversed.
Monocurl source
let Swing = |deg| {
    let th = deg * PI / 180
    let m = [2, 2 * cos(th), 1, 2 * sin(th)]
    let dt = clean(det(m))
    var col = LEAF
    if (dt < 0) {
        col = ROSE
    }
    return [
        Lines(B2, m),
        Para(B2, m, col),
        Shape(map(FPTS, |p| P(B2, apply(m, times(0.42, p)))), INK, 0.35, 2),
        Arrows(B2, m),
        center{[2.65, 0.2, 0]} scale{1.5} color{col} Number(dt, 2)
    ]
}
mesh ground = Ground(B2)
mesh swing = Swing(deg: 110)
mesh label = [center{[2.65, 0.85, 0]} Note("signed area", 0.76)]
mesh verdict = []

slide "swing"
    play Wait(0.9)
    swing.deg = -40
    play Lerp(5, [&swing])
    verdict = [center{[2.65, -0.6, 0]} Cap("mirrored", 0.78, ROSE)]
    play Fade(0.4, [&verdict])
    play Wait(1.8)

Uses the shared definitions for this lesson's figures.

Pause and try

Without the formula, by picturing the unit square, find the determinant of: (a) a rotation by any angle; (b) the shear $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$; (c) the reflection $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$, which swaps $\mathbf{i}$ and $\mathbf{j}$; (d) the projection $\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$. Then check each with $ad - bc$.

Show answerHide answer

(a) A rotation moves the square rigidly and does not turn it over: $\det = 1$. Formula: $\cos\theta \cdot \cos\theta - (-\sin\theta)\sin\theta = \cos^2\theta + \sin^2\theta = 1$. (b) A shear slides the top of the square along itself; base and height stay 1, so $\det = 1$. Formula: $1 \cdot 1 - 1 \cdot 0 = 1$. (c) The square lands on itself, turned over: $\det = -1$. Formula: $0 \cdot 0 - 1 \cdot 1 = -1$. (d) The square is flattened onto a segment: $\det = 0$. Formula: $1 \cdot 0 - 0 \cdot 0 = 0$.

From the unit square to every region

We argued that every square with horizontal and vertical sides has its area multiplied by the area of the green parallelogram, which we now know is $|\det A|$. To pass to arbitrary regions we have to say what we assume about area.

  1. Shifting a region does not change its area.
  2. If a region is cut into finitely many pieces that overlap only along edges, its area is the sum of the areas of the pieces.
  3. A bounded region $R$ has an area when it can be squeezed between unions of small grid squares: the total area of the squares of side $s$ lying inside $R$, and the total area of those that touch $R$, approach a common value as $s \to 0$. That value is the area of $R$.

Property 3 is how area is defined for curved regions in analysis (it is called Jordan content), and polygons, discs and regions bounded by smooth curves all have an area in this sense.

The first half is a complete proof. The second half is complete given two things I have not shown: that the image of $R$ has an area in the sense of property 3, and that a region contained in another has no larger area. Both are true and are proved in a course on integration, where this theorem is the linear case of the change-of-variables formula.

A disc approximated by small squares of side 0.25, transformed by the matrix with columns $(1.5, 0.5)$ and $(0.5, 1)$, whose determinant is 1.25. Every small square becomes a small parallelogram with 1.25 times the area, so the total is multiplied by 1.25 as well.
Monocurl source
let M = [1.5, 0.5, 0.5, 1]
let CX = 1.25
let CY = 1.25
let Cells = || block {
    for (i in range(0, 10)) {
        for (j in range(0, 10)) {
            let x = 0.25 * i
            let y = 0.25 * j
            if ((x + 0.125 - CX) ^ 2 + (y + 0.125 - CY) ^ 2 <= 1) {
                . [x, y]
            }
        }
    }
}
let CELLS = Cells()
let N = len(CELLS)
let Blob = |t| {
    let m = blend(IDENT, M, t)
    let q = |x, y| P(Bd, apply(m, [x, y]))
    var out = []
    for (cell in CELLS) {
        let x = cell[0]
        let y = cell[1]
        out .= Shape([q(x, y), q(x + 0.25, y), q(x + 0.25, y + 0.25), q(x, y + 0.25)], LEAF, 0.3, 1.2)
    }
    out .= stroke{INK, 3} Polyline(map(sample(0, TAU, 72), |a| q(CX + cos(a), CY + sin(a))))
    out .= center{[2.6, 0.05, 0]} scale{1.15} color{INK} Number(0.0625 * det(m), 4)
    out .= center{[2.6, -1.15, 0]} scale{1.3} color{LEAF} Number(N * 0.0625 * det(m), 2)
    return out
}
mesh ground = Ground(Bd)
mesh blob = Blob(t: 0)
mesh label = [
    center{[2.6, 1.6, 0]} Note("small squares", 0.74),
    center{[2.6, 1.15, 0]} Math(to_string(N), 0.95, INK),
    center{[2.6, 0.55, 0]} Note("area of each", 0.74),
    center{[2.6, -0.6, 0]} Note("total area", 0.74)
]

slide "blob"
    play Wait(1)
    blob.t = 1
    play Lerp(3.5, [&blob])
    play Wait(2)

Uses the shared definitions for this lesson's figures.

The determinant of a product

Suppose $B$ doubles areas and $A$ triples them. Applying $B$ and then $A$ should multiply areas by 6. That one-line thought is the most used property of determinants, and with the area scaling theorem in hand it is nearly a proof.

  1. The unit square has area 1.
  2. Apply B. The square becomes a parallelogram of area 2, the determinant of B.
  3. Apply A to that parallelogram. A multiplies the area of every region by its determinant, 2.
  4. In total the unit square went to a region of area 4, and the map that did it is AB.
The unit square is sent by $B$ (columns $(2, 0)$ and $(1, 1)$, determinant 2) to a parallelogram of area 2, and that parallelogram is sent by $A$ (columns $(1, 1)$ and $(-1, 1)$, determinant 2) to one of area 4. The combined map is $AB$, so $\det(AB) = 2 \times 2 = 4$.
Monocurl source
let Bq = [2, 1, 0, 1]
let Aq = [1, -1, 1, 1]
let Chain = |s| {
    let m = matmul(blend(IDENT, Aq, clamp(0, s - 1, 1)), blend(IDENT, Bq, clamp(0, s, 1)))
    return [
        Lines(Bd, m),
        Para(Bd, m),
        Arrows(Bd, m),
        center{[2.6, 0.95, 0]} scale{1.5} color{LEAF} Number(det(m), 2)
    ]
}
mesh ground = Ground(Bd)
mesh chain = Chain(s: 0)
mesh square = UnitSquare(Bd)
mesh label = [center{[2.6, 1.5, 0]} Note("area", 0.76)]
mesh notes = []

slide "The unit square has area 1."
    play Fade(0.5)

slide "Apply B. The square becomes a parallelogram of area 2, the determinant of B."
    chain.s = 1
    play Lerp(2.2, [&chain])
    notes = [center{[2.6, 0.1, 0]} Math(str_join(["\det B = ", to_string(det(Bq))]), 0.9, INK)]
    play Fade(0.4, [&notes])

slide "Apply A to that parallelogram. A multiplies the area of every region by its determinant, 2."
    chain.s = 2
    play Lerp(2.2, [&chain])
    notes .= center{[2.6, -0.5, 0]} Math(str_join(["\det A = ", to_string(det(Aq))]), 0.9, INK)
    play Fade(0.4, [&notes])

slide "In total the unit square went to a region of area 4, and the map that did it is AB."
    notes .= center{[2.6, -1.2, 0]} Math(str_join(["\det(AB) = ", to_string(det(matmul(Aq, Bq)))]), 0.9, LEAF)
    play Fade(0.4, [&notes])

Uses the shared definitions for this lesson's figures.

The algebra settles the theorem in three lines, and on its own it would leave you wondering why the terms arrange themselves so neatly. The area argument is the reason: two scalings in a row multiply.

Determinant zero: no way back

Go back to $A = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix}$ and slide its second column toward a multiple of the first.

The second column of the matrix slides from $(1, 2)$ to $(1.5, 0.5)$, which is half the first column. The parallelogram loses all its area and the whole grid closes onto one line. The black dot is where $(0.5, 0)$ goes and the red ring is where $(0, 1)$ goes: at the end, two different inputs have the same output.
Monocurl source
let Squash = |t| {
    let m = [3, 1 + 0.5 * t, 1, 2 - 1.5 * t]
    return [
        Lines(Bd, m),
        Para(Bd, m),
        Arrows(Bd, m),
        Ring(P(Bd, apply(m, [0, 1])), ROSE, 0.14, 3),
        Pt(P(Bd, apply(m, [0.5, 0])), INK, 0.08),
        MatBox([2.6, 0.8, 0], m, 2),
        center{[2.6, -1.0, 0]} scale{1.5} color{LEAF} Number(clean(det(m)), 2)
    ]
}
mesh ground = Ground(Bd)
mesh squash = Squash(t: 0)
mesh label = [center{[2.6, -0.4, 0]} Note("determinant", 0.76)]

slide "squash"
    play Wait(1)
    squash.t = 1
    play Lerp(4, [&squash])
    play Wait(2.2)

Uses the shared definitions for this lesson's figures.

When the determinant reaches 0 the columns are parallel, and the image of the plane is a line (or, for the zero matrix, a point). A map like that cannot be undone. If two different inputs land on the same output, no rule can send that output back to both of them. A transformation that can be undone is called invertible, and in matrix terms the definition is this.

There is at most one inverse: if $B$ and $B'$ both qualify, then $B = BI = B(AB') = (BA)B' = IB' = B'$, using associativity.

To find $A^{-1}$ when it exists, ask what it must do. Its first column is where it sends $\mathbf{i}$, which must be the vector $\mathbf{x}$ that $A$ sends to $\mathbf{i}$. Writing $\mathbf{x} = (x_1, x_2)$, the condition $A\mathbf{x} = \mathbf{i}$ is the linear system $ax_1 + bx_2 = 1$, $cx_1 + dx_2 = 0$. Multiply the first equation by $d$, the second by $b$, and subtract: $(ad - bc)x_1 = d$. Multiply the second by $a$, the first by $c$, and subtract: $(ad - bc)x_2 = -c$. The determinant has turned up in the denominator.

The second half of the proof is the product theorem at work, and it says something sensible: if $A$ multiplies areas by 5, its inverse must multiply them by $\frac15$, and no factor undoes a multiplication by 0.

The theorem also settles when a matrix can be cancelled from a product. If $\det A \neq 0$ and $AB = AC$, multiply both sides on the left by $A^{-1}$ to get $B = C$. If $\det A = 0$ cancellation can fail: $A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$ and $B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}$ have $AB = A0$ with $B \neq 0$.

Pause and try

Let $Z = \begin{pmatrix} 2 & 4 \\ 1 & 2 \end{pmatrix}$. Compute $\det Z$, describe the image of the plane under $Z$, and find two different vectors that $Z$ sends to the same place.

Show answerHide answer

$\det Z = 2 \cdot 2 - 4 \cdot 1 = 0$. The columns $(2, 1)$ and $(4, 2)$ are parallel, so every output $x\,(2, 1) + y\,(4, 2) = (x + 2y)(2, 1)$ lies on the line through the origin along $(2, 1)$. Outputs depend only on $x + 2y$, so for instance $Z(2, 0) = (4, 2)$ and $Z(0, 1) = (4, 2)$. Also $Z(2, -1) = (0, 0) = Z(0, 0)$.

What was hard here was resisting the formula long enough to ask what it measures. Once the determinant is the area scaling factor, its properties stop being identities to memorize: the product rule says scalings compound, a zero determinant says the plane was flattened, and the inverse formula divides by the determinant because undoing a scaling by 5 needs a scaling by $\frac15$. The same reading works in three dimensions, with volume in place of area. Solving $A\mathbf{x} = \mathbf{b}$ by undoing $A$ is taken further in the lesson on linear systems and inverses.

Check yourself

A matrix $M$ has $\det M = -3$. What happens to a region of area 2 under $M$?

Problems

The first three are computations, the next two combine the area reading with the theorems, and the last two ask for arguments.

Problem 1

Compute the determinant of each matrix and say what it tells you about the transformation: (a) $\begin{pmatrix} 2 & 5 \\ 1 & 3 \end{pmatrix}$, (b) $\begin{pmatrix} 4 & -2 \\ -6 & 3 \end{pmatrix}$, (c) $\begin{pmatrix} -3 & 0 \\ 0 & -3 \end{pmatrix}$, (d) $\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$.

Show solutionHide solution

(a) $2 \cdot 3 - 5 \cdot 1 = 1$: areas are unchanged and orientation is kept, although the map is not a rigid motion. (b) $4 \cdot 3 - (-2)(-6) = 12 - 12 = 0$: the columns are parallel, $(-2, 3) = -\frac12(4, -6)$, and the plane is flattened onto a line. (c) $(-3)(-3) - 0 = 9$: every area is multiplied by 9. The map is a half turn combined with an enlargement by 3, and a half turn does not mirror anything, which fits the positive sign. (d) $1 \cdot 4 - 2 \cdot 3 = -2$: areas double and the plane is turned over.

Problem 2

Find the area of the triangle with corners $(2, 1)$, $(5, 3)$ and $(3, 6)$.

Show solutionHide solution

Two sides from the corner $(2, 1)$ are $(5 - 2, 3 - 1) = (3, 2)$ and $(3 - 2, 6 - 1) = (1, 5)$. The parallelogram they span has area $|3 \cdot 5 - 2 \cdot 1| = 13$, and the triangle is half of it: $6.5$. Check by boxing in the rectangle from $(2, 1)$ to $(5, 6)$, of area $3 \times 5 = 15$: the outside triangles have legs 3 and 2 (area 3), legs 2 and 3 (area 3), and legs 1 and 5 (area 2.5), and $15 - 8.5 = 6.5$.

Problem 3

Find the inverse of $M = \begin{pmatrix} 2 & 5 \\ 1 & 3 \end{pmatrix}$, verify it, and use it to solve $2x + 5y = 1$, $x + 3y = 2$.

Show solutionHide solution

$\det M = 1$, so $M^{-1} = \begin{pmatrix} 3 & -5 \\ -1 & 2 \end{pmatrix}$. Verify: $M M^{-1} = \begin{pmatrix} 6 - 5 & -10 + 10 \\ 3 - 3 & -5 + 6 \end{pmatrix} = I$. The system is $M(x, y) = (1, 2)$, so $(x, y) = M^{-1}(1, 2) = (3 - 10,\ -1 + 4) = (-7, 3)$. Check: $2(-7) + 5(3) = 1$ and $-7 + 3(3) = 2$.

Problem 4

For which numbers $k$ is $\begin{pmatrix} k & 3 \\ 2 & k - 1 \end{pmatrix}$ not invertible? For each, show directly that the columns are parallel.

Show solutionHide solution

The determinant is $k(k - 1) - 6 = k^2 - k - 6 = (k - 3)(k + 2)$, which is zero for $k = 3$ and $k = -2$. For $k = 3$ the matrix is $\begin{pmatrix} 3 & 3 \\ 2 & 2 \end{pmatrix}$, whose two columns are both $(3, 2)$. For $k = -2$ it is $\begin{pmatrix} -2 & 3 \\ 2 & -3 \end{pmatrix}$, and the second column is $-\frac32$ times the first: $-\frac32(-2, 2) = (3, -3)$. For every other $k$ the matrix is invertible.

Problem 5

A disc of radius 2 is transformed by $A = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix}$. What is the area of its image? What is the area of the image of the same disc under $A^2$, and under $A^{-1}$?

Show solutionHide solution

The disc has area $\pi \cdot 2^2 = 4\pi$. Under $A$, areas are multiplied by $|\det A| = 5$: the image, an ellipse, has area $20\pi$. By the product theorem $\det(A^2) = \det(A)^2 = 25$, so under $A^2$ the area is $100\pi$. And $\det(A)\det(A^{-1}) = \det(I) = 1$ gives $\det(A^{-1}) = \frac15$, so under $A^{-1}$ the area is $\frac{4\pi}{5}$.

Problem 6

Each statement is false. Give a counterexample and say what is true instead. (a) “If $\det A = 1$, then $A$ moves no points.” (b) “If $\det A = \det B$, then $A = B$.” (c) “$\det(A + B) = \det A + \det B$.”

Show solutionHide solution

(a) The shear $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$ has determinant 1 and sends $(0, 1)$ to $(1, 1)$. What $\det A = 1$ guarantees is that areas and orientation are preserved; lengths and angles may change. (b) The shear and the identity both have determinant 1, as does every rotation. The determinant is one number extracted from four and cannot identify the matrix. (c) Take $A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$ and $B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}$. Both determinants are 0, yet $A + B = I$ has determinant 1. The determinant is multiplicative: $\det(AB) = \det A \det B$.

Problem 7

Let $A$ be a $2 \times 2$ matrix whose entries are all whole numbers (positive, negative or zero). Prove that $A^{-1}$ exists and has whole-number entries if and only if $\det A = 1$ or $\det A = -1$.

Show solutionHide solution

Suppose $\det A = \pm 1$. Then $A$ is invertible, and the formula gives $A^{-1} = \pm\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$, whose entries are whole numbers because $a, b, c, d$ are. Conversely, suppose $A^{-1}$ exists and has whole-number entries. A determinant is built from the entries by multiplying and subtracting, so $\det A$ and $\det(A^{-1})$ are both whole numbers. By the product theorem their product is $\det(AA^{-1}) = \det I = 1$. The only ways to write 1 as a product of two whole numbers are $1 \cdot 1$ and $(-1)(-1)$, so $\det A = \pm 1$. Geometrically, such a matrix maps the grid of whole-number points onto itself without skipping any, and its parallelogram has the same area as a grid square. Example: $\begin{pmatrix} 2 & 5 \\ 1 & 3 \end{pmatrix}$ from Problem 3.

Shared definitions used by this lesson's figures
# house kit: prepended to every essay figure after the std imports

# palette. AZURE and EMBER are the two actors, LEAF marks an answer, ROSE a problem
let PAPER = [1, 1, 1, 1]
let INK = [0.08, 0.09, 0.11, 1]
let SLATE = [0.40, 0.44, 0.50, 1]
let MIST = [0.85, 0.86, 0.88, 1]
let AZURE = [0.13, 0.42, 0.68, 1]
let EMBER = [0.89, 0.42, 0.12, 1]
let LEAF = [0.13, 0.55, 0.36, 1]
let ROSE = [0.78, 0.22, 0.24, 1]
let PLUM = [0.47, 0.30, 0.66, 1]
let GOLD = [0.85, 0.62, 0.08, 1]

background = PAPER

# an opaque pastel of col; use for fills so overlaps do not darken
let tint = |col, amount = 0.18| [
    1 - (1 - col[0]) * amount,
    1 - (1 - col[1]) * amount,
    1 - (1 - col[2]) * amount,
    1
]

# text: Cap for labels, Note for quiet labels, Math for typeset maths
let Cap = |txt, size = 0.75, col = INK| color{col} Text(txt, size, "Charter")
let Note = |txt, size = 0.65| color{SLATE} Text(txt, size, "Charter")
let Math = |tex, size = 0.9, col = INK| color{col} Tex(tex, size)

# a paper rectangle to sit behind text that crosses lines
let Plate = |pos, size| center{pos} fill{PAPER} stroke{alpha{0} PAPER, 0} Rect(size)

# shapes with fill and stroke both set, so no stray black appears
let Pt = |pos, col = INK, r = 0.075| center{pos} fill{col} stroke{col, 1} Circle(r, 48)
let Ring = |pos, col = INK, r = 0.1, w = 3| center{pos} fill{PAPER} stroke{col, w} Circle(r, 48)
let Seg = |a, b, col = INK, w = 3| stroke{col, w} Line(a, b)
let Path = |pts, col = INK, w = 3| stroke{col, w} Polyline(pts)
let Region = |pts, col| fill{col} stroke{alpha{0} col, 0} Polygon(pts)
let Outline = |pts, col = INK, w = 3| fill{alpha{0} PAPER} stroke{col, w} Polygon(pts)
let Shape = |pts, col, amount = 0.18, w = 3| fill{tint(col, amount)} stroke{col, w} Polygon(pts)
let Disc = |pos, r, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Circle(r, 96)
let Box = |pos, size, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Rect(size)
# a line from a to b ending in a small solid arrowhead
let Tip = |a, b, col = INK, w = 3, head = 0.17| {
    let d = normalize([b[0] - a[0], b[1] - a[1], 0])
    let n = [-d[1], d[0], 0]
    let base = [b[0] - d[0] * head, b[1] - d[1] * head, 0]
    return [
        stroke{col, w} Line(a, base),
        fill{col} stroke{col, 1} Polygon([
            b,
            [base[0] + n[0] * head * 0.42, base[1] + n[1] * head * 0.42, 0],
            [base[0] - n[0] * head * 0.42, base[1] - n[1] * head * 0.42, 0]
        ])
    ]
}

# plots. a frame is [x0, x1, y0, y1, centre, width, height]: a data window and the scene box it fills
let Frame = |x0, x1, y0, y1, c = [0, 0, 0], w = 6.4, h = 3.6| [x0, x1, y0, y1, c, w, h]
let fx = |fr, x| fr[4][0] + (x - (fr[0] + fr[1]) / 2) * fr[5] / (fr[1] - fr[0])
let fy = |fr, y| fr[4][1] + (y - (fr[2] + fr[3]) / 2) * fr[6] / (fr[3] - fr[2])
let at = |fr, x, y| [fx(fr, x), fy(fr, y), 0]

# axes through the data origin (or the nearest edge of the window), with optional names
let Axes = |fr, x_name = "", y_name = "", col = SLATE| {
    let ox = clamp(fr[0], 0, fr[1])
    let oy = clamp(fr[2], 0, fr[3])
    var parts = [
        Tip(at(fr, fr[0], oy), [fx(fr, fr[1]) + 0.25, fy(fr, oy), 0], col, 2.5, 0.15),
        Tip(at(fr, ox, fr[2]), [fx(fr, ox), fy(fr, fr[3]) + 0.25, 0], col, 2.5, 0.15)
    ]
    if (x_name != "") {
        parts .= center{[fx(fr, fr[1]) + 0.5, fy(fr, oy), 0]} Math(x_name, 0.8, col)
    }
    if (y_name != "") {
        parts .= center{[fx(fr, ox), fy(fr, fr[3]) + 0.5, 0]} Math(y_name, 0.8, col)
    }
    return parts
}

# tick marks with numbers at the listed data values
let XTicks = |fr, xs, col = SLATE, places = 0| block {
    let oy = fy(fr, clamp(fr[2], 0, fr[3]))
    for (x in xs) {
        . Seg([fx(fr, x), oy - 0.07, 0], [fx(fr, x), oy + 0.07, 0], col, 2)
        . center{[fx(fr, x), oy - 0.33, 0]} Math(to_string(x, places), 0.72, col)
    }
}
let YTicks = |fr, ys, col = SLATE, places = 0| block {
    let ox = fx(fr, clamp(fr[0], 0, fr[1]))
    for (y in ys) {
        . Seg([ox - 0.07, fy(fr, y), 0], [ox + 0.07, fy(fr, y), 0], col, 2)
        . center{[ox - 0.36, fy(fr, y), 0]} Math(to_string(y, places), 0.72, col)
    }
}

# faint grid lines at the listed data values
let GridLines = |fr, xs, ys, col = MIST| block {
    for (x in xs) {
        . Seg(at(fr, x, fr[2]), at(fr, x, fr[3]), col, 1.5)
    }
    for (y in ys) {
        . Seg(at(fr, fr[0], y), at(fr, fr[1], y), col, 1.5)
    }
}

# the graph of f over [a, b], drawn in the frame. values are clamped to the window
let Graph = |fr, f, a, b, col = AZURE, w = 4, n = 160|
    stroke{col, w} Polyline(map(sample(a, b, n), |x| at(fr, x, clamp(fr[2], f(x), fr[3]))))

# the region between the graph of f and the x axis over [a, b]
let AreaUnder = |fr, f, a, b, col = AZURE, amount = 0.2, n = 80| {
    var pts = [at(fr, a, 0)]
    for (x in sample(a, b, n)) {
        pts .= at(fr, x, clamp(fr[2], f(x), fr[3]))
    }
    pts .= at(fr, b, 0)
    return fill{tint(col, amount)} stroke{alpha{0} col, 0} Polygon(pts)
}

# vectors are pairs [x, y]. a board is [o, u, x0, x1, y0, y1]: the scene point of the origin,
# the unit length, and the window of whole numbers that is drawn
let Board = |o, u, x0, x1, y0, y1| [o, u, x0, x1, y0, y1]
let P = |pl, v| [pl[0][0] + pl[1] * v[0], pl[0][1] + pl[1] * v[1], 0]
let add = |v, w| [v[0] + w[0], v[1] + w[1]]
let times = |c, v| [c * v[0], c * v[1]]
# matrices are [a, b, c, d] with rows (a b) and (c d), so the columns are (a, c) and (b, d)
let IDENT = [1, 0, 0, 1]
let apply = |m, v| [m[0] * v[0] + m[1] * v[1], m[2] * v[0] + m[3] * v[1]]
let blend = |m, n, t| [
    m[0] + (n[0] - m[0]) * t,
    m[1] + (n[1] - m[1]) * t,
    m[2] + (n[2] - m[2]) * t,
    m[3] + (n[3] - m[3]) * t
]
let GRIDC = tint(AZURE, 0.42)
# faint gridlines, both axes, and numbers along the bottom and left edges every `step`
let Ground = |pl, step = 1, mult = 1| {
    var out = []
    let lo = P(pl, [pl[2], pl[4]])
    let hi = P(pl, [pl[3], pl[5]])
    for (x in range(pl[2], pl[3] + 1)) {
        let sx = P(pl, [x, 0])[0]
        out .= Seg([sx, lo[1], 0], [sx, hi[1], 0], MIST, 1.5)
        if (mod(x, step) == 0) {
            out .= center{[sx, lo[1] - 0.27, 0]} Math(to_string(x * mult), 0.72, SLATE)
        }
    }
    for (y in range(pl[4], pl[5] + 1)) {
        let sy = P(pl, [0, y])[1]
        out .= Seg([lo[0], sy, 0], [hi[0], sy, 0], MIST, 1.5)
        if (mod(y, step) == 0) {
            out .= center{[lo[0] - 0.38, sy, 0]} Math(to_string(y * mult), 0.72, SLATE)
        }
    }
    if (pl[4] <= 0 and pl[5] >= 0) {
        out .= Seg(P(pl, [pl[2], 0]), P(pl, [pl[3], 0]), SLATE, 2.5)
    }
    if (pl[2] <= 0 and pl[3] >= 0) {
        out .= Seg(P(pl, [0, pl[4]]), P(pl, [0, pl[5]]), SLATE, 2.5)
    }
    return out
}
# the part of the segment from scene point p to q that lies in the box lo..hi
let ClipSeg = |p, q, lo, hi, col, w| {
    let d = [q[0] - p[0], q[1] - p[1]]
    var t0 = 0
    var t1 = 1
    for (k in [0, 1]) {
        if (abs(d[k]) < 0.00001) {
            if (p[k] < lo[k] - 0.0001 or p[k] > hi[k] + 0.0001) {
                t1 = -1
            }
        }
        if (abs(d[k]) >= 0.00001) {
            let ta = (lo[k] - p[k]) / d[k]
            let tb = (hi[k] - p[k]) / d[k]
            t0 = max(t0, min(ta, tb))
            t1 = min(t1, max(ta, tb))
        }
    }
    if (t1 - t0 < 0.002) {
        return []
    }
    return stroke{col, w} Line(
        [p[0] + t0 * d[0], p[1] + t0 * d[1], 0],
        [p[0] + t1 * d[0], p[1] + t1 * d[1], 0]
    )
}
# a segment between two points of the board, cut off at the window
let Cut = |pl, a, b, col = SLATE, w = 2|
    ClipSeg(P(pl, a), P(pl, b), P(pl, [pl[2], pl[4]]), P(pl, [pl[3], pl[5]]), col, w)
# the whole-number grid after the matrix m: lines along the first column in col_a, along the second in col_b
let Lines = |pl, m, col_a = GRIDC, col_b = GRIDC, n = 8| block {
    for (k in range(-n, n + 1)) {
        var w = 1.8
        if (k == 0) {
            w = 3
        }
        . Cut(pl, apply(m, [-n, k]), apply(m, [n, k]), col_a, w)
        . Cut(pl, apply(m, [k, -n]), apply(m, [k, n]), col_b, w)
    }
}
# an arrow between two points of the board
let Vec = |pl, a, b, col = INK, w = 4.5, head = 0.2| {
    let p = P(pl, a)
    let q = P(pl, b)
    if (sqrt((q[0] - p[0]) ^ 2 + (q[1] - p[1]) ^ 2) < head * 1.3) {
        return Seg(p, q, col, w)
    }
    return Tip(p, q, col, w, head)
}
# transform the grid: the matrix is t of the way from m0 to m1; the first basis arrow is blue, the second orange
let Warp = |pl, m0, m1, t| {
    let m = blend(m0, m1, t)
    return [
        Lines(pl, m),
        Vec(pl, [0, 0], [m[0], m[2]], AZURE),
        Vec(pl, [0, 0], [m[1], m[3]], EMBER)
    ]
}
let Dash = |a, b, col = SLATE, w = 2.5| stroke{col, w} dashed{[0.1, 0.08]} Line(a, b)
let clean = |x| {
    if (abs(x) < 0.005) {
        return 0
    }
    return x
}
# a 2x2 matrix readout with brackets, first column blue and second orange
let MatBox = |c, m, places = 1, s = 0.9| {
    let dx = 0.5
    let dy = 0.3
    let bx = 1.0
    let by = 0.62
    let lip = 0.13
    let q = |x, y| [c[0] + x, c[1] + y, 0]
    return [
        stroke{INK, 2.5} Polyline([q(-bx + lip, by), q(-bx, by), q(-bx, -by), q(-bx + lip, -by)]),
        stroke{INK, 2.5} Polyline([q(bx - lip, by), q(bx, by), q(bx, -by), q(bx - lip, -by)]),
        center{q(-dx, dy)} scale{s} color{AZURE} Number(clean(m[0]), places),
        center{q(dx, dy)} scale{s} color{EMBER} Number(clean(m[1]), places),
        center{q(-dx, -dy)} scale{s} color{AZURE} Number(clean(m[2]), places),
        center{q(dx, -dy)} scale{s} color{EMBER} Number(clean(m[3]), places)
    ]
}
let matmul = |m, n| [
    m[0] * n[0] + m[1] * n[2],
    m[0] * n[1] + m[1] * n[3],
    m[2] * n[0] + m[3] * n[2],
    m[2] * n[1] + m[3] * n[3]
]
# an F, so that turning and mirroring can be told apart
let FPTS = [[0.4, 0.3], [0.8, 0.3], [0.8, 1.1], [1.3, 1.1], [1.3, 1.5], [0.8, 1.5], [0.8, 1.9], [1.6, 1.9], [1.6, 2.3], [0.4, 2.3]]
let FShape = |pl, m, col = LEAF| Shape(map(FPTS, |p| P(pl, apply(m, p))), col, 0.22, 2.5)
let det = |m| m[0] * m[3] - m[1] * m[2]
let A = [3, 1, 1, 2]
let Bd = Board([-2.58, -1.03, 0], 0.72, -1, 5, -1, 4)
let B2 = Board([-1.94, -0.24, 0], 0.68, -2, 5, -2, 3)
# the image of the unit square under m
let Para = |pl, m, col = LEAF| Shape([
    P(pl, [0, 0]),
    P(pl, [m[0], m[2]]),
    P(pl, [m[0] + m[1], m[2] + m[3]]),
    P(pl, [m[1], m[3]])
], col, 0.3, 2.5)
let UnitSquare = |pl| stroke{SLATE, 2.5} dashed{[0.1, 0.08]} Polyline([P(pl, [0, 0]), P(pl, [1, 0]), P(pl, [1, 1]), P(pl, [0, 1]), P(pl, [0, 0])])
let Arrows = |pl, m| [
    Vec(pl, [0, 0], [m[1], m[3]], EMBER),
    Vec(pl, [0, 0], [m[0], m[2]], AZURE)
]