Skip to content

LU factorization

Record the multipliers of elimination in a lower triangular matrix L so that A = LU with U the upper triangular result, and solve Ax = b by forward then back substitution, cheaply for many right sides.

It opens on

Elimination on A never looks at b, so why redo it for every new right side, and can the multipliers be saved in a matrix so that A is rebuilt from them?

Why it matters

Simulations and data pipelines solve the same matrix against hundreds of right-hand sides, and factoring once makes each later solve about a thousand times cheaper for large systems.

Good to know first

  • Gaussian elimination: row operations, multipliers, pivots, upper triangular form
  • Multiplication as composition: AB means apply B, then A, and the product's columns
  • Transpose and special matrices: lower and upper triangular matrices

Step by step

  1. A = LU for a 2 × 2 matrix

    Find L and U for a 2 × 2 matrix, check LU = A, and see A = LU as "U first, then L" on the unit square.

    Undo it: A = E⁻¹U, and E⁻¹ = [[1, 0], [3, 1]] adds the 3 back; call it L, lower triangular with 1s on the diagonal and the multiplier 3 below.

    A common mix-up

    L has −3 in it because elimination subtracted 3.

    In fact: Elimination used E with −3, and L = E⁻¹ puts the multiplier back with a plus sign.

  2. The 3 × 3 factors

    Read L from the multipliers and U from the reduced table of a 3 × 3 matrix, and check LU = A row by row.

    L collects them: l₂₁ = 2, l₃₁ = 1, l₃₂ = 1, with 1s on the diagonal and 0 above, so L = [[1, 0, 0], [2, 1, 0], [1, 1, 1]].

    A common mix-up

    L is just A with the entries above the diagonal removed.

    In fact: L holds the elimination multipliers, which are not entries of A (here l₂₁ = 2, while the entry is 2 only because the pivot is 1).

  3. Solving with L and U

    Solve Ax = b by forward substitution Lc = b and back substitution Ux = c, for two right sides, and see why factoring once pays off.

    For b = (6, 11, 14): c₁ = 6; 2c₁ + c₂ = 11 gives c₂ = −1; c₁ + c₂ + c₃ = 14 gives c₃ = 9, so c = (6, −1, 9), the right column of the reduced table.

    A common mix-up

    Elimination must be redone for every new b because it works on [A | b].

    In fact: The row operations depend only on A; L remembers them and applies them to a new b.

Try it

Find L and U for A = [[2, 1], [6, 5]].Answer

L = [[1, 0], [3, 1]], U = [[2, 1], [0, 2]]

Hint: Multiplier 6 / 2 = 3

Row 3 of L is (1, 1, 1) and U = [[1, 1, 1], [0, 1, −1], [0, 0, 3]]. Which row of A does LU give?Answer

1 · (1, 1, 1) + 1 · (0, 1, −1) + 1 · (0, 0, 3) = (1, 2, 3)

Hint: Row i of L weights the rows of U

With L = [[1, 0], [3, 1]] and U = [[2, 1], [0, 2]], solve Ax = (3, 11).Answer

c = (3, 2) and x = (1, 1)

Hint: Lc = b first: 3 · 3 + c₂ = 11

L sends (x, y) to (x, 3x + y). Where does it send the corner (−2, 8) of U's image?Answer

(−2, 2).

Why does L hold +2, +1, +1 when elimination subtracted those multiples?Answer

L undoes the subtractions, so it adds the same multiples of the rows of U back.

LU factorization

30 minutes every month. No card.