LIAL · Linear Algebra Tools
← All tools

Systems

LU Decomposition

PA = LU step by step with elimination matrices, then solve Ax = b by forward and back substitution.

A=1249b=521

Step by step (1 of 5)

  1. 1Eliminate a₂₁ with E₂₁ (l₂₁ = 4)

    E₂₁=10-41·1249=1201

    l₂₁ = a₂₁ / a₁₁ = 4 / 1 = 4 → row 2 − 4 · row 1

    L so far=1041

    E₂₁ has −l₂₁ at position (2,1). It is undone by L₂₁ with +l₂₁ — that is why the multiplier appears in L with a plus sign.

Theory: LU decomposition (SW03)
  • Every elimination step is a multiplication by an elimination matrix Eij (identity with −lij at position (i, j)). After all steps: E32E31E21A = U.
  • Hence A = (E32E31E21)−1U = L·U. The inverse Lij of a step turns −lij into +lij; in L every multiplier lij sits in row i, column j.
  • If a pivot is 0, rows are swapped: decompose P·A = L·U — and swap b to P·b as well.
  • Ax = b becomes L·y = b (forward substitution, from the top) and U·x = y (back substitution, from the bottom).
  • Advantage: for many right-hand sides b with the same matrix A you decompose only once — every further solve is cheap.