Theory: Partitioned Matrices & LU Factorization
Partitioned (Block) Matrices (Lay §2.4)
A matrix can be partitioned into submatrices (called blocks ) by horizontal and vertical lines:
A = [ A 11 A 12 A 21 A 22 ] A = \begin{bmatrix}
A_{11} & A_{12} \\
A_{21} & A_{22}
\end{bmatrix} A = [ A 11 A 21 A 12 A 22 ]
If the block sizes are conformable for matrix multiplication, partitioned matrices can be multiplied block by block as if their entries were scalars:
[ A 11 A 12 A 21 A 22 ] [ B 11 B 12 B 21 B 22 ] = [ A 11 B 11 + A 12 B 21 A 11 B 12 + A 12 B 22 A 21 B 11 + A 22 B 21 A 21 B 12 + A 22 B 22 ] \begin{bmatrix}
A_{11} & A_{12} \\
A_{21} & A_{22}
\end{bmatrix}
\begin{bmatrix}
B_{11} & B_{12} \\
B_{21} & B_{22}
\end{bmatrix}
=
\begin{bmatrix}
A_{11}B_{11} + A_{12}B_{21} & A_{11}B_{12} + A_{12}B_{22} \\
A_{21}B_{11} + A_{22}B_{21} & A_{21}B_{12} + A_{22}B_{22}
\end{bmatrix} [ A 11 A 21 A 12 A 22 ] [ B 11 B 21 B 12 B 22 ] = [ A 11 B 11 + A 12 B 21 A 21 B 11 + A 22 B 21 A 11 B 12 + A 12 B 22 A 21 B 12 + A 22 B 22 ]
Block Diagonal Inverses
If A A A is a block diagonal matrix where each diagonal block A i i A_{ii} A ii is square and invertible:
A = [ A 1 0 0 A 2 ] ⟹ A − 1 = [ A 1 − 1 0 0 A 2 − 1 ] A = \begin{bmatrix} A_1 & 0 \\ 0 & A_2 \end{bmatrix} \implies A^{-1} = \begin{bmatrix} A_1^{-1} & 0 \\ 0 & A_2^{-1} \end{bmatrix} A = [ A 1 0 0 A 2 ] ⟹ A − 1 = [ A 1 − 1 0 0 A 2 − 1 ]
LU Factorization (Lay §2.5)
An LU factorization expresses an m × n m \times n m × n matrix A A A as the product:
A = L U A = LU A = LU
where:
L L L is an m × m m \times m m × m unit lower-triangular matrix (has 1 1 1 s on the main diagonal and 0 0 0 s above the main diagonal).
U U U is an m × n m \times n m × n upper-triangular / row echelon matrix .
[ 1 0 0 ] [ * * * ]
L = [ * 1 0 ] [ 0 * * ] = U
[ * * 1 ] [ 0 0 * ]
[!NOTE]
Why LU Factorization?
When solving a series of equations A x = b A\mathbf{x} = \mathbf{b} A x = b with different b \mathbf{b} b vectors, solving two triangular systems takes only on the order of n 2 n^2 n 2 operations, compared to 2 3 n 3 \frac{2}{3}n^3 3 2 n 3 for full row reduction of A A A each time.
The Algorithm for A = L U A = LU A = LU
(When A A A can be row-reduced to echelon form without row interchanges) :
Reduce A A A to an echelon form U U U using only row replacement operations (adding multiples of a row to a row below it).
The entries in L L L below its main diagonal record the multipliers used to clear entries: if operation R i ← R i − c R j R_i \leftarrow R_i - c R_j R i ← R i − c R j was used, the entry in row i i i , column j j j of L L L is c c c .
Solving A x = b A\mathbf{x} = \mathbf{b} A x = b Using L U LU LU
Since A x = L ( U x ) = b A\mathbf{x} = L(U\mathbf{x}) = \mathbf{b} A x = L ( U x ) = b , set y = U x \mathbf{y} = U\mathbf{x} y = U x :
Forward Substitution : Solve L y = b L\mathbf{y} = \mathbf{b} L y = b for y \mathbf{y} y .
Back Substitution : Solve U x = y U\mathbf{x} = \mathbf{y} U x = y for x \mathbf{x} x .
Solved Examples (Textbook Questions)
Exercise 1
(Adapted from Lay §2.4, Exercise 11)
Let A = [ A 11 A 12 0 A 22 ] A = \begin{bmatrix} A_{11} & A_{12} \\ 0 & A_{22} \end{bmatrix} A = [ A 11 0 A 12 A 22 ] be a block upper-triangular matrix, where A 11 A_{11} A 11 is p × p p \times p p × p , A 22 A_{22} A 22 is q × q q \times q q × q , and both A 11 A_{11} A 11 and A 22 A_{22} A 22 are invertible.
Find a formula for A − 1 A^{-1} A − 1 in block form.
Show solution ↓ Hide solution ↑ Solution
We search for a block matrix B = [ B 11 B 12 B 21 B 22 ] B = \begin{bmatrix} B_{11} & B_{12} \\ B_{21} & B_{22} \end{bmatrix} B = [ B 11 B 21 B 12 B 22 ] such that:
A B = [ A 11 A 12 0 A 22 ] [ B 11 B 12 B 21 B 22 ] = [ I p 0 0 I q ] A B = \begin{bmatrix} A_{11} & A_{12} \\ 0 & A_{22} \end{bmatrix} \begin{bmatrix} B_{11} & B_{12} \\ B_{21} & B_{22} \end{bmatrix} = \begin{bmatrix} I_p & 0 \\ 0 & I_q \end{bmatrix} A B = [ A 11 0 A 12 A 22 ] [ B 11 B 21 B 12 B 22 ] = [ I p 0 0 I q ] Multiply the blocks:
A 11 B 11 + A 12 B 21 = I p A_{11} B_{11} + A_{12} B_{21} = I_p A 11 B 11 + A 12 B 21 = I p
A 11 B 12 + A 12 B 22 = 0 A_{11} B_{12} + A_{12} B_{22} = 0 A 11 B 12 + A 12 B 22 = 0
0 ⋅ B 11 + A 22 B 21 = 0 ⟹ A 22 B 21 = 0 0 \cdot B_{11} + A_{22} B_{21} = 0 \implies A_{22} B_{21} = 0 0 ⋅ B 11 + A 22 B 21 = 0 ⟹ A 22 B 21 = 0
0 ⋅ B 12 + A 22 B 22 = I q ⟹ A 22 B 22 = I q 0 \cdot B_{12} + A_{22} B_{22} = I_q \implies A_{22} B_{22} = I_q 0 ⋅ B 12 + A 22 B 22 = I q ⟹ A 22 B 22 = I q
Solve for the blocks:
From (4): Since A 22 A_{22} A 22 is invertible, B 22 = A 22 − 1 B_{22} = A_{22}^{-1} B 22 = A 22 − 1 .
From (3): Multiply from the left by A 22 − 1 A_{22}^{-1} A 22 − 1 :
B 21 = A 22 − 1 ( 0 ) = 0 B_{21} = A_{22}^{-1}(0) = 0 B 21 = A 22 − 1 ( 0 ) = 0
From (1): Since B 21 = 0 B_{21} = 0 B 21 = 0 :
A 11 B 11 = I p ⟹ B 11 = A 11 − 1 A_{11} B_{11} = I_p \implies B_{11} = A_{11}^{-1} A 11 B 11 = I p ⟹ B 11 = A 11 − 1
From (2):
A 11 B 12 + A 12 A 22 − 1 = 0 ⟹ A 11 B 12 = − A 12 A 22 − 1 A_{11} B_{12} + A_{12} A_{22}^{-1} = 0 \implies A_{11} B_{12} = -A_{12} A_{22}^{-1} A 11 B 12 + A 12 A 22 − 1 = 0 ⟹ A 11 B 12 = − A 12 A 22 − 1
Multiply from the left by A 11 − 1 A_{11}^{-1} A 11 − 1 :
B 12 = − A 11 − 1 A 12 A 22 − 1 B_{12} = -A_{11}^{-1} A_{12} A_{22}^{-1} B 12 = − A 11 − 1 A 12 A 22 − 1
Conclusion:
A − 1 = [ A 11 − 1 − A 11 − 1 A 12 A 22 − 1 0 A 22 − 1 ] A^{-1} = \begin{bmatrix}
A_{11}^{-1} & -A_{11}^{-1} A_{12} A_{22}^{-1} \\
0 & A_{22}^{-1}
\end{bmatrix} A − 1 = [ A 11 − 1 0 − A 11 − 1 A 12 A 22 − 1 A 22 − 1 ]
Exercise 2
(Adapted from Lay §2.5, Exercise 7)
Find an LU factorization of the matrix:
A = [ 2 4 − 6 1 5 3 1 3 − 7 ] A = \begin{bmatrix}
2 & 4 & -6 \\
1 & 5 & 3 \\
1 & 3 & -7
\end{bmatrix} A = 2 1 1 4 5 3 − 6 3 − 7 Explicitly state the row operations, the multipliers, and the matrices L L L and U U U .
Show solution ↓ Hide solution ↑ Solution
We reduce A A A to an upper-triangular echelon form U U U using only row replacements:
Step 1: Clear column 1 below the pivot a 11 = 2 a_{11} = 2 a 11 = 2 .
Row 2: R 2 ← R 2 − ( 1 2 ) R 1 R_2 \leftarrow R_2 - \left(\frac{1}{2}\right) R_1 R 2 ← R 2 − ( 2 1 ) R 1
[ 1 , 5 , 3 ] − 1 2 [ 2 , 4 , − 6 ] = [ 0 , 3 , 6 ] [1, 5, 3] - \frac{1}{2}[2, 4, -6] = [0, 3, 6] [ 1 , 5 , 3 ] − 2 1 [ 2 , 4 , − 6 ] = [ 0 , 3 , 6 ]
Multiplier for position ( 2 , 1 ) (2, 1) ( 2 , 1 ) : ℓ 21 = 1 2 \ell_{21} = \frac{1}{2} ℓ 21 = 2 1 .
Row 3: R 3 ← R 3 − ( 1 2 ) R 1 R_3 \leftarrow R_3 - \left(\frac{1}{2}\right) R_1 R 3 ← R 3 − ( 2 1 ) R 1
[ 1 , 3 , − 7 ] − 1 2 [ 2 , 4 , − 6 ] = [ 0 , 1 , − 4 ] [1, 3, -7] - \frac{1}{2}[2, 4, -6] = [0, 1, -4] [ 1 , 3 , − 7 ] − 2 1 [ 2 , 4 , − 6 ] = [ 0 , 1 , − 4 ]
Multiplier for position ( 3 , 1 ) (3, 1) ( 3 , 1 ) : ℓ 31 = 1 2 \ell_{31} = \frac{1}{2} ℓ 31 = 2 1 .
The intermediate matrix is:
[ 2 4 − 6 0 3 6 0 1 − 4 ] \begin{bmatrix}
2 & 4 & -6 \\
0 & 3 & 6 \\
0 & 1 & -4
\end{bmatrix} 2 0 0 4 3 1 − 6 6 − 4 Step 2: Clear column 2 below the pivot in row 2 (which is 3 3 3 ).
Row 3: R 3 ← R 3 − ( 1 3 ) R 2 R_3 \leftarrow R_3 - \left(\frac{1}{3}\right) R_2 R 3 ← R 3 − ( 3 1 ) R 2
[ 0 , 1 , − 4 ] − 1 3 [ 0 , 3 , 6 ] = [ 0 , 0 , − 6 ] [0, 1, -4] - \frac{1}{3}[0, 3, 6] = [0, 0, -6] [ 0 , 1 , − 4 ] − 3 1 [ 0 , 3 , 6 ] = [ 0 , 0 , − 6 ]
Multiplier for position ( 3 , 2 ) (3, 2) ( 3 , 2 ) : ℓ 32 = 1 3 \ell_{32} = \frac{1}{3} ℓ 32 = 3 1 .
This gives the upper-triangular matrix U U U :
U = [ 2 4 − 6 0 3 6 0 0 − 6 ] U = \begin{bmatrix}
2 & 4 & -6 \\
0 & 3 & 6 \\
0 & 0 & -6
\end{bmatrix} U = 2 0 0 4 3 0 − 6 6 − 6 Step 3: Construct L L L .
Place 1 1 1 s on the diagonal and the recorded multipliers below:
L = [ 1 0 0 1 / 2 1 0 1 / 2 1 / 3 1 ] L = \begin{bmatrix}
1 & 0 & 0 \\
1/2 & 1 & 0 \\
1/2 & 1/3 & 1
\end{bmatrix} L = 1 1/2 1/2 0 1 1/3 0 0 1 Verification:
L U = [ 1 0 0 1 / 2 1 0 1 / 2 1 / 3 1 ] [ 2 4 − 6 0 3 6 0 0 − 6 ] = [ 2 4 − 6 1 + 0 2 + 3 − 3 + 6 1 + 0 + 0 2 + 1 + 0 − 3 + 2 − 6 ] = [ 2 4 − 6 1 5 3 1 3 − 7 ] = A ✓ LU = \begin{bmatrix}
1 & 0 & 0 \\
1/2 & 1 & 0 \\
1/2 & 1/3 & 1
\end{bmatrix}
\begin{bmatrix}
2 & 4 & -6 \\
0 & 3 & 6 \\
0 & 0 & -6
\end{bmatrix}
=
\begin{bmatrix}
2 & 4 & -6 \\
1 + 0 & 2 + 3 & -3 + 6 \\
1 + 0 + 0 & 2 + 1 + 0 & -3 + 2 - 6
\end{bmatrix}
=
\begin{bmatrix}
2 & 4 & -6 \\
1 & 5 & 3 \\
1 & 3 & -7
\end{bmatrix} = A \quad \checkmark LU = 1 1/2 1/2 0 1 1/3 0 0 1 2 0 0 4 3 0 − 6 6 − 6 = 2 1 + 0 1 + 0 + 0 4 2 + 3 2 + 1 + 0 − 6 − 3 + 6 − 3 + 2 − 6 = 2 1 1 4 5 3 − 6 3 − 7 = A ✓
Exercise 3
(Adapted from Lay §2.5, Exercise 1 & 3)
Solve the system A x = b A\mathbf{x} = \mathbf{b} A x = b using the given LU factorization:
L = [ 1 0 0 − 1 1 0 2 − 5 1 ] , U = [ 2 − 3 1 0 4 2 0 0 3 ] , b = [ 1 0 11 ] L = \begin{bmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
2 & -5 & 1
\end{bmatrix}, \quad
U = \begin{bmatrix}
2 & -3 & 1 \\
0 & 4 & 2 \\
0 & 0 & 3
\end{bmatrix}, \quad
\mathbf{b} = \begin{bmatrix} 1 \\ 0 \\ 11 \end{bmatrix} L = 1 − 1 2 0 1 − 5 0 0 1 , U = 2 0 0 − 3 4 0 1 2 3 , b = 1 0 11 Show solution ↓ Hide solution ↑ Solution
The problem A x = b A\mathbf{x} = \mathbf{b} A x = b is solved in two sequential steps:
Solve L y = b L\mathbf{y} = \mathbf{b} L y = b for y \mathbf{y} y (Forward Substitution).
Solve U x = y U\mathbf{x} = \mathbf{y} U x = y for x \mathbf{x} x (Back Substitution).
Step 1: Forward Substitution (L y = b L\mathbf{y} = \mathbf{b} L y = b )
[ 1 0 0 − 1 1 0 2 − 5 1 ] [ y 1 y 2 y 3 ] = [ 1 0 11 ] \begin{bmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
2 & -5 & 1
\end{bmatrix}
\begin{bmatrix} y_1 \\ y_2 \\ y_3 \end{bmatrix}
=
\begin{bmatrix} 1 \\ 0 \\ 11 \end{bmatrix} 1 − 1 2 0 1 − 5 0 0 1 y 1 y 2 y 3 = 1 0 11
From row 1:
y 1 = 1 y_1 = 1 y 1 = 1
From row 2:
− y 1 + y 2 = 0 ⟹ − 1 + y 2 = 0 ⟹ y 2 = 1 -y_1 + y_2 = 0 \implies -1 + y_2 = 0 \implies y_2 = 1 − y 1 + y 2 = 0 ⟹ − 1 + y 2 = 0 ⟹ y 2 = 1
From row 3:
2 y 1 − 5 y 2 + y 3 = 11 ⟹ 2 ( 1 ) − 5 ( 1 ) + y 3 = 11 ⟹ − 3 + y 3 = 11 ⟹ y 3 = 14 2y_1 - 5y_2 + y_3 = 11 \implies 2(1) - 5(1) + y_3 = 11 \implies -3 + y_3 = 11 \implies y_3 = 14 2 y 1 − 5 y 2 + y 3 = 11 ⟹ 2 ( 1 ) − 5 ( 1 ) + y 3 = 11 ⟹ − 3 + y 3 = 11 ⟹ y 3 = 14
So y = [ 1 1 14 ] \mathbf{y} = \begin{bmatrix} 1 \\ 1 \\ 14 \end{bmatrix} y = 1 1 14 .
Step 2: Back Substitution (U x = y U\mathbf{x} = \mathbf{y} U x = y )
[ 2 − 3 1 0 4 2 0 0 3 ] [ x 1 x 2 x 3 ] = [ 1 1 14 ] \begin{bmatrix}
2 & -3 & 1 \\
0 & 4 & 2 \\
0 & 0 & 3
\end{bmatrix}
\begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix}
=
\begin{bmatrix} 1 \\ 1 \\ 14 \end{bmatrix} 2 0 0 − 3 4 0 1 2 3 x 1 x 2 x 3 = 1 1 14
From row 3:
3 x 3 = 14 ⟹ x 3 = 14 3 3x_3 = 14 \implies x_3 = \frac{14}{3} 3 x 3 = 14 ⟹ x 3 = 3 14
From row 2:
4 x 2 + 2 x 3 = 1 ⟹ 4 x 2 + 2 ( 14 3 ) = 1 4x_2 + 2x_3 = 1 \implies 4x_2 + 2\left(\frac{14}{3}\right) = 1 4 x 2 + 2 x 3 = 1 ⟹ 4 x 2 + 2 ( 3 14 ) = 1
4 x 2 = 1 − 28 3 = − 25 3 ⟹ x 2 = − 25 12 4x_2 = 1 - \frac{28}{3} = -\frac{25}{3} \implies x_2 = -\frac{25}{12} 4 x 2 = 1 − 3 28 = − 3 25 ⟹ x 2 = − 12 25
From row 1:
2 x 1 − 3 x 2 + x 3 = 1 ⟹ 2 x 1 − 3 ( − 25 12 ) + 14 3 = 1 2x_1 - 3x_2 + x_3 = 1 \implies 2x_1 - 3\left(-\frac{25}{12}\right) + \frac{14}{3} = 1 2 x 1 − 3 x 2 + x 3 = 1 ⟹ 2 x 1 − 3 ( − 12 25 ) + 3 14 = 1
2 x 1 + 25 4 + 14 3 = 1 ⟹ 2 x 1 + 75 + 56 12 = 1 ⟹ 2 x 1 + 131 12 = 12 12 2x_1 + \frac{25}{4} + \frac{14}{3} = 1 \implies 2x_1 + \frac{75 + 56}{12} = 1 \implies 2x_1 + \frac{131}{12} = \frac{12}{12} 2 x 1 + 4 25 + 3 14 = 1 ⟹ 2 x 1 + 12 75 + 56 = 1 ⟹ 2 x 1 + 12 131 = 12 12
2 x 1 = − 119 12 ⟹ x 1 = − 119 24 2x_1 = -\frac{119}{12} \implies x_1 = -\frac{119}{24} 2 x 1 = − 12 119 ⟹ x 1 = − 24 119
Conclusion:
The solution is:
x = [ − 119 / 24 − 25 / 12 14 / 3 ] \mathbf{x} = \begin{bmatrix} -119/24 \\ -25/12 \\ 14/3 \end{bmatrix} x = − 119/24 − 25/12 14/3