Unit 2, lesson 10

Inverse Matrices and Invertibility

What the inverse of a square matrix is, when a matrix is invertible or singular, how to compute an inverse by row reduction, why a pivot in every column decides invertibility of a square matrix, and how an inverse solves a system.

  • Video 10
  • Inverses and LU Factorization

A shear moves the point (1,2)(1, 2) to (3,2)(3, 2) by adding the height to the first coordinate, and subtracting the height brings the point back. A different map sends both (1,2)(1, 2) and (1,5)(1, 5) to (1,0)(1, 0), and the output alone cannot say which of the two points it came from. The first map can be undone and the second cannot. This lesson makes that difference precise with the inverse matrix, computes inverses by row reduction, and shows that counting the pivots of a square matrix decides whether an inverse exists. Tuples such as (1,2)(1, 2) stand for column vectors.

Key terms

Inverse matrix

Definition Let AA be an n×nn \times n matrix. An n×nn \times n matrix CC is an inverse of AA if

CA=InandAC=In.CA = I_n \quad \text{and} \quad AC = I_n.

When an inverse exists, AA is called invertible, or nonsingular, and the inverse is unique. Indeed, if CC and DD are both inverses of AA, then

C=C(AD)=(CA)D=D.C = C(AD) = (CA)D = D.

The inverse is written A−1A^{-1}. The equation CA=InCA = I_n says that applying AA and then CC returns every input. The equation AC=InAC = I_n says that for every output b\mathbf{b} the input CbC\mathbf{b} is sent to b\mathbf{b}. Here inverses are defined only for square matrices.

In plain words The inverse undoes the matrix, in either order. In general it cannot be found entry by entry, because it has to undo the whole combination of coordinates that the matrix produces.

Example The shear BB sends (x,y)(x, y) to (x+y,y)(x + y, y), and CC sends (x,y)(x, y) to (x−y,y)(x - y, y),

B=[1101],C=[1−101].B = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}, \qquad C = \begin{bmatrix} 1 & -1 \\ 0 & 1 \end{bmatrix}.

For every (x,y)(x, y), applying BB and then CC gives (x+y−y,y)=(x,y)(x + y - y, y) = (x, y), and applying CC and then BB gives (x−y+y,y)=(x,y)(x - y + y, y) = (x, y). So CB=BC=I2CB = BC = I_2, and C=B−1C = B^{-1}. Taking reciprocals of the entries would fail at once, since BB has a zero entry and its inverse has a −1-1 where BB has a 11.

Singular matrix

Definition A square matrix that has no inverse is singular. An n×nn \times n matrix AA is singular exactly when some nonzero vector v\mathbf{v} satisfies Av=0A\mathbf{v} = \mathbf{0}. One direction is short. If Av=0A\mathbf{v} = \mathbf{0} with v≠0\mathbf{v} \ne \mathbf{0} and CC were an inverse of AA, then

v=(CA)v=C(Av)=C0=0,\mathbf{v} = (CA)\mathbf{v} = C(A\mathbf{v}) = C\mathbf{0} = \mathbf{0},

which is a contradiction. The other direction follows from the pivot test below. A singular matrix has fewer than nn pivots, so the system Ax=0A\mathbf{x} = \mathbf{0} has a free variable, and setting it equal to 11 gives a nonzero solution. The words singular and nonsingular are used only for square matrices.

In plain words A singular matrix squashes some nonzero direction down to zero. Two different inputs then share an output, and no rule can recover both of them.

Example Let

K=[1122].K = \begin{bmatrix} 1 & 1 \\ 2 & 2 \end{bmatrix}.

It sends (x,y)(x, y) to (x+y,2x+2y)(x + y, 2x + 2y), so every output lies on the line where the second coordinate is twice the first. The nonzero vector (−1,1)(-1, 1) goes to (0,0)(0, 0), just as (0,0)(0, 0) does. The replacement R2→R2−2R1R_2 \to R_2 - 2R_1 turns the second row of KK into zeros and leaves one pivot. Finding a solution for one convenient target does not show that a matrix is invertible. The target (3,6)(3, 6) is reached, but by every (3−t,t)(3 - t, t), and the target (3,7)(3, 7) is not reached at all.

Computing an inverse by row reduction

Definition Let AA be an n×nn \times n matrix. Form the n×2nn \times 2n matrix [A∣In][A \mid I_n] and apply elementary row operations to whole rows. If the left block can be reduced to InI_n, the right block is then A−1A^{-1}. If an echelon form of the left block has fewer than nn pivots, then AA is singular. The method works because the row operations together amount to multiplying on the left by one invertible matrix EE, the product of their elementary matrices, so they turn [A∣In][A \mid I_n] into [EA∣E][EA \mid E]. If EA=InEA = I_n, then A=E−1A = E^{-1}, so AE=E−1E=InAE = E^{-1}E = I_n as well, and EE is a two-sided inverse. Column by column, the jjth column of A−1A^{-1} is the solution of Ax=ejA\mathbf{x} = \mathbf{e}_j, and the method solves these nn systems at once.

In plain words Reduce AA to the identity while the identity next to it records every step. When the left side reaches the identity, the right side holds the inverse.

Example Take

A=[2111].A = \begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix}.

Swap the rows, clear the entry below the first pivot, scale the second row by −1-1 and clear the entry above the second pivot,

[21101101]→R1↔R2[11012110]→R2→R2−2R1[11010−11−2]→R2→−R2[110101−12]→R1→R1−R2[101−101−12].\begin{aligned} &\left[\begin{array}{cc|cc} 2 & 1 & 1 & 0 \\ 1 & 1 & 0 & 1 \end{array}\right] \\[0.8em] \xrightarrow{R_1 \leftrightarrow R_2} {} &\left[\begin{array}{cc|cc} 1 & 1 & 0 & 1 \\ 2 & 1 & 1 & 0 \end{array}\right] \\[0.8em] \xrightarrow{R_2 \to R_2 - 2R_1} {} &\left[\begin{array}{cc|cc} 1 & 1 & 0 & 1 \\ 0 & -1 & 1 & -2 \end{array}\right] \\[0.8em] \xrightarrow{R_2 \to -R_2} {} &\left[\begin{array}{cc|cc} 1 & 1 & 0 & 1 \\ 0 & 1 & -1 & 2 \end{array}\right] \\[0.8em] \xrightarrow{R_1 \to R_1 - R_2} {} &\left[\begin{array}{cc|cc} 1 & 0 & 1 & -1 \\ 0 & 1 & -1 & 2 \end{array}\right]. \end{aligned}

So

A−1=[1−1−12].A^{-1} = \begin{bmatrix} 1 & -1 \\ -1 & 2 \end{bmatrix}.

Both products check. The entries of AA−1AA^{-1} are 2−12 - 1, −2+2-2 + 2, 1−11 - 1 and −1+2-1 + 2, and the entries of A−1AA^{-1}A are 2−12 - 1, 1−11 - 1, −2+2-2 + 2 and −1+2-1 + 2, so both products equal I2I_2.

Pivot test for invertibility

Definition For an n×nn \times n matrix AA the following statements are equivalent.

  1. The matrix AA has a pivot in every column, that is, nn pivots.
  2. For every b\mathbf{b} in Rn\mathbb{R}^n the system Ax=bA\mathbf{x} = \mathbf{b} has exactly one solution.
  3. The matrix AA is invertible.

The reasons form a cycle. With nn pivots, AA row reduces to InI_n, and row reduction of [A∣In][A \mid I_n] produces A−1A^{-1}. If AA is invertible, every system has exactly one solution, namely A−1bA^{-1}\mathbf{b}. If every system has exactly one solution, then Ax=0A\mathbf{x} = \mathbf{0} has only x=0\mathbf{x} = \mathbf{0}, so no variable is free and every column has a pivot. The test needs AA to be square.

In plain words For a square matrix, count the pivots. A full set means that every output comes from exactly one input, and that is the same as having an inverse.

Example The matrix AA in the previous example reached two pivots, so it is invertible. The matrix KK has only one pivot, so it is singular. The square condition matters. The 3×23 \times 2 matrix

[100100]\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{bmatrix}

has a pivot in each of its two columns, yet it sends (x,y)(x, y) to (x,y,0)(x, y, 0), so the output (0,0,1)(0, 0, 1) is never reached.

Solving a system with an inverse

Definition If AA is an invertible n×nn \times n matrix, then for every b\mathbf{b} in Rn\mathbb{R}^n the system Ax=bA\mathbf{x} = \mathbf{b} has exactly one solution,

x=A−1b.\mathbf{x} = A^{-1}\mathbf{b}.

It is a solution because A(A−1b)=(AA−1)b=bA(A^{-1}\mathbf{b}) = (AA^{-1})\mathbf{b} = \mathbf{b}. It is the only one because any solution satisfies x=A−1(Ax)=A−1b\mathbf{x} = A^{-1}(A\mathbf{x}) = A^{-1}\mathbf{b}. To solve a single system, row reducing [A∣b][A \mid \mathbf{b}] takes less work than computing A−1A^{-1} first, and both methods give the same vector.

In plain words Multiplying by the inverse undoes the matrix and returns the input that produced b\mathbf{b}. The formula is the right tool for reasoning about solutions, while elimination is usually the quicker way to get the numbers.

Example With AA and A−1A^{-1} from above and b=(5,3)\mathbf{b} = (5, 3),

A−1b=[1−1−12][53]=[21].A^{-1}\mathbf{b} = \begin{bmatrix} 1 & -1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} 5 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ 1 \end{bmatrix}.

Direct elimination is shorter. The equations are 2x+y=52x + y = 5 and x+y=3x + y = 3, and subtracting them gives x=2x = 2, then y=1y = 1. Both equations check, since 2⋅2+1=52 \cdot 2 + 1 = 5 and 2+1=32 + 1 = 3.

Check yourself

  1. Let DD be the diagonal matrix with diagonal entries 22 and −1-1. Find D−1D^{-1}, check both products, and find the input that DD sends to (6,3)(6, 3).
Show the answer

The matrix DD doubles the first coordinate and reverses the sign of the second, so the inverse halves the first coordinate and reverses the second again,

D−1=[1200−1].D^{-1} = \begin{bmatrix} \tfrac{1}{2} & 0 \\ 0 & -1 \end{bmatrix}.

Both products are diagonal with entries 2⋅12=12 \cdot \tfrac{1}{2} = 1 and (−1)(−1)=1(-1)(-1) = 1, so DD−1=D−1D=I2DD^{-1} = D^{-1}D = I_2. The input is D−1(6,3)=(3,−3)D^{-1}(6, 3) = (3, -3), and indeed DD sends (3,−3)(3, -3) to (6,3)(6, 3). Taking the reciprocal of each diagonal entry works here only because DD is diagonal and those entries are nonzero.

  1. A classmate claims that the inverse of the matrix below is the matrix of reciprocals of its entries. Test the claim, then find the inverse by row reduction.
A=[1225]A = \begin{bmatrix} 1 & 2 \\ 2 & 5 \end{bmatrix}
Show the answer

The proposed matrix has first row [112]\begin{bmatrix} 1 & \tfrac{1}{2} \end{bmatrix}. Its product with AA has top left entry 1⋅1+12⋅2=21 \cdot 1 + \tfrac{1}{2} \cdot 2 = 2, not 11, so the claim is false. Row reduction gives

[12102501]→R2→R2−2R1[121001−21]→R1→R1−2R2[105−201−21],\begin{aligned} &\left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 2 & 5 & 0 & 1 \end{array}\right] \\[0.8em] \xrightarrow{R_2 \to R_2 - 2R_1} {} &\left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 0 & 1 & -2 & 1 \end{array}\right] \\[0.8em] \xrightarrow{R_1 \to R_1 - 2R_2} {} &\left[\begin{array}{cc|cc} 1 & 0 & 5 & -2 \\ 0 & 1 & -2 & 1 \end{array}\right], \end{aligned}

so

A−1=[5−2−21].A^{-1} = \begin{bmatrix} 5 & -2 \\ -2 & 1 \end{bmatrix}.

The check AA−1AA^{-1} has entries 5−45 - 4, −2+2-2 + 2, 10−1010 - 10 and −4+5-4 + 5, which form I2I_2, and A−1AA^{-1}A equals I2I_2 in the same way.

  1. Use the pivot test to decide whether the matrix below is invertible. If it is not, find a nonzero vector that it sends to 0\mathbf{0}.
A=[123014137]A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 1 & 3 & 7 \end{bmatrix}
Show the answer

Use R3→R3−R1R_3 \to R_3 - R_1 and then R3→R3−R2R_3 \to R_3 - R_2,

A→R3→R3−R1[123014014]→R3→R3−R2[123014000].\begin{aligned} A \xrightarrow{R_3 \to R_3 - R_1} {} &\begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 0 & 1 & 4 \end{bmatrix} \\[0.8em] \xrightarrow{R_3 \to R_3 - R_2} {} &\begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 0 & 0 & 0 \end{bmatrix}. \end{aligned}

There are only two pivots for three columns, so AA is singular. The third variable is free. With x3=tx_3 = t the rows give x2=−4tx_2 = -4t and x1=−2x2−3x3=5tx_1 = -2x_2 - 3x_3 = 5t. Taking t=1t = 1 gives the vector (5,−4,1)(5, -4, 1), and indeed 5−8+3=05 - 8 + 3 = 0, −4+4=0-4 + 4 = 0 and 5−12+7=05 - 12 + 7 = 0.

How this lesson connects