ContentsChapter 1 · Linear algebra4 of 7

1.4

Determinant, inverse and Ax = b

In this chapter
  1. 1.1Vectors and linear combinations
  2. 1.2Span, basis and dimension
  3. 1.3Matrices as transformations
  4. 1.4Determinant, inverse and Ax = b
  5. 1.5Dot products, angles and projections
  6. 1.6Eigenvectors and eigenvalues
  7. 1.7Symmetric matrices and the SVD
Before you readA transformation squashes the whole plane onto a single line. Can any transformation undo it?
Watch: The determinant · 3Blue1Brown · Essence of Linear Algebra, ch. 6

The determinant measures how a matrix scales area: ∣det⁡A∣|\det A| is the scale factor, and its sign says whether the plane is flipped. For a 2×22 \times 2 matrix,

det⁡[abcd]=ad−bc.\det \begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc.

A negative determinant means orientation flips (the plane is turned over), so a determinant of −3-3 still triples areas. A determinant of zero means space is squashed into a lower dimension: the columns are dependent.

A = [[2, 1], [1, 3]]det A = 5
The unit square becomes the shaded parallelogram, with area |det A|. It turns orange when orientation flips and flattens when det A = 0.
Watch: Inverse matrices, column space and null space · 3Blue1Brown · Essence of Linear Algebra, ch. 7

The inverse A−1A^{-1} undoes AA A−1A=IA^{-1}A = I where the identity II is the matrix that leaves every vector alone. It exists exactly when det⁡A≠0\det A \neq 0 because a squashed plane cannot be un-squashed. For a 2×22 \times 2 matrix with ad−bc≠0ad - bc \neq 0

A−1=1ad−bc[d−b−ca].A^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}.

A system of linear equations is Ax=bAx = b find the vector that AA sends to bb If AA is invertible there is exactly one answer, x=A−1bx = A^{-1}b In practice you solve by elimination rather than computing A−1A^{-1} subtract multiples of one equation from the others until the last has one unknown, then substitute back upwards. For

x+y+z=62x+y−z=1x−y+2z=5\begin{aligned} x + y + z &= 6 \\ 2x + y - z &= 1 \\ x - y + 2z &= 5 \end{aligned}

subtract 2 × the first from the second, and the first from the third: −y−3z=−11-y - 3z = -11 and −2y+z=−1-2y + z = -1 Subtract 2 × the new second from the new third: 7z=217z = 21 so z=3z = 3 Then −y−9=−11-y - 9 = -11 gives y=2y = 2 and the first equation gives x=1x = 1 Least-squares regression ends in exactly this kind of system.

The rank of AA is the dimension of its column space, the set of every output AxAx Full rank means invertible (for square matrices).

Recall
What does det⁡A\det A measure geometrically?
Recall
What does det⁡A=0\det A = 0 tell you?
Recall
What is the inverse of [abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}
Exercise
Compute det⁡[3−4−2−1]\det \begin{bmatrix} 3 & -4 \\ -2 & -1 \end{bmatrix}
Exercise
Solve by elimination: x+2y+z=4x + 2y + z = 4 2x+5y+3z=92x + 5y + 3z = 9 x+3y+3z=6x + 3y + 3z = 6 Give x,y,zx, y, z
Exercise
Solve [2113]x=[510]\begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix} x = \begin{bmatrix} 5 \\ 10 \end{bmatrix} Give x1,x2x_1, x_2