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
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.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Row 1, column 1: enter a number.
- Row 1, column 2: enter a number.
- Row 1, column 3: enter a number.
- Row 2, column 1: enter a number.
- Row 2, column 2: enter a number.
- Row 2, column 3: enter a number.
- Row 3, column 1: enter a number.
- Row 3, column 2: enter a number.
- Row 3, column 3: enter a number.
- 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 1 | 2 |
|---|---|
| Row 1, column 2 | -1 |
| Row 1, column 3 | -2 |
| Row 2, column 1 | -4 |
| Row 2, column 2 | 6 |
| Row 2, column 3 | 3 |
| Row 3, column 1 | -4 |
| Row 3, column 2 | -2 |
| Row 3, column 3 | 8 |
| U row 1, column 1 | 2 |
|---|---|
| U row 1, column 2 | -1 |
| U row 1, column 3 | -2 |
| L row 2, column 1 | -2 |
| U row 2, column 2 | 4 |
| U row 2, column 3 | -1 |
| L row 3, column 1 | -2 |
| L row 3, column 2 | -1 |
| U row 3, column 3 | 3 |
| 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.