Skip to content
FiftyCalc Free calculators for all 50 states

LU Decomposition Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter a 3×3 matrix to get L (unit lower triangular) and U (upper triangular) with A = L × U.

Result

Sample figures

Determinant of A = u₁₁ × u₂₂ × u₃₃—

U row 1, column 1 —

  • U row 1, column 2—
  • U row 1, column 3—
  • L row 2, column 1—
  • U row 2, column 2—
  • U row 2, column 3—
  • L row 3, column 1—
  • L row 3, column 2—
  • U row 3, column 3—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

LU Decomposition Calculator

Row 1, column 1: enter a number. Prefilled example: 2.

Row 1, column 2: enter a number. Prefilled example: -1.

Row 1, column 3: enter a number. Prefilled example: -2.

Row 2, column 1: enter a number. Prefilled example: -4.

Row 2, column 2: enter a number. Prefilled example: 6.

Row 2, column 3: enter a number. Prefilled example: 3.

Row 3, column 1: enter a number. Prefilled example: -4.

Row 3, column 2: enter a number. Prefilled example: -2.

Row 3, column 3: enter a number. Prefilled example: 8.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Row 1, column 1: enter a number.
  2. Row 1, column 2: enter a number.
  3. Row 1, column 3: enter a number.
  4. Row 2, column 1: enter a number.
  5. Row 2, column 2: enter a number.
  6. Row 2, column 3: enter a number.
  7. Row 3, column 1: enter a number.
  8. Row 3, column 2: enter a number.
  9. Row 3, column 3: enter a number.
  10. Read the result: Determinant of A = u₁₁ × u₂₂ × u₃₃; the panel also shows U row 1, column 1, U row 1, column 2, U row 1, column 3, L row 2, column 1, U row 2, column 2, U row 2, column 3, L row 3, column 1, L row 3, column 2 and U row 3, column 3.

How this calculator works

The Doolittle method writes A = LU, where L has 1s on its diagonal and zeros above it, and U has zeros below its diagonal. Row 1 of U is row 1 of A; then l₂₁ = a₂₁ ÷ u₁₁, l₃₁ = a₃₁ ÷ u₁₁, u₂₂ = a₂₂ − l₂₁u₁₂, u₂₃ = a₂₃ − l₂₁u₁₃, l₃₂ = (a₃₂ − l₃₁u₁₂) ÷ u₂₂ and u₃₃ = a₃₃ − l₃₁u₁₃ − l₃₂u₂₃. These are the multipliers of Gaussian elimination.

The diagonal entries of L are 1 and the entries above its diagonal (and below the diagonal of U) are 0, so they are not repeated. det A = det L × det U = u₁₁u₂₂u₃₃.

This version does not swap rows. If a pivot u₁₁ or u₂₂ is 0, the matrix needs row exchanges (PA = LU) and the entries show a dash.

Worked example

Row 1, column 12
Row 1, column 2-1
Row 1, column 3-2
Row 2, column 1-4
Row 2, column 26
Row 2, column 33
Row 3, column 1-4
Row 3, column 2-2
Row 3, column 38
U row 1, column 12
U row 1, column 2-1
U row 1, column 3-2
L row 2, column 1-2
U row 2, column 24
U row 2, column 3-1
L row 3, column 1-2
L row 3, column 2-1
U row 3, column 33
Determinant of A = u₁₁ × u₂₂ × u₃₃24

Frequently asked questions

What is the LU decomposition of [[2, −1, −2], [−4, 6, 3], [−4, −2, 8]]?

L = [[1, 0, 0], [−2, 1, 0], [−2, −1, 1]] and U = [[2, −1, −2], [0, 4, −1], [0, 0, 3]], so det A = 2 × 4 × 3 = 24.

What is LU decomposition used for?

Solving Ax = b for many right-hand sides: solve Ly = b by forward substitution, then Ux = y by back substitution.

Related calculators