Theory: Matrix Operations & The Inverse of a Matrix
Matrix Multiplication (Lay §2.1)
If A A A is an m × n m \times n m × n matrix and B B B is an n × p n \times p n × p matrix, the product A B AB A B is an m × p m \times p m × p matrix.
The entry in row i i i and column j j j of A B AB A B , denoted ( A B ) i j (AB)_{ij} ( A B ) ij , is given by the row-column rule:
( A B ) i j = a i 1 b 1 j + a i 2 b 2 j + ⋯ + a i n b n j (AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj} ( A B ) ij = a i 1 b 1 j + a i 2 b 2 j + ⋯ + a in b nj
[!WARNING]
Matrix multiplication is NOT commutative : In general, A B ≠ B A AB \ne BA A B = B A . Even if both products exist and have the same dimensions (when both are n × n n \times n n × n ), A B AB A B and B A BA B A are usually distinct. Cancellation laws also do not hold (A B = A C ̸ ⟹ B = C AB = AC \not\implies B = C A B = A C ⟹ B = C ).
Transpose Properties
The transpose A T A^T A T of an m × n m \times n m × n matrix A A A is the n × m n \times m n × m matrix whose columns are the rows of A A A :
( A T ) T = A (A^T)^T = A ( A T ) T = A
( A + B ) T = A T + B T (A + B)^T = A^T + B^T ( A + B ) T = A T + B T
( r A ) T = r A T (rA)^T = r A^T ( r A ) T = r A T for any scalar r r r
( A B ) T = B T A T (AB)^T = B^T A^T ( A B ) T = B T A T (Order reverses!)
The Inverse of a Matrix (Lay §2.2)
An n × n n \times n n × n square matrix A A A is said to be invertible (or nonsingular ) if there exists an n × n n \times n n × n matrix C C C such that:
C A = I n and A C = I n CA = I_n \quad \text{and} \quad AC = I_n C A = I n and A C = I n
The unique matrix C C C is called the inverse of A A A , denoted A − 1 A^{-1} A − 1 . A matrix that is not invertible is called singular .
Let A = [ a b c d ] A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} A = [ a c b d ] . If det A = a d − b c ≠ 0 \det A = ad - bc \ne 0 det A = 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 singular (not invertible).
Key Inverse Properties (Theorem 6)
( A − 1 ) − 1 = A (A^{-1})^{-1} = A ( A − 1 ) − 1 = A
( A B ) − 1 = B − 1 A − 1 (AB)^{-1} = B^{-1} A^{-1} ( A B ) − 1 = B − 1 A − 1 (The inverse of a product is the product of their inverses in reverse order)
( A T ) − 1 = ( A − 1 ) T (A^T)^{-1} = (A^{-1})^T ( A T ) − 1 = ( A − 1 ) T
The Matrix Inversion Algorithm (Theorem 7)
To find the inverse of an n × n n \times n n × n matrix A A A :
Row reduce the augmented matrix [ A I n ] \left[\begin{array}{c|c} A & I_n \end{array}\right] [ A I n ] .
If A A A is row equivalent to I n I_n I n , then:
[ A I n ] ∼ [ I n A − 1 ] \left[\begin{array}{c|c} A & I_n \end{array}\right] \sim \left[\begin{array}{c|c} I_n & A^{-1} \end{array}\right] [ A I n ] ∼ [ I n A − 1 ]
Otherwise, A A A does not have an inverse.
Solved Examples (Textbook Questions)
Exercise 1
(Adapted from Lay §2.1, Exercise 10 & §2.2, Exercise 5)
Let A = [ 2 − 5 3 − 2 ] A = \begin{bmatrix} 2 & -5 \\ 3 & -2 \end{bmatrix} A = [ 2 3 − 5 − 2 ] and B = [ 3 4 0 − 1 ] B = \begin{bmatrix} 3 & 4 \\ 0 & -1 \end{bmatrix} B = [ 3 0 4 − 1 ] . Compute A B AB A B and B A BA B A . Does A B = B A AB = BA A B = B A ?
Compute ( A B ) T (AB)^T ( A B ) T and verify that ( A B ) T = B T A T (AB)^T = B^T A^T ( A B ) T = B T A T .
Compute A − 1 A^{-1} A − 1 using the 2 × 2 2 \times 2 2 × 2 formula.
Show solution ↓ Hide solution ↑ Solution
Part 1: Matrix Products
A B = [ 2 − 5 3 − 2 ] [ 3 4 0 − 1 ] = [ 2 ( 3 ) + ( − 5 ) ( 0 ) 2 ( 4 ) + ( − 5 ) ( − 1 ) 3 ( 3 ) + ( − 2 ) ( 0 ) 3 ( 4 ) + ( − 2 ) ( − 1 ) ] = [ 6 13 9 14 ] AB = \begin{bmatrix} 2 & -5 \\ 3 & -2 \end{bmatrix} \begin{bmatrix} 3 & 4 \\ 0 & -1 \end{bmatrix} = \begin{bmatrix} 2(3) + (-5)(0) & 2(4) + (-5)(-1) \\ 3(3) + (-2)(0) & 3(4) + (-2)(-1) \end{bmatrix} = \begin{bmatrix} 6 & 13 \\ 9 & 14 \end{bmatrix} A B = [ 2 3 − 5 − 2 ] [ 3 0 4 − 1 ] = [ 2 ( 3 ) + ( − 5 ) ( 0 ) 3 ( 3 ) + ( − 2 ) ( 0 ) 2 ( 4 ) + ( − 5 ) ( − 1 ) 3 ( 4 ) + ( − 2 ) ( − 1 ) ] = [ 6 9 13 14 ] B A = [ 3 4 0 − 1 ] [ 2 − 5 3 − 2 ] = [ 3 ( 2 ) + 4 ( 3 ) 3 ( − 5 ) + 4 ( − 2 ) 0 ( 2 ) + ( − 1 ) ( 3 ) 0 ( − 5 ) + ( − 1 ) ( − 2 ) ] = [ 18 − 23 − 3 2 ] BA = \begin{bmatrix} 3 & 4 \\ 0 & -1 \end{bmatrix} \begin{bmatrix} 2 & -5 \\ 3 & -2 \end{bmatrix} = \begin{bmatrix} 3(2) + 4(3) & 3(-5) + 4(-2) \\ 0(2) + (-1)(3) & 0(-5) + (-1)(-2) \end{bmatrix} = \begin{bmatrix} 18 & -23 \\ -3 & 2 \end{bmatrix} B A = [ 3 0 4 − 1 ] [ 2 3 − 5 − 2 ] = [ 3 ( 2 ) + 4 ( 3 ) 0 ( 2 ) + ( − 1 ) ( 3 ) 3 ( − 5 ) + 4 ( − 2 ) 0 ( − 5 ) + ( − 1 ) ( − 2 ) ] = [ 18 − 3 − 23 2 ] Clearly, A B ≠ B A AB \ne BA A B = B A .
Part 2: Transpose of Product
Taking the transpose of A B AB A B :
( A B ) T = [ 6 9 13 14 ] (AB)^T = \begin{bmatrix} 6 & 9 \\ 13 & 14 \end{bmatrix} ( A B ) T = [ 6 13 9 14 ] Now compute B T A T B^T A^T B T A T :
B T = [ 3 0 4 − 1 ] , A T = [ 2 3 − 5 − 2 ] B^T = \begin{bmatrix} 3 & 0 \\ 4 & -1 \end{bmatrix}, \quad A^T = \begin{bmatrix} 2 & 3 \\ -5 & -2 \end{bmatrix} B T = [ 3 4 0 − 1 ] , A T = [ 2 − 5 3 − 2 ] B T A T = [ 3 ( 2 ) + 0 ( − 5 ) 3 ( 3 ) + 0 ( − 2 ) 4 ( 2 ) + ( − 1 ) ( − 5 ) 4 ( 3 ) + ( − 1 ) ( − 2 ) ] = [ 6 9 13 14 ] = ( A B ) T ✓ B^T A^T = \begin{bmatrix} 3(2) + 0(-5) & 3(3) + 0(-2) \\ 4(2) + (-1)(-5) & 4(3) + (-1)(-2) \end{bmatrix} = \begin{bmatrix} 6 & 9 \\ 13 & 14 \end{bmatrix} = (AB)^T \quad \checkmark B T A T = [ 3 ( 2 ) + 0 ( − 5 ) 4 ( 2 ) + ( − 1 ) ( − 5 ) 3 ( 3 ) + 0 ( − 2 ) 4 ( 3 ) + ( − 1 ) ( − 2 ) ] = [ 6 13 9 14 ] = ( A B ) T ✓ Part 3: 2 × 2 2 \times 2 2 × 2 Inverse
For A = [ 2 − 5 3 − 2 ] A = \begin{bmatrix} 2 & -5 \\ 3 & -2 \end{bmatrix} A = [ 2 3 − 5 − 2 ] , det A = ( 2 ) ( − 2 ) − ( − 5 ) ( 3 ) = − 4 + 15 = 11 ≠ 0 \det A = (2)(-2) - (-5)(3) = -4 + 15 = 11 \ne 0 det A = ( 2 ) ( − 2 ) − ( − 5 ) ( 3 ) = − 4 + 15 = 11 = 0 .
A − 1 = 1 11 [ − 2 5 − 3 2 ] = [ − 2 / 11 5 / 11 − 3 / 11 2 / 11 ] A^{-1} = \frac{1}{11} \begin{bmatrix} -2 & 5 \\ -3 & 2 \end{bmatrix} = \begin{bmatrix} -2/11 & 5/11 \\ -3/11 & 2/11 \end{bmatrix} A − 1 = 11 1 [ − 2 − 3 5 2 ] = [ − 2/11 − 3/11 5/11 2/11 ]
Exercise 2
(Adapted from Lay §2.2, Exercise 7 & 13)
Use matrix algebra to isolate and solve for X X X in the equation:
A ( X + B ) = C A(X + B) = C A ( X + B ) = C where A , B , C , X A, B, C, X A , B , C , X are all n × n n \times n n × n matrices and A A A is invertible. State each algebraic property used.
Then, solve for X X X in ( A − A X ) − 1 = X − 1 B (A - AX)^{-1} = X^{-1} B ( A − A X ) − 1 = X − 1 B , assuming all indicated inverses exist.
Show solution ↓ Hide solution ↑ Solution
Part 1: Solving A ( X + B ) = C A(X + B) = C A ( X + B ) = C
Multiply both sides from the left by A − 1 A^{-1} A − 1 :
A − 1 [ A ( X + B ) ] = A − 1 C A^{-1}[A(X + B)] = A^{-1}C A − 1 [ A ( X + B )] = A − 1 C
Use the associative law of matrix multiplication:
( A − 1 A ) ( X + B ) = A − 1 C (A^{-1}A)(X + B) = A^{-1}C ( A − 1 A ) ( X + B ) = A − 1 C
Since A − 1 A = I n A^{-1}A = I_n A − 1 A = I n and I n M = M I_n M = M I n M = M :
X + B = A − 1 C X + B = A^{-1}C X + B = A − 1 C
Subtract B B B from both sides:
X = A − 1 C − B X = A^{-1}C - B X = A − 1 C − B
(Note: Writing C A − 1 C A^{-1} C A − 1 would be incorrect because matrix multiplication is not commutative).
Part 2: Solving ( A − A X ) − 1 = X − 1 B (A - AX)^{-1} = X^{-1}B ( A − A X ) − 1 = X − 1 B
Take the inverse of both sides:
A − A X = ( X − 1 B ) − 1 A - AX = (X^{-1}B)^{-1} A − A X = ( X − 1 B ) − 1
Apply the socks-shoes rule ( M N ) − 1 = N − 1 M − 1 (MN)^{-1} = N^{-1}M^{-1} ( M N ) − 1 = N − 1 M − 1 :
( X − 1 B ) − 1 = B − 1 ( X − 1 ) − 1 = B − 1 X (X^{-1}B)^{-1} = B^{-1}(X^{-1})^{-1} = B^{-1}X ( X − 1 B ) − 1 = B − 1 ( X − 1 ) − 1 = B − 1 X
So:
A − A X = B − 1 X A - AX = B^{-1}X A − A X = B − 1 X
Move terms involving X X X to one side:
A = B − 1 X + A X = ( B − 1 + A ) X A = B^{-1}X + AX = (B^{-1} + A)X A = B − 1 X + A X = ( B − 1 + A ) X
Assuming ( B − 1 + A ) (B^{-1} + A) ( B − 1 + A ) is invertible, multiply both sides from the left by ( B − 1 + A ) − 1 (B^{-1} + A)^{-1} ( B − 1 + A ) − 1 :
X = ( B − 1 + A ) − 1 A X = (B^{-1} + A)^{-1} A X = ( B − 1 + A ) − 1 A
Exercise 3
(Adapted from Lay §2.2, Exercise 31 & Example 7)
Find the inverse of the matrix A A A using row operations on [ A ∣ I ] [A \mid I] [ A ∣ I ] , where:
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 Then, use A − 1 A^{-1} A − 1 to solve the linear system A x = b A\mathbf{x} = \mathbf{b} A x = b , where b = [ − 1 7 0 ] \mathbf{b} = \begin{bmatrix} -1 \\ 7 \\ 0 \end{bmatrix} b = − 1 7 0 .
Show solution ↓ Hide solution ↑ Solution
Step 1: Set up the augmented matrix [ A ∣ I 3 ] [A \mid I_3] [ A ∣ I 3 ] .
[ 1 0 − 2 1 0 0 − 3 1 4 0 1 0 2 − 3 4 0 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] 1 − 3 2 0 1 − 3 − 2 4 4 1 0 0 0 1 0 0 0 1 Step 2: Forward elimination.
R 2 ← R 2 + 3 R 1 R_2 \leftarrow R_2 + 3R_1 R 2 ← R 2 + 3 R 1 :
[ − 3 , 1 , 4 , 0 , 1 , 0 ] + 3 [ 1 , 0 , − 2 , 1 , 0 , 0 ] = [ 0 , 1 , − 2 , 3 , 1 , 0 ] [-3, 1, 4, 0, 1, 0] + 3[1, 0, -2, 1, 0, 0] = [0, 1, -2, 3, 1, 0] [ − 3 , 1 , 4 , 0 , 1 , 0 ] + 3 [ 1 , 0 , − 2 , 1 , 0 , 0 ] = [ 0 , 1 , − 2 , 3 , 1 , 0 ]
R 3 ← R 3 − 2 R 1 R_3 \leftarrow R_3 - 2R_1 R 3 ← R 3 − 2 R 1 :
[ 2 , − 3 , 4 , 0 , 0 , 1 ] − 2 [ 1 , 0 , − 2 , 1 , 0 , 0 ] = [ 0 , − 3 , 8 , − 2 , 0 , 1 ] [2, -3, 4, 0, 0, 1] - 2[1, 0, -2, 1, 0, 0] = [0, -3, 8, -2, 0, 1] [ 2 , − 3 , 4 , 0 , 0 , 1 ] − 2 [ 1 , 0 , − 2 , 1 , 0 , 0 ] = [ 0 , − 3 , 8 , − 2 , 0 , 1 ]
Matrix:
[ 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 \\
0 & 1 & -2 & 3 & 1 & 0 \\
0 & -3 & 8 & -2 & 0 & 1
\end{array}\right] 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 :
[ 0 , − 3 , 8 , − 2 , 0 , 1 ] + 3 [ 0 , 1 , − 2 , 3 , 1 , 0 ] = [ 0 , 0 , 2 , 7 , 3 , 1 ] [0, -3, 8, -2, 0, 1] + 3[0, 1, -2, 3, 1, 0] = [0, 0, 2, 7, 3, 1] [ 0 , − 3 , 8 , − 2 , 0 , 1 ] + 3 [ 0 , 1 , − 2 , 3 , 1 , 0 ] = [ 0 , 0 , 2 , 7 , 3 , 1 ]
Scale R 3 ← 1 2 R 3 R_3 \leftarrow \frac{1}{2}R_3 R 3 ← 2 1 R 3 :
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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 1 8 10 7/2 3 4 3/2 1 1 1/2 Therefore:
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 Step 4: Solve A x = b A\mathbf{x} = \mathbf{b} A x = b using x = A − 1 b \mathbf{x} = A^{-1}\mathbf{b} x = A − 1 b .
x = [ 8 3 1 10 4 1 7 / 2 3 / 2 1 / 2 ] [ − 1 7 0 ] = [ 8 ( − 1 ) + 3 ( 7 ) + 1 ( 0 ) 10 ( − 1 ) + 4 ( 7 ) + 1 ( 0 ) 7 2 ( − 1 ) + 3 2 ( 7 ) + 1 2 ( 0 ) ] = [ 13 18 7 ] \mathbf{x} = \begin{bmatrix}
8 & 3 & 1 \\
10 & 4 & 1 \\
7/2 & 3/2 & 1/2
\end{bmatrix}
\begin{bmatrix} -1 \\ 7 \\ 0 \end{bmatrix}
= \begin{bmatrix}
8(-1) + 3(7) + 1(0) \\
10(-1) + 4(7) + 1(0) \\
\frac{7}{2}(-1) + \frac{3}{2}(7) + \frac{1}{2}(0)
\end{bmatrix}
= \begin{bmatrix}
13 \\
18 \\
7
\end{bmatrix} x = 8 10 7/2 3 4 3/2 1 1 1/2 − 1 7 0 = 8 ( − 1 ) + 3 ( 7 ) + 1 ( 0 ) 10 ( − 1 ) + 4 ( 7 ) + 1 ( 0 ) 2 7 ( − 1 ) + 2 3 ( 7 ) + 2 1 ( 0 ) = 13 18 7