Online LU Matrix Decomposition Calculator

What is LU Decomposition and Why is it Important?

LU decomposition (also called LU factorization) is a fundamental technique in linear algebra that decomposes a square matrix \(A\) into the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\):

\[ A = L \times U \]

Importance of LU Decomposition:

How LU Decomposition is Calculated:

The decomposition is typically computed using Gaussian elimination. Here are the key steps:

  1. Step 1: Start with the original matrix \(A\).
  2. Step 2: For each column \(k\) from 1 to \(n-1\):
    • For each row \(i\) below the diagonal (\(i > k\)):
      • Compute the multiplier: \(m_{ik} = \frac{a_{ik}}{a_{kk}}\)
      • Store \(m_{ik}\) in the \(L\) matrix at position \((i,k)\)
      • Subtract \(m_{ik}\) times row \(k\) from row \(i\) to eliminate elements below the diagonal in column \(k\)
  3. Step 3: The resulting matrix after all eliminations becomes the upper triangular matrix \(U\).
  4. Step 4: Construct \(L\) as a lower triangular matrix with ones on the diagonal and the multipliers \(m_{ik}\) in the appropriate positions.

Note: Not all matrices have an LU decomposition. A matrix has an LU decomposition if and only if all its leading principal minors (determinants of the top-left \(k \times k\) submatrices) are non-zero.

LU Matrix Decomposition

An online calculator that calculates the LU decomposition of a square matrix.

An \( LU \) decomposition of a given matrix \( A \) can be written as: \[ A = L U \] where \( L \) is a lower triangular matrix and \( U \) is an upper triangular matrix.

Note: Not all square matrices have an LU decomposition. An invertible matrix \( A \) has an \( LU \) decomposition if and only if all its leading principal minors are different from zero.

Matrix Input

Enter the number of columns (and rows) \( n = \)

This will create a matrix with random values.

Results

Note: Any decomposition with outputs such as "NaN" or "Infinity" is not valid and means that the matrix does not have an LU decomposition.

More References and Links

  1. LU Decomposition
  2. Row Reduce Augmented Matrices - Calculator
  3. Linear Algebra Calculators
  4. Linear Algebra - Questions with Solutions
  5. Linear Algebra and its Applications - 5th Edition - David C. Lay, Steven R. Lay, Judi J. McDonald
  6. Elementary Linear Algebra - 7th Edition - Howard Anton and Chris Rorres