Math Core

Lesson 2.2 · Matrix Algebra

The inverse of a matrix

To solve 5x=155x = 15 you multiply both sides by 5−15^{-1}. For a matrix equation Ax=bA\mathbf{x} = \mathbf{b} you would like to do the same thing: multiply by a matrix that undoes AA. This lesson defines that matrix, gives a formula for it in the 2×22 \times 2 case, and shows how row reduction produces it in general.

Invertible matrices

Definition

Inverse of a matrix

An n×nn \times n matrix AA is invertible if there is an n×nn \times n matrix CC with

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

Then CC is called the inverse of AA and is written A−1A^{-1}. A square matrix that is not invertible is called singular; an invertible matrix is also called nonsingular.

The inverse, when it exists, is unique: if BB and CC are both inverses of AA, then B=BI=B(AC)=(BA)C=IC=CB = BI = B(AC) = (BA)C = IC = C. Only square matrices get inverses in this sense.

The 2 × 2 case

For A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}, multiply by [d−b−ca]\begin{bmatrix} d & -b \\ -c & a \end{bmatrix} and see what happens:

[abcd][d−b−ca]=[ad−bc00ad−bc]=(ad−bc)I.\begin{bmatrix} a & b \\ c & d \end{bmatrix}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix} = \begin{bmatrix} ad - bc & 0 \\ 0 & ad - bc \end{bmatrix} = (ad - bc)I.

If the number ad−bcad - bc is not zero, dividing by it gives the inverse. The number ad−bcad - bc is the determinant of AA, written det⁡A\det A. The next unit studies it in depth.

Inverse of a 2 × 2 matrix

If A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} and ad−bc≠0ad - bc \ne 0, then

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

If ad−bc=0ad - bc = 0, then AA is not invertible.

In words: swap the diagonal entries, negate the off-diagonal entries and divide by the determinant.

Solving systems with an inverse

If AA is invertible, then for every b\mathbf{b} in Rn\mathbb{R}^n the equation Ax=bA\mathbf{x} = \mathbf{b} has exactly one solution, namely x=A−1b\mathbf{x} = A^{-1}\mathbf{b}. It is a solution because A(A−1b)=Ib=bA(A^{-1}\mathbf{b}) = I\mathbf{b} = \mathbf{b}. It is the only one because any solution u\mathbf{u} satisfies u=A−1Au=A−1b\mathbf{u} = A^{-1}A\mathbf{u} = A^{-1}\mathbf{b}.

Worked example: Using the formula

Solve 3x1+5x2=4x1+2x2=1\begin{aligned} 3x_1 + 5x_2 &= 4 \\ x_1 + 2x_2 &= 1 \end{aligned} using an inverse.

The coefficient matrix is A=[3512]A = \begin{bmatrix} 3 & 5 \\ 1 & 2 \end{bmatrix}, and det⁡A=3(2)−5(1)=1\det A = 3(2) - 5(1) = 1. So

A−1=[2−5−13],x=A−1b=[2−5−13][41]=[3−1].A^{-1} = \begin{bmatrix} 2 & -5 \\ -1 & 3 \end{bmatrix}, \qquad \mathbf{x} = A^{-1}\mathbf{b} = \begin{bmatrix} 2 & -5 \\ -1 & 3 \end{bmatrix}\begin{bmatrix} 4 \\ 1 \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \end{bmatrix}.

Check: 3(3)+5(−1)=43(3) + 5(-1) = 4 and 3+2(−1)=13 + 2(-1) = 1.

In practice, row reducing [Ab]\begin{bmatrix} A & \mathbf{b} \end{bmatrix} is faster than computing A−1A^{-1} for a single system. The inverse earns its keep in theory, and when you must solve with the same AA for many different right-hand sides.

Algebra of inverses

If AA and BB are invertible n×nn \times n matrices, then:

  1. A−1A^{-1} is invertible and (A−1)−1=A(A^{-1})^{-1} = A.
  2. ABAB is invertible and (AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1}.
  3. ATA^T is invertible and (AT)−1=(A−1)T(A^T)^{-1} = (A^{-1})^T.

For rule 2, check directly: (AB)(B−1A−1)=A(BB−1)A−1=AA−1=I(AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = AA^{-1} = I, and similarly in the other order. The order reverses for the same reason you take off your shoes before your socks: the last thing done is the first thing undone.

Common mistake

(AB)−1(AB)^{-1} is B−1A−1B^{-1}A^{-1}, not A−1B−1A^{-1}B^{-1}. Since matrix multiplication doesn't commute, these are usually different. Also, (A+B)−1(A + B)^{-1} has no simple formula; it need not even exist when AA and BB are both invertible (try B=−AB = -A).

Elementary matrices

An elementary matrix is what you get by performing one elementary row operation on InI_n. The key fact: performing that row operation on any n×mn \times m matrix AA gives the same result as computing EAEA.

For instance, with E=[100010−301]E = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -3 & 0 & 1 \end{bmatrix} (add −3-3 times row 1 to row 3), EAEA is AA with that replacement carried out. Every row operation can be undone by another row operation of the same type, so every elementary matrix is invertible, and E−1E^{-1} is the elementary matrix of the reverse operation. Here, E−1E^{-1} adds +3+3 times row 1 to row 3.

Now suppose a sequence of row operations reduces AA to II: Ek⋯E2E1A=IE_k \cdots E_2E_1A = I. Then Ek⋯E1E_k \cdots E_1 is exactly A−1A^{-1}. Applying those same operations to II produces Ek⋯E1I=A−1E_k \cdots E_1 I = A^{-1}. That gives an algorithm.

Finding A⁻¹ by row reduction

Row reduce the augmented matrix [AI]\begin{bmatrix} A & I \end{bmatrix}.

  • If AA is row equivalent to II, then [AI]\begin{bmatrix} A & I \end{bmatrix} reduces to [IA−1]\begin{bmatrix} I & A^{-1} \end{bmatrix}.
  • Otherwise, AA is not invertible.

Worked example: A 3 × 3 inverse

Find the inverse of A=[101011111]A = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 1 \end{bmatrix}, if it exists.

Start with [AI]\begin{bmatrix} A & I \end{bmatrix} and subtract row 1 from row 3, then row 2 from row 3:

[101100011010111001]∼[10110001101000−1−1−11].\left[\begin{array}{ccc|ccc} 1 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 0 & 0 & 1 \end{array}\right] \sim \left[\begin{array}{ccc|ccc} 1 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & -1 & -1 & -1 & 1 \end{array}\right].

Multiply row 3 by −1-1, then subtract row 3 from rows 1 and 2:

∼[10110001101000111−1]∼[1000−11010−10100111−1].\sim \left[\begin{array}{ccc|ccc} 1 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 1 & -1 \end{array}\right] \sim \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & 0 & -1 & 1 \\ 0 & 1 & 0 & -1 & 0 & 1 \\ 0 & 0 & 1 & 1 & 1 & -1 \end{array}\right].

The left block is II, so

A−1=[0−11−10111−1].A^{-1} = \begin{bmatrix} 0 & -1 & 1 \\ -1 & 0 & 1 \\ 1 & 1 & -1 \end{bmatrix}.

Check one column: A[0−11]=[0+0+10−1+10−1+1]=[100]A\begin{bmatrix} 0 \\ -1 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 + 0 + 1 \\ 0 - 1 + 1 \\ 0 - 1 + 1 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}, the first column of II.

Worked example: A singular matrix

Is B=[123257134]B = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 5 & 7 \\ 1 & 3 & 4 \end{bmatrix} invertible?

Subtract 22 times row 1 from row 2 and row 1 from row 3:

[123011011]∼[123011000].\begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 1 \\ 0 & 1 & 1 \end{bmatrix} \sim \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}.

There is a row of zeros, so BB has only two pivots and cannot be row reduced to II. BB is not invertible. (You can see why: row 3 of BB equals row 2 minus row 1.)

Tip

Always check a computed inverse by multiplying it by AA, at least for one column. An arithmetic slip anywhere in the row reduction shows up immediately.

Practice

Practice 1

Let A=[4332]A = \begin{bmatrix} 4 & 3 \\ 3 & 2 \end{bmatrix}. What is the (2,2)(2, 2) entry of A−1A^{-1}?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

For what value of kk is [2k69]\begin{bmatrix} 2 & k \\ 6 & 9 \end{bmatrix} not invertible?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Use an inverse to solve 2x1+x2=15x1+3x2=−2.\begin{aligned} 2x_1 + x_2 &= 1 \\ 5x_1 + 3x_2 &= -2. \end{aligned} Enter (x1,x2)(x_1, x_2).

Enter a point like (2, -3)

Practice 4

An invertible matrix AA has A−1=[1235]A^{-1} = \begin{bmatrix} 1 & 2 \\ 3 & 5 \end{bmatrix}. Solve Ax=[11]A\mathbf{x} = \begin{bmatrix} 1 \\ 1 \end{bmatrix}. Enter x\mathbf{x} as (x1,x2)(x_1, x_2).

Enter a point like (2, -3)

Practice 5

AA, BB and CC are invertible n×nn \times n matrices. Which expression equals (ABC)−1(ABC)^{-1}?

Practice 6

Let L=[100210−341]L = \begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -3 & 4 & 1 \end{bmatrix}. Find the entry in row 3, column 1 of L−1L^{-1}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

AA is an invertible 3×33 \times 3 matrix with A2=2AA^2 = 2A. What is the sum of the diagonal entries of AA?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.