Linear Algebra · 22 min

Composition, Determinants, and Inverses

Multiplying matrices = composing transformations. The determinant is the area factor. The inverse is the transformation that undoes, and it exists exactly when no space has been crushed.

0 / 0

Multiplication as composition

If AA is a transformation and BB is another transformation, then ABAB is the transformation “first do BB, then do AA.” Read right-to-left, like function composition f(g(x))f(g(x)).

(AB)x  =  A(Bx).(AB)\mathbf{x} \;=\; A(B\mathbf{x}).

The right-to-left order matters; it’s the same convention as function composition from Module 5. It trips people up at first, because you write ABAB but you apply BB first. Own it.

The columns of AB

Given the column picture, there’s a clean way to compute ABAB. Each column of ABAB is AA applied to the corresponding column of BB.

AB  =  [  Ab1    Ab2      ].AB \;=\; \bigl[\; A\,\mathbf{b}_1 \;\big|\; A\,\mathbf{b}_2 \;\big|\; \cdots \;\bigr].

If BB sends ı^\hat{\imath} to b1\mathbf{b}_1, then ABAB sends ı^\hat{\imath} to Ab1A\mathbf{b}_1, because ”AA after BB” first maps ı^\hat{\imath} to b1\mathbf{b}_1 via BB, then maps b1\mathbf{b}_1 to Ab1A\mathbf{b}_1 via AA. Column-picture all the way down.

The row-times-column formula (AB)ij=kAikBkj(AB)_{ij} = \sum_k A_{ik} B_{kj} gives the same answer. Same pattern as last lesson: column picture for meaning, rows for computation.

Multiply two matrices

Compute [1101][0110]\begin{bmatrix}1 & 1 \\ 0 & 1\end{bmatrix} \cdot \begin{bmatrix}0 & -1 \\ 1 & 0\end{bmatrix}.

Give the entry at row 1, column 2 of the product.

AB ≠ BA

Matrix multiplication is not commutative. In general ABBAAB \ne BA, and for most pairs of transformations the results are genuinely different.

Try “rotate 90° then shear” versus “shear then rotate 90°.” The two sequences produce visibly different final shapes. Composition cares about order because the order in which you apply transformations matters.

On the widget below, stack two transformations by eye. R=R = 90° rotation, S=S = shear. Do RR first then SS; undo, do SS first then RR. Not the same.

A · drag the two column-arrows to define the matrix

-3-2-1123-2-112
[
1.00 1.00 1.00 0.00
]
det
-1.00
rank
2
orientation flipped

This is the matrix SR=[1101][0110]=[1110]S \cdot R = \begin{bmatrix}1 & 1 \\ 0 & 1\end{bmatrix} \begin{bmatrix}0 & -1 \\ 1 & 0\end{bmatrix} = \begin{bmatrix}1 & -1 \\ 1 & 0\end{bmatrix}, the one from the StepCheck above.

Determinant: the signed area factor

Take any 2×2 matrix AA. Apply it to the unit square. The result is a parallelogram. Its signed area is called the determinant of AA:

detA  =  adbc  =  signed area of the parallelogram spanned by the columns.\det A \;=\; ad - bc \;=\; \text{signed area of the parallelogram spanned by the columns}.

“Signed” means: positive if the transformation preserves orientation, negative if it flips (a reflection, for example). A pure rotation has determinant +1+1. A reflection across an axis has determinant 1-1. A matrix that stretches the plane by a factor of 3 in both directions has determinant 99.

Drag the columns on the widget above and watch the det readout. When the orientation flips, the color of the unit-square shape flips too. That’s the sign doing its work.

Compute a determinant

Compute det[3112]\det\begin{bmatrix}3 & 1 \\ 1 & 2\end{bmatrix}.

Det = 0 means collapse

When detA=0\det A = 0, the parallelogram flattens. The two columns lie on the same line; their span is 1-dimensional; the transformation has squashed 2D space into a line (or, if both columns are zero, into a single point).

Four equivalent statements (memorize the equivalence, not four separate facts):

  • detA=0\det A = 0.
  • The columns of AA are linearly dependent.
  • The transformation’s output span is lower-dimensional than its input.
  • AA has no inverse.

Drag your widget columns onto the same line. All four things happen at once. The determinant hits zero, the rank badge reads 1, the unit-square shape degenerates to a segment, and, as the next step will show, no inverse exists because information has been destroyed.

Inverse as undoing

The inverse of AA, written A1A^{-1}, is the transformation that undoes AA. Apply AA then A1A^{-1} and you’re back where you started.

AA1  =  A1A  =  I.A \cdot A^{-1} \;=\; A^{-1} \cdot A \;=\; I.

If AA rotates by 30°, A1A^{-1} rotates by 30°-30°. If AA scales by 2, A1A^{-1} scales by 1/21/2. Every invertible transformation has a unique “undo” operation.

But: if AA squashes space (say, it projects every point onto the xx-axis) there is no undo. Points that used to live at different yy-values got sent to the same place. You can’t recover information that was thrown away. That’s why A1A^{-1} exists if and only if detA0\det A \ne 0.

The formula for 2×2 inverses (drop it in if you need to compute one):

[abcd]1  =  1adbc[dbca].\begin{bmatrix}a & b \\ c & d\end{bmatrix}^{-1} \;=\; \frac{1}{ad - bc}\begin{bmatrix}d & -b \\ -c & a\end{bmatrix}.

Note the adbcad - bc in the denominator: it’s the determinant again. When it’s zero, the formula blows up. That’s the algebra telling you what the geometry already said.

Inverse of a diagonal

Given A=[2003]A = \begin{bmatrix}2 & 0 \\ 0 & 3\end{bmatrix}, find A1A^{-1}.

Give the entry at row 1, column 1 of the inverse. (Decimal form.)

The whole chain, in one picture

Here’s the collapse of the four ideas into one widget state. On MatrixDraggable, drag the two columns onto the same line. Simultaneously:

  • The unit-square polygon flattens to a line segment.
  • The det readout hits 00.
  • The rank badge flips from 2 to 1.
  • An inverse can no longer exist.

Four words for one situation. That’s linear algebra being economical.

Lesson complete

Nice tinkering.