Theory: The Inverse of a Matrix
The Inverse of a Matrix (Lay §2.2)
An n × n n \times n n × n matrix A A A is invertible if there is an n × n n \times n n × n matrix C C C with
C A = I and A C = I CA = I \quad \text{and} \quad AC = I C A = I and A C = I
This C C C is unique , is called the inverse of A A A , and is written A − 1 A^{-1} A − 1 :
A − 1 A = I and A A − 1 = I A^{-1}A = I \quad \text{and} \quad AA^{-1} = I A − 1 A = I and A A − 1 = I
A matrix that is not invertible is called singular .
An invertible matrix is called nonsingular .
Only square matrices can have inverses.
Theorem 4 (Lay §2.2) : Let A = [ a b c d ] A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} A = [ a c b d ] . If a d − b c ≠ 0 ad - bc \ne 0 a d − b c = 0 , then A A A is invertible and
A − 1 = 1 a d − b c [ d − b − c a ] A^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix} A − 1 = a d − b c 1 [ d − c − b a ]
If a d − b c = 0 ad - bc = 0 a d − b c = 0 , then A A A is not invertible.
The number a d − b c ad - bc a d − b c is the determinant of A A A : det A = a d − b c \det A = ad - bc det A = a d − b c . So a 2 × 2 2 \times 2 2 × 2 matrix is invertible if and only if det A ≠ 0 \det A \ne 0 det A = 0 .
Recipe for the 2 × 2 2 \times 2 2 × 2 formula: swap the diagonal entries a ↔ d a \leftrightarrow d a ↔ d , negate the off-diagonal entries b , c b, c b , c , divide by a d − b c ad - bc a d − b c .
Mini-example. A = [ 3 4 5 6 ] A = \begin{bmatrix} 3 & 4 \\ 5 & 6 \end{bmatrix} A = [ 3 5 4 6 ] : det A = 18 − 20 = − 2 \det A = 18 - 20 = -2 det A = 18 − 20 = − 2 , so
A − 1 = 1 − 2 [ 6 − 4 − 5 3 ] = [ − 3 2 5 / 2 − 3 / 2 ] A^{-1} = \frac{1}{-2}\begin{bmatrix} 6 & -4 \\ -5 & 3 \end{bmatrix} = \begin{bmatrix} -3 & 2 \\ 5/2 & -3/2 \end{bmatrix} A − 1 = − 2 1 [ 6 − 5 − 4 3 ] = [ − 3 5/2 2 − 3/2 ]
Solving A x = b A\mathbf{x} = \mathbf{b} A x = b with A − 1 A^{-1} A − 1
Theorem 5 (Lay §2.2) : If A A A is an invertible n × n n \times n n × n matrix, then for each b \mathbf{b} b in R n \mathbb{R}^n R n , the equation A x = b A\mathbf{x} = \mathbf{b} A x = b has the unique solution
x = A − 1 b \mathbf{x} = A^{-1}\mathbf{b} x = A − 1 b
Why: A ( A − 1 b ) = I b = b A(A^{-1}\mathbf{b}) = I\mathbf{b} = \mathbf{b} A ( A − 1 b ) = I b = b , so it is a solution; and if A u = b A\mathbf{u} = \mathbf{b} A u = b , multiply on the left by A − 1 A^{-1} A − 1 to get u = A − 1 b \mathbf{u} = A^{-1}\mathbf{b} u = A − 1 b , so it is the only one.
In practice, row reducing [ A b ] \left[\begin{array}{c|c} A & \mathbf{b} \end{array}\right] [ A b ] is faster than computing A − 1 A^{-1} A − 1 first. Use x = A − 1 b \mathbf{x} = A^{-1}\mathbf{b} x = A − 1 b when the question gives you A − 1 A^{-1} A − 1 , when A A A is 2 × 2 2 \times 2 2 × 2 , or when you must solve many systems with the same A A A .
Properties of Inverses
Theorem 6 (Lay §2.2) :
If A A A is invertible, then A − 1 A^{-1} A − 1 is invertible and ( A − 1 ) − 1 = A (A^{-1})^{-1} = A ( A − 1 ) − 1 = A .
If A A A and B B B are n × n n \times n n × n invertible matrices, then so is A B AB A B , and ( A B ) − 1 = B − 1 A − 1 (AB)^{-1} = B^{-1}A^{-1} ( A B ) − 1 = B − 1 A − 1 .
If A A A is invertible, then so is A T A^T A T , and ( A T ) − 1 = ( A − 1 ) T (A^T)^{-1} = (A^{-1})^T ( A T ) − 1 = ( A − 1 ) T .
Generalisation: a product of invertible matrices is invertible, and its inverse is the product of the inverses in reverse order : ( A B C ) − 1 = C − 1 B − 1 A − 1 (ABC)^{-1} = C^{-1}B^{-1}A^{-1} ( A B C ) − 1 = C − 1 B − 1 A − 1 .
Common mistake : ( A B ) − 1 ≠ A − 1 B − 1 (AB)^{-1} \ne A^{-1}B^{-1} ( A B ) − 1 = A − 1 B − 1 in general. Check: ( A B ) ( B − 1 A − 1 ) = A ( B B − 1 ) A − 1 = A I A − 1 = A A − 1 = I (AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = AIA^{-1} = AA^{-1} = I ( A B ) ( B − 1 A − 1 ) = A ( B B − 1 ) A − 1 = A I A − 1 = A A − 1 = I . The reverse order is what makes the middle cancel (“socks and shoes”: you take off the last thing you put on first).
Elementary Matrices (brief)
An elementary matrix is obtained by performing one elementary row operation (switch / scale / replace) on the identity I n I_n I n .
Performing a row operation on A A A gives the same result as computing E A EA E A , where E E E is the elementary matrix made by doing that same operation to I I I .
Every elementary matrix is invertible; E − 1 E^{-1} E − 1 is the elementary matrix of the reverse operation (e.g. the inverse of "R 2 ← R 2 − 4 R 1 R_2 \leftarrow R_2 - 4R_1 R 2 ← R 2 − 4 R 1 " is "R 2 ← R 2 + 4 R 1 R_2 \leftarrow R_2 + 4R_1 R 2 ← R 2 + 4 R 1 ").
Mini-example. E = [ 1 0 0 0 1 0 − 4 0 1 ] E = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -4 & 0 & 1 \end{bmatrix} E = 1 0 − 4 0 1 0 0 0 1 comes from R 3 ← R 3 − 4 R 1 R_3 \leftarrow R_3 - 4R_1 R 3 ← R 3 − 4 R 1 on I 3 I_3 I 3 , so E A EA E A subtracts 4 times row 1 of A A A from row 3 of A A A .
Theorem 7 (Lay §2.2) : An n × n n \times n n × n matrix A A A is invertible if and only if A A A is row equivalent to I n I_n I n . In that case, any sequence of elementary row operations that reduces A A A to I n I_n I n also transforms I n I_n I n into A − 1 A^{-1} A − 1 .
Why: if E p ⋯ E 1 A = I E_p \cdots E_1 A = I E p ⋯ E 1 A = I , then A − 1 = E p ⋯ E 1 = E p ⋯ E 1 I A^{-1} = E_p \cdots E_1 = E_p \cdots E_1 I A − 1 = E p ⋯ E 1 = E p ⋯ E 1 I , so the same row operations applied to I I I produce A − 1 A^{-1} A − 1 .
The Algorithm for Finding A − 1 A^{-1} A − 1
Form the n × 2 n n \times 2n n × 2 n matrix [ A I ] \left[\begin{array}{c|c} A & I \end{array}\right] [ A I ] .
Row reduce it.
If A A A reduces to I I I , then
[ A I ] ∼ [ I A − 1 ] \left[\begin{array}{c|c} A & I \end{array}\right] \sim \left[\begin{array}{c|c} I & A^{-1} \end{array}\right] [ A I ] ∼ [ I A − 1 ]
and A − 1 A^{-1} A − 1 is read off the right half.
Otherwise (a row of zeros appears on the left, i.e. fewer than n n n pivots), A A A has no inverse .
Example 7 (Lay §2.2). Find the inverse of A = [ 0 1 2 1 0 3 4 − 3 8 ] A = \begin{bmatrix} 0 & 1 & 2 \\ 1 & 0 & 3 \\ 4 & -3 & 8 \end{bmatrix} A = 0 1 4 1 0 − 3 2 3 8 , if it exists.
[ 0 1 2 1 0 0 1 0 3 0 1 0 4 − 3 8 0 0 1 ] → R 1 ↔ R 2 [ 1 0 3 0 1 0 0 1 2 1 0 0 4 − 3 8 0 0 1 ] \left[\begin{array}{ccc|ccc} 0 & 1 & 2 & 1 & 0 & 0 \\ 1 & 0 & 3 & 0 & 1 & 0 \\ 4 & -3 & 8 & 0 & 0 & 1 \end{array}\right]
\xrightarrow{R_1 \leftrightarrow R_2}
\left[\begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 4 & -3 & 8 & 0 & 0 & 1 \end{array}\right] 0 1 4 1 0 − 3 2 3 8 1 0 0 0 1 0 0 0 1 R 1 ↔ R 2 1 0 4 0 1 − 3 3 2 8 0 1 0 1 0 0 0 0 1
R 3 ← R 3 − 4 R 1 R_3 \leftarrow R_3 - 4R_1 R 3 ← R 3 − 4 R 1 , then R 3 ← R 3 + 3 R 2 R_3 \leftarrow R_3 + 3R_2 R 3 ← R 3 + 3 R 2 :
∼ [ 1 0 3 0 1 0 0 1 2 1 0 0 0 − 3 − 4 0 − 4 1 ] ∼ [ 1 0 3 0 1 0 0 1 2 1 0 0 0 0 2 3 − 4 1 ] \sim \left[\begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & -3 & -4 & 0 & -4 & 1 \end{array}\right]
\sim \left[\begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & 0 & 2 & 3 & -4 & 1 \end{array}\right] ∼ 1 0 0 0 1 − 3 3 2 − 4 0 1 0 1 0 − 4 0 0 1 ∼ 1 0 0 0 1 0 3 2 2 0 1 3 1 0 − 4 0 0 1
R 3 ← 1 2 R 3 R_3 \leftarrow \tfrac12 R_3 R 3 ← 2 1 R 3 , then R 1 ← R 1 − 3 R 3 R_1 \leftarrow R_1 - 3R_3 R 1 ← R 1 − 3 R 3 and R 2 ← R 2 − 2 R 3 R_2 \leftarrow R_2 - 2R_3 R 2 ← R 2 − 2 R 3 :
∼ [ 1 0 3 0 1 0 0 1 2 1 0 0 0 0 1 3 / 2 − 2 1 / 2 ] ∼ [ 1 0 0 − 9 / 2 7 − 3 / 2 0 1 0 − 2 4 − 1 0 0 1 3 / 2 − 2 1 / 2 ] \sim \left[\begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & 0 & 1 & 3/2 & -2 & 1/2 \end{array}\right]
\sim \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & -9/2 & 7 & -3/2 \\ 0 & 1 & 0 & -2 & 4 & -1 \\ 0 & 0 & 1 & 3/2 & -2 & 1/2 \end{array}\right] ∼ 1 0 0 0 1 0 3 2 1 0 1 3/2 1 0 − 2 0 0 1/2 ∼ 1 0 0 0 1 0 0 0 1 − 9/2 − 2 3/2 7 4 − 2 − 3/2 − 1 1/2
The left half is I I I , so A A A is invertible and
A − 1 = [ − 9 / 2 7 − 3 / 2 − 2 4 − 1 3 / 2 − 2 1 / 2 ] A^{-1} = \begin{bmatrix} -9/2 & 7 & -3/2 \\ -2 & 4 & -1 \\ 3/2 & -2 & 1/2 \end{bmatrix} A − 1 = − 9/2 − 2 3/2 7 4 − 2 − 3/2 − 1 1/2
Always check : multiply one row of A A A by one column of your A − 1 A^{-1} A − 1 . E.g. row 1 of A A A times column 1 of A − 1 A^{-1} A − 1 : 0 ( − 9 / 2 ) + 1 ( − 2 ) + 2 ( 3 / 2 ) = 1 0(-9/2) + 1(-2) + 2(3/2) = 1 0 ( − 9/2 ) + 1 ( − 2 ) + 2 ( 3/2 ) = 1 ✓, matching the ( 1 , 1 ) (1,1) ( 1 , 1 ) entry of I I I .
Finding Just One Column of A − 1 A^{-1} A − 1
Since A A − 1 = I AA^{-1} = I A A − 1 = I , column j j j of A − 1 A^{-1} A − 1 is the solution of
A x = e j A\mathbf{x} = \mathbf{e}_j A x = e j
where e j \mathbf{e}_j e j is column j j j of I I I . So to get only column j j j of A − 1 A^{-1} A − 1 , row reduce [ A e j ] \left[\begin{array}{c|c} A & \mathbf{e}_j \end{array}\right] [ A e j ] instead of the full [ A I ] \left[\begin{array}{c|c} A & I \end{array}\right] [ A I ] . (The full algorithm is just this done for all j j j at once.)
Solved Examples (Textbook Questions)
Exercise 1
(Adapted from Lay §2.2, Exercises 1–4)
Find the inverses of the matrices.
[ 8 6 5 4 ] \begin{bmatrix} 8 & 6 \\ 5 & 4 \end{bmatrix} [ 8 5 6 4 ]
[ 3 2 7 4 ] \begin{bmatrix} 3 & 2 \\ 7 & 4 \end{bmatrix} [ 3 7 2 4 ]
[ 8 5 − 7 − 5 ] \begin{bmatrix} 8 & 5 \\ -7 & -5 \end{bmatrix} [ 8 − 7 5 − 5 ]
[ 3 − 4 7 − 8 ] \begin{bmatrix} 3 & -4 \\ 7 & -8 \end{bmatrix} [ 3 7 − 4 − 8 ]
Show solution ↓ Hide solution ↑ Solution
Use Theorem 4: compute a d − b c ad - bc a d − b c , swap the diagonal, negate the off-diagonal, divide.
1. det = 8 ( 4 ) − 6 ( 5 ) = 32 − 30 = 2 \det = 8(4) - 6(5) = 32 - 30 = 2 det = 8 ( 4 ) − 6 ( 5 ) = 32 − 30 = 2 .
[ 8 6 5 4 ] − 1 = 1 2 [ 4 − 6 − 5 8 ] = [ 2 − 3 − 5 / 2 4 ] \begin{bmatrix} 8 & 6 \\ 5 & 4 \end{bmatrix}^{-1} = \frac{1}{2}\begin{bmatrix} 4 & -6 \\ -5 & 8 \end{bmatrix} = \begin{bmatrix} 2 & -3 \\ -5/2 & 4 \end{bmatrix} [ 8 5 6 4 ] − 1 = 2 1 [ 4 − 5 − 6 8 ] = [ 2 − 5/2 − 3 4 ] 2. det = 3 ( 4 ) − 2 ( 7 ) = 12 − 14 = − 2 \det = 3(4) - 2(7) = 12 - 14 = -2 det = 3 ( 4 ) − 2 ( 7 ) = 12 − 14 = − 2 .
[ 3 2 7 4 ] − 1 = 1 − 2 [ 4 − 2 − 7 3 ] = [ − 2 1 7 / 2 − 3 / 2 ] \begin{bmatrix} 3 & 2 \\ 7 & 4 \end{bmatrix}^{-1} = \frac{1}{-2}\begin{bmatrix} 4 & -2 \\ -7 & 3 \end{bmatrix} = \begin{bmatrix} -2 & 1 \\ 7/2 & -3/2 \end{bmatrix} [ 3 7 2 4 ] − 1 = − 2 1 [ 4 − 7 − 2 3 ] = [ − 2 7/2 1 − 3/2 ] 3. det = 8 ( − 5 ) − 5 ( − 7 ) = − 40 + 35 = − 5 \det = 8(-5) - 5(-7) = -40 + 35 = -5 det = 8 ( − 5 ) − 5 ( − 7 ) = − 40 + 35 = − 5 .
[ 8 5 − 7 − 5 ] − 1 = − 1 5 [ − 5 − 5 7 8 ] = [ 1 1 − 1.4 − 1.6 ] \begin{bmatrix} 8 & 5 \\ -7 & -5 \end{bmatrix}^{-1} = -\frac{1}{5}\begin{bmatrix} -5 & -5 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ -1.4 & -1.6 \end{bmatrix} [ 8 − 7 5 − 5 ] − 1 = − 5 1 [ − 5 7 − 5 8 ] = [ 1 − 1.4 1 − 1.6 ] 4. det = 3 ( − 8 ) − ( − 4 ) ( 7 ) = − 24 + 28 = 4 \det = 3(-8) - (-4)(7) = -24 + 28 = 4 det = 3 ( − 8 ) − ( − 4 ) ( 7 ) = − 24 + 28 = 4 .
[ 3 − 4 7 − 8 ] − 1 = 1 4 [ − 8 4 − 7 3 ] = [ − 2 1 − 7 / 4 3 / 4 ] \begin{bmatrix} 3 & -4 \\ 7 & -8 \end{bmatrix}^{-1} = \frac{1}{4}\begin{bmatrix} -8 & 4 \\ -7 & 3 \end{bmatrix} = \begin{bmatrix} -2 & 1 \\ -7/4 & 3/4 \end{bmatrix} [ 3 7 − 4 − 8 ] − 1 = 4 1 [ − 8 − 7 4 3 ] = [ − 2 − 7/4 1 3/4 ] Check (part 1): [ 8 6 5 4 ] [ 2 − 3 − 5 / 2 4 ] = [ 16 − 15 − 24 + 24 10 − 10 − 15 + 16 ] = I \begin{bmatrix} 8 & 6 \\ 5 & 4 \end{bmatrix}\begin{bmatrix} 2 & -3 \\ -5/2 & 4 \end{bmatrix} = \begin{bmatrix} 16 - 15 & -24 + 24 \\ 10 - 10 & -15 + 16 \end{bmatrix} = I [ 8 5 6 4 ] [ 2 − 5/2 − 3 4 ] = [ 16 − 15 10 − 10 − 24 + 24 − 15 + 16 ] = I ✓
Common mistake : watch the sign of b c bc b c when b b b or c c c is negative. In part 3, a d − b c = − 40 − ( 5 ) ( − 7 ) = − 40 + 35 ad - bc = -40 - (5)(-7) = -40 + 35 a d − b c = − 40 − ( 5 ) ( − 7 ) = − 40 + 35 , not − 40 − 35 -40 - 35 − 40 − 35 .
Exercise 2
(Adapted from Lay §2.2, Exercise 7)
Let A = [ 1 2 5 12 ] A = \begin{bmatrix} 1 & 2 \\ 5 & 12 \end{bmatrix} A = [ 1 5 2 12 ] , b 1 = [ − 1 3 ] \mathbf{b}_1 = \begin{bmatrix} -1 \\ 3 \end{bmatrix} b 1 = [ − 1 3 ] , b 2 = [ 1 − 5 ] \mathbf{b}_2 = \begin{bmatrix} 1 \\ -5 \end{bmatrix} b 2 = [ 1 − 5 ] , b 3 = [ 2 6 ] \mathbf{b}_3 = \begin{bmatrix} 2 \\ 6 \end{bmatrix} b 3 = [ 2 6 ] , and b 4 = [ 3 5 ] \mathbf{b}_4 = \begin{bmatrix} 3 \\ 5 \end{bmatrix} b 4 = [ 3 5 ] .
a. Find A − 1 A^{-1} A − 1 , and use it to solve the four equations A x = b 1 A\mathbf{x} = \mathbf{b}_1 A x = b 1 , A x = b 2 A\mathbf{x} = \mathbf{b}_2 A x = b 2 , A x = b 3 A\mathbf{x} = \mathbf{b}_3 A x = b 3 , A x = b 4 A\mathbf{x} = \mathbf{b}_4 A x = b 4 .
b. The four equations in part (a) can be solved by the same set of row operations, since the coefficient matrix is the same in each case. Solve the four equations in part (a) by row reducing the augmented matrix [ A b 1 b 2 b 3 b 4 ] \begin{bmatrix} A & \mathbf{b}_1 & \mathbf{b}_2 & \mathbf{b}_3 & \mathbf{b}_4 \end{bmatrix} [ A b 1 b 2 b 3 b 4 ] .
Show solution ↓ Hide solution ↑ Solution
(a) det A = 1 ( 12 ) − 2 ( 5 ) = 2 \det A = 1(12) - 2(5) = 2 det A = 1 ( 12 ) − 2 ( 5 ) = 2 , so
A − 1 = 1 2 [ 12 − 2 − 5 1 ] = [ 6 − 1 − 2.5 0.5 ] A^{-1} = \frac{1}{2}\begin{bmatrix} 12 & -2 \\ -5 & 1 \end{bmatrix} = \begin{bmatrix} 6 & -1 \\ -2.5 & 0.5 \end{bmatrix} A − 1 = 2 1 [ 12 − 5 − 2 1 ] = [ 6 − 2.5 − 1 0.5 ] By Theorem 5, x = A − 1 b \mathbf{x} = A^{-1}\mathbf{b} x = A − 1 b :
A − 1 b 1 = 1 2 [ 12 − 2 − 5 1 ] [ − 1 3 ] = 1 2 [ − 18 8 ] = [ − 9 4 ] A^{-1}\mathbf{b}_1 = \frac{1}{2}\begin{bmatrix} 12 & -2 \\ -5 & 1 \end{bmatrix}\begin{bmatrix} -1 \\ 3 \end{bmatrix} = \frac{1}{2}\begin{bmatrix} -18 \\ 8 \end{bmatrix} = \begin{bmatrix} -9 \\ 4 \end{bmatrix} A − 1 b 1 = 2 1 [ 12 − 5 − 2 1 ] [ − 1 3 ] = 2 1 [ − 18 8 ] = [ − 9 4 ] A − 1 b 2 = 1 2 [ 12 + 10 − 5 − 5 ] = [ 11 − 5 ] , A − 1 b 3 = 1 2 [ 24 − 12 − 10 + 6 ] = [ 6 − 2 ] , A − 1 b 4 = 1 2 [ 36 − 10 − 15 + 5 ] = [ 13 − 5 ] A^{-1}\mathbf{b}_2 = \frac12\begin{bmatrix} 12 + 10 \\ -5 - 5 \end{bmatrix} = \begin{bmatrix} 11 \\ -5 \end{bmatrix}, \quad
A^{-1}\mathbf{b}_3 = \frac12\begin{bmatrix} 24 - 12 \\ -10 + 6 \end{bmatrix} = \begin{bmatrix} 6 \\ -2 \end{bmatrix}, \quad
A^{-1}\mathbf{b}_4 = \frac12\begin{bmatrix} 36 - 10 \\ -15 + 5 \end{bmatrix} = \begin{bmatrix} 13 \\ -5 \end{bmatrix} A − 1 b 2 = 2 1 [ 12 + 10 − 5 − 5 ] = [ 11 − 5 ] , A − 1 b 3 = 2 1 [ 24 − 12 − 10 + 6 ] = [ 6 − 2 ] , A − 1 b 4 = 2 1 [ 36 − 10 − 15 + 5 ] = [ 13 − 5 ] (b) Put all four right-hand sides next to A A A and row reduce once.
R 2 ← R 2 − 5 R 1 R_2 \leftarrow R_2 - 5R_1 R 2 ← R 2 − 5 R 1 :
[ 1 2 − 1 1 2 3 5 12 3 − 5 6 5 ] ∼ [ 1 2 − 1 1 2 3 0 2 8 − 10 − 4 − 10 ] \left[\begin{array}{cc|cccc} 1 & 2 & -1 & 1 & 2 & 3 \\ 5 & 12 & 3 & -5 & 6 & 5 \end{array}\right]
\sim \left[\begin{array}{cc|cccc} 1 & 2 & -1 & 1 & 2 & 3 \\ 0 & 2 & 8 & -10 & -4 & -10 \end{array}\right] [ 1 5 2 12 − 1 3 1 − 5 2 6 3 5 ] ∼ [ 1 0 2 2 − 1 8 1 − 10 2 − 4 3 − 10 ] R 2 ← 1 2 R 2 R_2 \leftarrow \tfrac12 R_2 R 2 ← 2 1 R 2 , then R 1 ← R 1 − 2 R 2 R_1 \leftarrow R_1 - 2R_2 R 1 ← R 1 − 2 R 2 :
∼ [ 1 2 − 1 1 2 3 0 1 4 − 5 − 2 − 5 ] ∼ [ 1 0 − 9 11 6 13 0 1 4 − 5 − 2 − 5 ] \sim \left[\begin{array}{cc|cccc} 1 & 2 & -1 & 1 & 2 & 3 \\ 0 & 1 & 4 & -5 & -2 & -5 \end{array}\right]
\sim \left[\begin{array}{cc|cccc} 1 & 0 & -9 & 11 & 6 & 13 \\ 0 & 1 & 4 & -5 & -2 & -5 \end{array}\right] ∼ [ 1 0 2 1 − 1 4 1 − 5 2 − 2 3 − 5 ] ∼ [ 1 0 0 1 − 9 4 11 − 5 6 − 2 13 − 5 ] Each column on the right is the solution of the matching system:
[ − 9 4 ] , [ 11 − 5 ] , [ 6 − 2 ] , [ 13 − 5 ] \begin{bmatrix} -9 \\ 4 \end{bmatrix}, \quad \begin{bmatrix} 11 \\ -5 \end{bmatrix}, \quad \begin{bmatrix} 6 \\ -2 \end{bmatrix}, \quad \begin{bmatrix} 13 \\ -5 \end{bmatrix} [ − 9 4 ] , [ 11 − 5 ] , [ 6 − 2 ] , [ 13 − 5 ] the same as in part (a).
This is exactly the idea behind the [ A I ] \left[\begin{array}{c|c} A & I \end{array}\right] [ A I ] algorithm: you can solve many systems with the same coefficient matrix by row reducing once with all right-hand sides attached.
Exercise 3
(Adapted from Lay §2.2, Exercises 29 and 30)
Find the inverses of the matrices, if they exist. Use the algorithm [ A I ] ∼ [ I A − 1 ] \left[\begin{array}{c|c} A & I \end{array}\right] \sim \left[\begin{array}{c|c} I & A^{-1} \end{array}\right] [ A I ] ∼ [ I A − 1 ] .
[ 1 2 4 7 ] \begin{bmatrix} 1 & 2 \\ 4 & 7 \end{bmatrix} [ 1 4 2 7 ]
[ 5 10 4 7 ] \begin{bmatrix} 5 & 10 \\ 4 & 7 \end{bmatrix} [ 5 4 10 7 ]
Show solution ↓ Hide solution ↑ Solution
Part 1 (Exercise 29). R 2 ← R 2 − 4 R 1 R_2 \leftarrow R_2 - 4R_1 R 2 ← R 2 − 4 R 1 , then R 2 ← − R 2 R_2 \leftarrow -R_2 R 2 ← − R 2 , then R 1 ← R 1 − 2 R 2 R_1 \leftarrow R_1 - 2R_2 R 1 ← R 1 − 2 R 2 :
[ 1 2 1 0 4 7 0 1 ] ∼ [ 1 2 1 0 0 − 1 − 4 1 ] ∼ [ 1 2 1 0 0 1 4 − 1 ] ∼ [ 1 0 − 7 2 0 1 4 − 1 ] \left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 4 & 7 & 0 & 1 \end{array}\right]
\sim \left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 0 & -1 & -4 & 1 \end{array}\right]
\sim \left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 0 & 1 & 4 & -1 \end{array}\right]
\sim \left[\begin{array}{cc|cc} 1 & 0 & -7 & 2 \\ 0 & 1 & 4 & -1 \end{array}\right] [ 1 4 2 7 1 0 0 1 ] ∼ [ 1 0 2 − 1 1 − 4 0 1 ] ∼ [ 1 0 2 1 1 4 0 − 1 ] ∼ [ 1 0 0 1 − 7 4 2 − 1 ] A − 1 = [ − 7 2 4 − 1 ] A^{-1} = \begin{bmatrix} -7 & 2 \\ 4 & -1 \end{bmatrix} A − 1 = [ − 7 4 2 − 1 ] (Check with Theorem 4: det A = 7 − 8 = − 1 \det A = 7 - 8 = -1 det A = 7 − 8 = − 1 , so A − 1 = − [ 7 − 2 − 4 1 ] A^{-1} = -\begin{bmatrix} 7 & -2 \\ -4 & 1 \end{bmatrix} A − 1 = − [ 7 − 4 − 2 1 ] ✓.)
Part 2 (Exercise 30). R 1 ← 1 5 R 1 R_1 \leftarrow \tfrac15 R_1 R 1 ← 5 1 R 1 , then R 2 ← R 2 − 4 R 1 R_2 \leftarrow R_2 - 4R_1 R 2 ← R 2 − 4 R 1 :
[ 5 10 1 0 4 7 0 1 ] ∼ [ 1 2 1 / 5 0 4 7 0 1 ] ∼ [ 1 2 1 / 5 0 0 − 1 − 4 / 5 1 ] \left[\begin{array}{cc|cc} 5 & 10 & 1 & 0 \\ 4 & 7 & 0 & 1 \end{array}\right]
\sim \left[\begin{array}{cc|cc} 1 & 2 & 1/5 & 0 \\ 4 & 7 & 0 & 1 \end{array}\right]
\sim \left[\begin{array}{cc|cc} 1 & 2 & 1/5 & 0 \\ 0 & -1 & -4/5 & 1 \end{array}\right] [ 5 4 10 7 1 0 0 1 ] ∼ [ 1 4 2 7 1/5 0 0 1 ] ∼ [ 1 0 2 − 1 1/5 − 4/5 0 1 ] R 2 ← − R 2 R_2 \leftarrow -R_2 R 2 ← − R 2 , then R 1 ← R 1 − 2 R 2 R_1 \leftarrow R_1 - 2R_2 R 1 ← R 1 − 2 R 2 :
∼ [ 1 2 1 / 5 0 0 1 4 / 5 − 1 ] ∼ [ 1 0 − 7 / 5 2 0 1 4 / 5 − 1 ] \sim \left[\begin{array}{cc|cc} 1 & 2 & 1/5 & 0 \\ 0 & 1 & 4/5 & -1 \end{array}\right]
\sim \left[\begin{array}{cc|cc} 1 & 0 & -7/5 & 2 \\ 0 & 1 & 4/5 & -1 \end{array}\right] ∼ [ 1 0 2 1 1/5 4/5 0 − 1 ] ∼ [ 1 0 0 1 − 7/5 4/5 2 − 1 ] A − 1 = [ − 7 / 5 2 4 / 5 − 1 ] A^{-1} = \begin{bmatrix} -7/5 & 2 \\ 4/5 & -1 \end{bmatrix} A − 1 = [ − 7/5 4/5 2 − 1 ] (Check: det A = 35 − 40 = − 5 \det A = 35 - 40 = -5 det A = 35 − 40 = − 5 , and − 1 5 [ 7 − 10 − 4 5 ] = [ − 7 / 5 2 4 / 5 − 1 ] -\tfrac15\begin{bmatrix} 7 & -10 \\ -4 & 5 \end{bmatrix} = \begin{bmatrix} -7/5 & 2 \\ 4/5 & -1 \end{bmatrix} − 5 1 [ 7 − 4 − 10 5 ] = [ − 7/5 4/5 2 − 1 ] ✓.)
Exercise 4
(Adapted from Lay §2.2, Exercises 31 and 32)
Find the inverses of the matrices, if they exist. Use the algorithm introduced in this section.
A = [ 1 0 − 2 − 3 1 4 2 − 3 4 ] A = \begin{bmatrix} 1 & 0 & -2 \\ -3 & 1 & 4 \\ 2 & -3 & 4 \end{bmatrix} A = 1 − 3 2 0 1 − 3 − 2 4 4
A = [ 1 − 2 1 4 − 7 3 − 2 6 − 4 ] A = \begin{bmatrix} 1 & -2 & 1 \\ 4 & -7 & 3 \\ -2 & 6 & -4 \end{bmatrix} A = 1 4 − 2 − 2 − 7 6 1 3 − 4
Show solution ↓ Hide solution ↑ Solution
Part 1 (Exercise 31). R 2 ← R 2 + 3 R 1 R_2 \leftarrow R_2 + 3R_1 R 2 ← R 2 + 3 R 1 and R 3 ← R 3 − 2 R 1 R_3 \leftarrow R_3 - 2R_1 R 3 ← R 3 − 2 R 1 :
[ 1 0 − 2 1 0 0 − 3 1 4 0 1 0 2 − 3 4 0 0 1 ] ∼ [ 1 0 − 2 1 0 0 0 1 − 2 3 1 0 0 − 3 8 − 2 0 1 ] \left[\begin{array}{ccc|ccc} 1 & 0 & -2 & 1 & 0 & 0 \\ -3 & 1 & 4 & 0 & 1 & 0 \\ 2 & -3 & 4 & 0 & 0 & 1 \end{array}\right]
\sim \left[\begin{array}{ccc|ccc} 1 & 0 & -2 & 1 & 0 & 0 \\ 0 & 1 & -2 & 3 & 1 & 0 \\ 0 & -3 & 8 & -2 & 0 & 1 \end{array}\right] 1 − 3 2 0 1 − 3 − 2 4 4 1 0 0 0 1 0 0 0 1 ∼ 1 0 0 0 1 − 3 − 2 − 2 8 1 3 − 2 0 1 0 0 0 1 R 3 ← R 3 + 3 R 2 R_3 \leftarrow R_3 + 3R_2 R 3 ← R 3 + 3 R 2 :
∼ [ 1 0 − 2 1 0 0 0 1 − 2 3 1 0 0 0 2 7 3 1 ] \sim \left[\begin{array}{ccc|ccc} 1 & 0 & -2 & 1 & 0 & 0 \\ 0 & 1 & -2 & 3 & 1 & 0 \\ 0 & 0 & 2 & 7 & 3 & 1 \end{array}\right] ∼ 1 0 0 0 1 0 − 2 − 2 2 1 3 7 0 1 3 0 0 1 Three pivots, so A A A is invertible. R 1 ← R 1 + R 3 R_1 \leftarrow R_1 + R_3 R 1 ← R 1 + R 3 and R 2 ← R 2 + R 3 R_2 \leftarrow R_2 + R_3 R 2 ← R 2 + R 3 , then R 3 ← 1 2 R 3 R_3 \leftarrow \tfrac12 R_3 R 3 ← 2 1 R 3 :
∼ [ 1 0 0 8 3 1 0 1 0 10 4 1 0 0 2 7 3 1 ] ∼ [ 1 0 0 8 3 1 0 1 0 10 4 1 0 0 1 7 / 2 3 / 2 1 / 2 ] \sim \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & 8 & 3 & 1 \\ 0 & 1 & 0 & 10 & 4 & 1 \\ 0 & 0 & 2 & 7 & 3 & 1 \end{array}\right]
\sim \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & 8 & 3 & 1 \\ 0 & 1 & 0 & 10 & 4 & 1 \\ 0 & 0 & 1 & 7/2 & 3/2 & 1/2 \end{array}\right] ∼ 1 0 0 0 1 0 0 0 2 8 10 7 3 4 3 1 1 1 ∼ 1 0 0 0 1 0 0 0 1 8 10 7/2 3 4 3/2 1 1 1/2 A − 1 = [ 8 3 1 10 4 1 7 / 2 3 / 2 1 / 2 ] A^{-1} = \begin{bmatrix} 8 & 3 & 1 \\ 10 & 4 & 1 \\ 7/2 & 3/2 & 1/2 \end{bmatrix} A − 1 = 8 10 7/2 3 4 3/2 1 1 1/2 Check row 1 of A A A against the columns of A − 1 A^{-1} A − 1 : 1 ( 8 ) + 0 − 2 ( 7 / 2 ) = 1 1(8) + 0 - 2(7/2) = 1 1 ( 8 ) + 0 − 2 ( 7/2 ) = 1 , 1 ( 3 ) + 0 − 2 ( 3 / 2 ) = 0 \;1(3) + 0 - 2(3/2) = 0 1 ( 3 ) + 0 − 2 ( 3/2 ) = 0 , 1 ( 1 ) + 0 − 2 ( 1 / 2 ) = 0 \;1(1) + 0 - 2(1/2) = 0 1 ( 1 ) + 0 − 2 ( 1/2 ) = 0 ✓.
Part 2 (Exercise 32). R 2 ← R 2 − 4 R 1 R_2 \leftarrow R_2 - 4R_1 R 2 ← R 2 − 4 R 1 and R 3 ← R 3 + 2 R 1 R_3 \leftarrow R_3 + 2R_1 R 3 ← R 3 + 2 R 1 :
[ 1 − 2 1 1 0 0 4 − 7 3 0 1 0 − 2 6 − 4 0 0 1 ] ∼ [ 1 − 2 1 1 0 0 0 1 − 1 − 4 1 0 0 2 − 2 2 0 1 ] \left[\begin{array}{ccc|ccc} 1 & -2 & 1 & 1 & 0 & 0 \\ 4 & -7 & 3 & 0 & 1 & 0 \\ -2 & 6 & -4 & 0 & 0 & 1 \end{array}\right]
\sim \left[\begin{array}{ccc|ccc} 1 & -2 & 1 & 1 & 0 & 0 \\ 0 & 1 & -1 & -4 & 1 & 0 \\ 0 & 2 & -2 & 2 & 0 & 1 \end{array}\right] 1 4 − 2 − 2 − 7 6 1 3 − 4 1 0 0 0 1 0 0 0 1 ∼ 1 0 0 − 2 1 2 1 − 1 − 2 1 − 4 2 0 1 0 0 0 1 R 3 ← R 3 − 2 R 2 R_3 \leftarrow R_3 - 2R_2 R 3 ← R 3 − 2 R 2 :
∼ [ 1 − 2 1 1 0 0 0 1 − 1 − 4 1 0 0 0 0 10 − 2 1 ] \sim \left[\begin{array}{ccc|ccc} 1 & -2 & 1 & 1 & 0 & 0 \\ 0 & 1 & -1 & -4 & 1 & 0 \\ 0 & 0 & 0 & 10 & -2 & 1 \end{array}\right] ∼ 1 0 0 − 2 1 0 1 − 1 0 1 − 4 10 0 1 − 2 0 0 1 The left block has a row of zeros : only 2 pivots, so A A A is not row equivalent to I 3 I_3 I 3 . By Theorem 7, A A A is not invertible . Stop here; there is no need to continue.
Exercise 5
(Adapted from Lay §2.2, Exercise 35)
Let A = [ − 2 − 7 − 9 2 5 6 1 3 4 ] A = \begin{bmatrix} -2 & -7 & -9 \\ 2 & 5 & 6 \\ 1 & 3 & 4 \end{bmatrix} A = − 2 2 1 − 7 5 3 − 9 6 4 . Find the third column of A − 1 A^{-1} A − 1 without computing the other columns.
Show solution ↓ Hide solution ↑ Solution
Column 3 of A − 1 A^{-1} A − 1 is the solution of A x = e 3 A\mathbf{x} = \mathbf{e}_3 A x = e 3 , so row reduce [ A e 3 ] \left[\begin{array}{c|c} A & \mathbf{e}_3 \end{array}\right] [ A e 3 ] .
R 1 ↔ R 3 R_1 \leftrightarrow R_3 R 1 ↔ R 3 (to get a convenient pivot 1):
[ − 2 − 7 − 9 0 2 5 6 0 1 3 4 1 ] ∼ [ 1 3 4 1 2 5 6 0 − 2 − 7 − 9 0 ] \left[\begin{array}{ccc|c} -2 & -7 & -9 & 0 \\ 2 & 5 & 6 & 0 \\ 1 & 3 & 4 & 1 \end{array}\right]
\sim \left[\begin{array}{ccc|c} 1 & 3 & 4 & 1 \\ 2 & 5 & 6 & 0 \\ -2 & -7 & -9 & 0 \end{array}\right] − 2 2 1 − 7 5 3 − 9 6 4 0 0 1 ∼ 1 2 − 2 3 5 − 7 4 6 − 9 1 0 0 R 2 ← R 2 − 2 R 1 R_2 \leftarrow R_2 - 2R_1 R 2 ← R 2 − 2 R 1 and R 3 ← R 3 + 2 R 1 R_3 \leftarrow R_3 + 2R_1 R 3 ← R 3 + 2 R 1 , then R 3 ← R 3 − R 2 R_3 \leftarrow R_3 - R_2 R 3 ← R 3 − R 2 :
∼ [ 1 3 4 1 0 − 1 − 2 − 2 0 − 1 − 1 2 ] ∼ [ 1 3 4 1 0 − 1 − 2 − 2 0 0 1 4 ] \sim \left[\begin{array}{ccc|c} 1 & 3 & 4 & 1 \\ 0 & -1 & -2 & -2 \\ 0 & -1 & -1 & 2 \end{array}\right]
\sim \left[\begin{array}{ccc|c} 1 & 3 & 4 & 1 \\ 0 & -1 & -2 & -2 \\ 0 & 0 & 1 & 4 \end{array}\right] ∼ 1 0 0 3 − 1 − 1 4 − 2 − 1 1 − 2 2 ∼ 1 0 0 3 − 1 0 4 − 2 1 1 − 2 4 R 1 ← R 1 − 4 R 3 R_1 \leftarrow R_1 - 4R_3 R 1 ← R 1 − 4 R 3 and R 2 ← R 2 + 2 R 3 R_2 \leftarrow R_2 + 2R_3 R 2 ← R 2 + 2 R 3 :
∼ [ 1 3 0 − 15 0 − 1 0 6 0 0 1 4 ] \sim \left[\begin{array}{ccc|c} 1 & 3 & 0 & -15 \\ 0 & -1 & 0 & 6 \\ 0 & 0 & 1 & 4 \end{array}\right] ∼ 1 0 0 3 − 1 0 0 0 1 − 15 6 4 R 2 ← − R 2 R_2 \leftarrow -R_2 R 2 ← − R 2 , then R 1 ← R 1 − 3 R 2 R_1 \leftarrow R_1 - 3R_2 R 1 ← R 1 − 3 R 2 :
∼ [ 1 3 0 − 15 0 1 0 − 6 0 0 1 4 ] ∼ [ 1 0 0 3 0 1 0 − 6 0 0 1 4 ] \sim \left[\begin{array}{ccc|c} 1 & 3 & 0 & -15 \\ 0 & 1 & 0 & -6 \\ 0 & 0 & 1 & 4 \end{array}\right]
\sim \left[\begin{array}{ccc|c} 1 & 0 & 0 & 3 \\ 0 & 1 & 0 & -6 \\ 0 & 0 & 1 & 4 \end{array}\right] ∼ 1 0 0 3 1 0 0 0 1 − 15 − 6 4 ∼ 1 0 0 0 1 0 0 0 1 3 − 6 4 Answer: the third column of A − 1 A^{-1} A − 1 is [ 3 − 6 4 ] \begin{bmatrix} 3 \\ -6 \\ 4 \end{bmatrix} 3 − 6 4 .
Check A x = e 3 A\mathbf{x} = \mathbf{e}_3 A x = e 3 :
Row 1: − 2 ( 3 ) − 7 ( − 6 ) − 9 ( 4 ) = − 6 + 42 − 36 = 0 -2(3) - 7(-6) - 9(4) = -6 + 42 - 36 = 0 − 2 ( 3 ) − 7 ( − 6 ) − 9 ( 4 ) = − 6 + 42 − 36 = 0 ✓
Row 2: 2 ( 3 ) + 5 ( − 6 ) + 6 ( 4 ) = 6 − 30 + 24 = 0 2(3) + 5(-6) + 6(4) = 6 - 30 + 24 = 0 2 ( 3 ) + 5 ( − 6 ) + 6 ( 4 ) = 6 − 30 + 24 = 0 ✓
Row 3: 1 ( 3 ) + 3 ( − 6 ) + 4 ( 4 ) = 3 − 18 + 16 = 1 1(3) + 3(-6) + 4(4) = 3 - 18 + 16 = 1 1 ( 3 ) + 3 ( − 6 ) + 4 ( 4 ) = 3 − 18 + 16 = 1 ✓