About

2.1-2.2 Matrix Operations & Inverses

Theory: Matrix Operations & The Inverse of a Matrix

Matrix Multiplication (Lay §2.1)

If AA is an m×nm \times n matrix and BB is an n×pn \times p matrix, the product ABAB is an m×pm \times p matrix. The entry in row ii and column jj of ABAB, denoted (AB)ij(AB)_{ij}, is given by the row-column rule:

(AB)ij=ai1b1j+ai2b2j+⋯+ainbnj(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}

[!WARNING] Matrix multiplication is NOT commutative: In general, AB≠BAAB \ne BA. Even if both products exist and have the same dimensions (when both are n×nn \times n), ABAB and BABA are usually distinct. Cancellation laws also do not hold (AB=AC̸  ⟹  B=CAB = AC \not\implies B = C).

Transpose Properties

The transpose ATA^T of an m×nm \times n matrix AA is the n×mn \times m matrix whose columns are the rows of AA:

  1. (AT)T=A(A^T)^T = A
  2. (A+B)T=AT+BT(A + B)^T = A^T + B^T
  3. (rA)T=rAT(rA)^T = r A^T for any scalar rr
  4. (AB)T=BTAT(AB)^T = B^T A^T (Order reverses!)

The Inverse of a Matrix (Lay §2.2)

An n×nn \times n square matrix AA is said to be invertible (or nonsingular) if there exists an n×nn \times n matrix CC such that:

CA=InandAC=InCA = I_n \quad \text{and} \quad AC = I_n

The unique matrix CC is called the inverse of AA, denoted A−1A^{-1}. A matrix that is not invertible is called singular.

The 2×22 \times 2 Matrix Inverse Formula (Theorem 4)

Let A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}. If det⁡A=ad−bc≠0\det A = ad - bc \ne 0, then AA is invertible and:

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 singular (not invertible).

Key Inverse Properties (Theorem 6)

  1. (A−1)−1=A(A^{-1})^{-1} = A
  2. (AB)−1=B−1A−1(AB)^{-1} = B^{-1} A^{-1} (The inverse of a product is the product of their inverses in reverse order)
  3. (AT)−1=(A−1)T(A^T)^{-1} = (A^{-1})^T

The Matrix Inversion Algorithm (Theorem 7)

To find the inverse of an n×nn \times n matrix AA:

  1. Row reduce the augmented matrix [AIn]\left[\begin{array}{c|c} A & I_n \end{array}\right].
  2. If AA is row equivalent to InI_n, then: [AIn]∼[InA−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]
  3. Otherwise, AA does not have an inverse.

Solved Examples (Textbook Questions)

Exercise 1

(Adapted from Lay §2.1, Exercise 10 & §2.2, Exercise 5)

  1. Let A=[2−53−2]A = \begin{bmatrix} 2 & -5 \\ 3 & -2 \end{bmatrix} and B=[340−1]B = \begin{bmatrix} 3 & 4 \\ 0 & -1 \end{bmatrix}. Compute ABAB and BABA. Does AB=BAAB = BA?
  2. Compute (AB)T(AB)^T and verify that (AB)T=BTAT(AB)^T = B^T A^T.
  3. Compute A−1A^{-1} using the 2×22 \times 2 formula.
Show solution ↓
Solution

Part 1: Matrix Products

AB=[2−53−2][340−1]=[2(3)+(−5)(0)2(4)+(−5)(−1)3(3)+(−2)(0)3(4)+(−2)(−1)]=[613914]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}BA=[340−1][2−53−2]=[3(2)+4(3)3(−5)+4(−2)0(2)+(−1)(3)0(−5)+(−1)(−2)]=[18−23−32]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}

Clearly, AB≠BAAB \ne BA.

Part 2: Transpose of Product Taking the transpose of ABAB:

(AB)T=[691314](AB)^T = \begin{bmatrix} 6 & 9 \\ 13 & 14 \end{bmatrix}

Now compute BTATB^T A^T:

BT=[304−1],AT=[23−5−2]B^T = \begin{bmatrix} 3 & 0 \\ 4 & -1 \end{bmatrix}, \quad A^T = \begin{bmatrix} 2 & 3 \\ -5 & -2 \end{bmatrix}BTAT=[3(2)+0(−5)3(3)+0(−2)4(2)+(−1)(−5)4(3)+(−1)(−2)]=[691314]=(AB)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

Part 3: 2×22 \times 2 Inverse For A=[2−53−2]A = \begin{bmatrix} 2 & -5 \\ 3 & -2 \end{bmatrix}, det⁡A=(2)(−2)−(−5)(3)=−4+15=11≠0\det A = (2)(-2) - (-5)(3) = -4 + 15 = 11 \ne 0.

A−1=111[−25−32]=[−2/115/11−3/112/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}
Exercise 2

(Adapted from Lay §2.2, Exercise 7 & 13)

Use matrix algebra to isolate and solve for XX in the equation:

A(X+B)=CA(X + B) = C

where A,B,C,XA, B, C, X are all n×nn \times n matrices and AA is invertible. State each algebraic property used.

Then, solve for XX in (A−AX)−1=X−1B(A - AX)^{-1} = X^{-1} B, assuming all indicated inverses exist.

Show solution ↓
Solution

Part 1: Solving A(X+B)=CA(X + B) = C

  1. Multiply both sides from the left by A−1A^{-1}: A−1[A(X+B)]=A−1CA^{-1}[A(X + B)] = A^{-1}C
  2. Use the associative law of matrix multiplication: (A−1A)(X+B)=A−1C(A^{-1}A)(X + B) = A^{-1}C
  3. Since A−1A=InA^{-1}A = I_n and InM=MI_n M = M: X+B=A−1CX + B = A^{-1}C
  4. Subtract BB from both sides: X=A−1C−BX = A^{-1}C - B

(Note: Writing CA−1C A^{-1} would be incorrect because matrix multiplication is not commutative).


Part 2: Solving (A−AX)−1=X−1B(A - AX)^{-1} = X^{-1}B

  1. Take the inverse of both sides: A−AX=(X−1B)−1A - AX = (X^{-1}B)^{-1}
  2. Apply the socks-shoes rule (MN)−1=N−1M−1(MN)^{-1} = N^{-1}M^{-1}: (X−1B)−1=B−1(X−1)−1=B−1X(X^{-1}B)^{-1} = B^{-1}(X^{-1})^{-1} = B^{-1}X So: A−AX=B−1XA - AX = B^{-1}X
  3. Move terms involving XX to one side: A=B−1X+AX=(B−1+A)XA = B^{-1}X + AX = (B^{-1} + A)X
  4. Assuming (B−1+A)(B^{-1} + A) is invertible, multiply both sides from the left by (B−1+A)−1(B^{-1} + A)^{-1}: X=(B−1+A)−1AX = (B^{-1} + A)^{-1} A
Exercise 3

(Adapted from Lay §2.2, Exercise 31 & Example 7)

Find the inverse of the matrix AA using row operations on [A∣I][A \mid I], where:

A=[10−2−3142−34]A = \begin{bmatrix} 1 & 0 & -2 \\ -3 & 1 & 4 \\ 2 & -3 & 4 \end{bmatrix}

Then, use A−1A^{-1} to solve the linear system Ax=bA\mathbf{x} = \mathbf{b}, where b=[−170]\mathbf{b} = \begin{bmatrix} -1 \\ 7 \\ 0 \end{bmatrix}.

Show solution ↓
Solution

Step 1: Set up the augmented matrix [A∣I3][A \mid I_3].

[10−2100−3140102−34001]\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]

Step 2: Forward elimination.

  • R2←R2+3R1R_2 \leftarrow R_2 + 3R_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]
  • R3←R3−2R1R_3 \leftarrow R_3 - 2R_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:

[10−210001−23100−38−201]\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]
  • R3←R3+3R2R_3 \leftarrow R_3 + 3R_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]
  • Scale R3←12R3R_3 \leftarrow \frac{1}{2}R_3: [0,0,1,7/2,3/2,1/2][0, 0, 1, 7/2, 3/2, 1/2]

Matrix:

[10−210001−23100017/23/21/2]\left[\begin{array}{ccc|ccc} 1 & 0 & -2 & 1 & 0 & 0 \\ 0 & 1 & -2 & 3 & 1 & 0 \\ 0 & 0 & 1 & 7/2 & 3/2 & 1/2 \end{array}\right]

Step 3: Backward elimination.

  • R2←R2+2R3R_2 \leftarrow R_2 + 2R_3: [0,1,−2,3,1,0]+2[0,0,1,7/2,3/2,1/2]=[0,1,0,10,4,1][0, 1, -2, 3, 1, 0] + 2[0, 0, 1, 7/2, 3/2, 1/2] = [0, 1, 0, 10, 4, 1]
  • R1←R1+2R3R_1 \leftarrow R_1 + 2R_3: [1,0,−2,1,0,0]+2[0,0,1,7/2,3/2,1/2]=[1,0,0,8,3,1][1, 0, -2, 1, 0, 0] + 2[0, 0, 1, 7/2, 3/2, 1/2] = [1, 0, 0, 8, 3, 1]

The reduced matrix is:

[10083101010410017/23/21/2]\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]

Therefore:

A−1=[83110417/23/21/2]A^{-1} = \begin{bmatrix} 8 & 3 & 1 \\ 10 & 4 & 1 \\ 7/2 & 3/2 & 1/2 \end{bmatrix}

Step 4: Solve Ax=bA\mathbf{x} = \mathbf{b} using x=A−1b\mathbf{x} = A^{-1}\mathbf{b}.

x=[83110417/23/21/2][−170]=[8(−1)+3(7)+1(0)10(−1)+4(7)+1(0)72(−1)+32(7)+12(0)]=[13187]\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}