LU Decomposition Calculator

Decompose square matrices into lower and upper triangular matrices using Doolittle's method

Matrix Input

Enter the elements of your square matrix A

LU Decomposition Results

✓ Decomposition Successful
A = L × U where A is your input matrix

L (Lower Triangular) Matrix

[1.0000]
[1.5001.000]

U (Upper Triangular) Matrix

[4.0003.000]
[0-1.500]
Determinant: -6.000000
Calculated as the product of diagonal elements of U

Verification: L × U

[4.0003.000]
[6.0003.000]

Step-by-Step Solution

1.Step 1: Initialize L as an identity matrix with 1s on the diagonal
2.Step 2: Calculate row 1 of U matrix
3.Step 3: Calculate column 1 of L matrix below diagonal
4.Step 3: Calculate row 2 of U matrix
5.Final: Verify that L × U = A (original matrix)

Example Calculation

2×2 Matrix Example

Matrix A:

[4 3]
[6 3]

LU Decomposition Result

L Matrix:

[1 0 ]
[1.5 1 ]

U Matrix:

[4 3 ]
[0 -1.5]

Determinant: 4 × (-1.5) = -6

LU Decomposition Properties

L

Lower Triangular

All elements above diagonal are zero

Diagonal elements are 1 (unit triangular)

U

Upper Triangular

All elements below diagonal are zero

Contains the pivot elements

A

Original Matrix

A = L × U decomposition

Must be square and non-singular

Applications

Solving systems of linear equations

Computing matrix determinants

Finding matrix inverses

Numerical analysis computations

Computer graphics transformations

Understanding LU Decomposition

What is LU Decomposition?

LU decomposition factors a square matrix A into the product of two matrices: a lower triangular matrix L and an upper triangular matrix U, such that A = LU.

Doolittle's Method

  • Sets diagonal elements of L to 1 (unit triangular)
  • Calculates U matrix row by row
  • Calculates L matrix column by column
  • Uses forward and backward substitution

Mathematical Formulas

Upper triangular U:

U[i][j] = A[i][j] - Σ(L[i][k] × U[k][j])

Lower triangular L:

L[i][j] = (A[i][j] - Σ(L[i][k] × U[k][j])) / U[j][j]

Determinant:

det(A) = Π(U[i][i]) for i = 0 to n-1

Note: LU decomposition fails if any pivot element is zero. In such cases, partial pivoting (row permutation) is needed.