LU Factorization Calculator

Enter a square matrix, one row per line, to factor it into lower (L) and upper (U) triangular matrices.

Separate numbers with spaces or commas. Must be square (nร—n).

โ€”

LU factorization writes a square matrix A as the product of a lower-triangular matrix L and an upper-triangular matrix U. Doolittle's method sets L's diagonal to 1 and solves for the other entries row by row. It is used to solve linear systems, invert matrices and find determinants efficiently.

Advertisement

How to Use This Calculator

Type a square matrix with one row per line, separating the numbers in a row by spaces or commas. The calculator returns the lower-triangular matrix L (with ones on its diagonal) and the upper-triangular matrix U whose product is your original matrix.

LU factorization is a workhorse of numerical linear algebra: once you have L and U, solving a system, computing a determinant, or inverting the matrix becomes fast and repeatable.

How the Calculation Works

Doolittle's method fixes the diagonal of L at 1 and then, working through the matrix, computes each entry of U across a row and each entry of L down a column using the entries already found. It is essentially Gaussian elimination, with L storing the multipliers used to zero out each column.

This calculator uses Doolittle's method without row pivoting, so it works when no pivot (diagonal U value) comes out as zero. Matrices that need row swaps require the PA = LU form with a permutation matrix.

A = LU (Doolittle): L has unit diagonal; solve U's rows and L's columns in turn

Worked Example

Factor the matrix [[4, 3], [6, 3]]. The first row of U is just the first row of A: 4 and 3. The multiplier for row 2 is 6 รท 4 = 1.5, so L's (2,1) entry is 1.5.

Then U's (2,2) entry is 3 โˆ’ 1.5 ร— 3 = โˆ’1.5. So L = [[1, 0], [1.5, 1]] and U = [[4, 3], [0, โˆ’1.5]]. Multiplying L by U returns the original matrix.

Assumptions and Limitations

  • Requires a square matrix (same number of rows and columns)
  • Uses Doolittle's method without pivoting (L has a unit diagonal)
  • Fails if a pivot is zero โ€” such matrices need PA = LU with row swaps
  • Results are rounded for display

Who Uses an LU Factorization Calculator

Linear-algebra and numerical-methods students, and engineers, use this to decompose a square matrix into lower and upper triangular factors. Run it to solve linear systems efficiently, find a determinant, or check by-hand work. Enter the matrix to get its L and U factors.

Frequently Asked Questions

What is LU factorization?

It decomposes a square matrix A into a lower-triangular matrix L and an upper-triangular matrix U so that A = LU. It makes solving systems, finding determinants and inverting matrices efficient.

What is Doolittle's method?

An LU algorithm that fixes L's diagonal at 1 and computes the remaining entries of L and U row by row. It is Gaussian elimination with the elimination multipliers stored in L.

What is LU factorization used for?

Mainly for solving linear systems quickly, especially with many right-hand sides, and for computing determinants (the product of U's diagonal) and matrix inverses without redoing elimination each time.

When does LU factorization fail?

When a pivot โ€” a diagonal entry of U โ€” comes out zero, division is impossible without swapping rows. Then the PA = LU form with a permutation matrix P is used instead.

How do I find the determinant from LU?

For Doolittle's method, the determinant of A equals the product of the diagonal entries of U, since L has a determinant of 1. It's a quick by-product of the factorization.

Looking for a different calculator?

CalculatorPlus has free tools across finance, construction, math, health and more โ€” each one showing the formula and a worked example.