Learn Without Walls
← Lesson 3Lesson 4 of 4Practice Problems →

Lesson 4: Elementary Matrices and LU Factorization

Estimated time: 35-45 minutes

Learning Objectives

Elementary Matrices

Elementary Matrix: A matrix obtained by performing a single elementary row operation on the identity matrix. If E is the elementary matrix for a row operation, then EA performs that same operation on A.

Example: Three Types of Elementary Matrices (3x3)

Row swap R_1 ↔ R_2:

E_1 = [ 0 1 0 ; 1 0 0 ; 0 0 1 ]

Row scaling 3R_2:

E_2 = [ 1 0 0 ; 0 3 0 ; 0 0 1 ]

Row replacement R_3 + (-2)R_1 → R_3:

E_3 = [ 1 0 0 ; 0 1 0 ; -2 0 1 ]

Key Insight

Every elementary matrix is invertible. Its inverse is the elementary matrix that undoes the operation:

  • Swap inverse = same swap
  • Scale by c inverse = scale by 1/c
  • Add c times row j to row i inverse = subtract c times row j from row i

Factoring with Elementary Matrices

If you row reduce A to REF U using operations E_1, E_2, ..., E_k, then:

E_k ... E_2 E_1 A = U

Solving for A: A = E_1^{-1} E_2^{-1} ... E_k^{-1} U. This expresses A as a product of elementary matrices and U.

If A is invertible and U = I, then A^{-1} = E_k ... E_2 E_1 (the product of the elementary matrices used in row reduction).

LU Factorization

LU Factorization: A = LU where L is lower triangular (zeros above diagonal) and U is upper triangular (zeros below diagonal). L captures the multipliers used during forward elimination.

Worked Example

Factor A = [ 2 1 ; 6 4 ].

Forward elimination: R_2 - 3R_1 → R_2 (multiplier = 3):

U = [ 2   1 ]
    [ 0   1 ]

Build L: Start with the identity, place the multiplier (3) in position (2,1):

L = [ 1   0 ]
    [ 3   1 ]

Verify: LU = [ 1(2)+0(0), 1(1)+0(1) ; 3(2)+1(0), 3(1)+1(1) ] = [ 2 1 ; 6 4 ] = A. ✓

Worked Example: 3x3 LU

Factor A = [ 1 2 1 ; 2 5 3 ; -1 1 2 ].

Step 1: R_2 - 2R_1 (multiplier m_{21} = 2) and R_3 + 1R_1 (multiplier m_{31} = -1):

[ 1   2   1 ]
[ 0   1   1 ]
[ 0   3   3 ]

Step 2: R_3 - 3R_2 (multiplier m_{32} = 3):

U = [ 1   2   1 ]
    [ 0   1   1 ]
    [ 0   0   0 ]

Build L from the multipliers:

L = [ 1   0   0 ]
    [ 2   1   0 ]
    [-1   3   1 ]

A = LU. ✓

Solving with LU

To solve Ax = b using A = LU:

  1. Forward solve Ly = b (easy because L is lower triangular).
  2. Back solve Ux = y (easy because U is upper triangular).

Advantage: If you need to solve Ax = b for many different b vectors (same A), compute the LU factorization once, then do two cheap triangular solves for each new b.

Check Your Understanding

1. What elementary matrix performs R_2 + 5R_1 on a 2x2 matrix?

Answer: E = [ 1 0 ; 5 1 ]. Apply this row operation to I_2.

2. What is the inverse of the elementary matrix E = [ 1 0 ; 5 1 ]?

Answer: E^{-1} = [ 1 0 ; -5 1 ]. The inverse undoes the operation: subtract 5 times row 1 from row 2.

3. In an LU factorization, where do the elimination multipliers go?

Answer: The multipliers go into the lower-triangular matrix L, below the diagonal, in the same position as the entry they eliminated. L has 1s on its diagonal.

4. Why is LU factorization useful in practice?

Answer: Once you have A = LU, you can solve Ax = b for many different right-hand sides b by doing two triangular solves each time, which is much faster than re-doing Gaussian elimination from scratch.

Key Takeaways

Practice Problems

Apply your matrix algebra skills.

Practice

Module Quiz

Take Quiz