LU Factorisation Explained with Worked Examples

LU factorisation writes a matrix as , with lower triangular (1s on the diagonal) and upper triangular. It records Gaussian elimination and lets you solve by two easy triangular solves.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

What LU factorisation means

Eliminate below each pivot with row operations (see determinants under row operations). The resulting upper triangular matrix is ; the multipliers you used, placed below the diagonal, form . The determinant is then the product of the diagonal entries of .

To solve , first solve by forward substitution, then by back substitution. Once and are known, each new right-hand side is cheap, which is the advantage over finding an inverse.

Related factorisations are QR and Cholesky, and LU underlies the elimination used in systems of three equations.

What is it used for?

LU factorisation splits a matrix into two triangular matrices that are easy to solve with. It is how many computers solve systems of equations.

How to use lu factorisation

  1. Eliminate below the first pivot and record the multipliers.
  2. Continue down the diagonal to get .
  3. Put the multipliers below the diagonal of with 1s on the diagonal.
  4. Check that .

Graph

Elimination turns A into upper triangular Uu₁₁ = 1u₂₂ = 1u₃₃ = 200.511.522.533.540123456Elimination turns A into upper triangular UxyGraph with x from 0 to 4 and y from 0 to 6. Shows bars (3); point u₁₁ = 1 at (1, 1); point u₂₂ = 1 at (2, 1); point u₃₃ = 2 at (3, 2).

The pivots 1, 1, 2 on the diagonal of U multiply to give the determinant 2.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: a 2 × 2 factorisation

Factorise .

Worked example Answer checked
Answer
A=LUA=LU
  1. Multiplier
  2. U
  3. L
  4. Check

Example 2: a 3 × 3 factorisation

Factorise .

Worked example
Answer
L=(100210111)L=\begin{pmatrix}1&0&0\\2&1&0\\1&1&1\end{pmatrix}
  1. Multipliers
  2. U
  3. det A = product of the diagonal of U

Example 3: solving a system

Solve for , .

Worked example
Answer
x=1, y=1x=1,\ y=1
  1. Forward: Ly = b
  2. Back: Ux = y

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

A = (2 1; 4 3)

l₂₁ = 4/2

2.

same

u₂₂ = 3 − 2×1

1.

same

det A = u₁₁u₂₂

2.

b = (5, 11)

solve Ly = b: y₂ = 11 − 2×5

1.

Word problems

A = LU records Gaussian elimination: L lower triangular with 1s on the diagonal holds the multipliers; U is the echelon form. Solve Ly = b, then Ux = y.

Multiplier

Row 2 minus l₂₁ times row 1.

  1. 4/2
  2. Check: ✓2

U entry

3 − 2·1.

  1. 1
  2. Check: ✓1

Determinant Higher

Product of the diagonal of U.

  1. 2 × 1
  2. Check: ✓2

Forward substitution Higher

y₁ = 5, y₂ = 11 − 2·5.

  1. 1
  2. Check: ✓1

Common mistakes

L upper triangular

upper ✗

lower ✓

L is lower.

Multiplier sign

−2 ✗

+2 in L (the elimination subtracts it) ✓

Convention.

Needs no row swaps ever

never ✗

sometimes needs pivoting PA = LU ✓

Pivoting.

det L = 0

0 ✗

1 ✓

Unit diagonal.

Exam tips

  1. A = LU.
  2. L: multipliers, unit diagonal.
  3. Forward then back substitution.
  4. det A = product of U’s diagonal.
  5. Pivot if a zero appears.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. l₂₁ for (4 3; 6 3) Foundation

1.5

2. u₂₂ for (4 3; 6 3) Foundation

-1.5

3. det (4 3; 6 3) via LU Foundation

-6

4. l₂₁ for (1 2; 3 7) Higher

3

5. u₂₂ for (1 2; 3 7) Higher

1

6. x₂ for U = (2 1; 0 1), y = (5, 1) Higher

1

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

LU factorisation
A = LU.
Lower triangular (L)
Zeros above.
Upper triangular (U)
Zeros below.
Multiplier
l_ij.
Forward substitution
Solve Ly = b.
Back substitution
Solve Ux = y.

Frequently asked questions

What is LU factorisation?

A = LU with L lower and U upper triangular.

How do I solve Ax = b with it?

Solve Ly = b, then Ux = y.

How do I find the determinant?

Multiply the diagonal of U (L has 1s).

What if a pivot is zero?

Swap rows: PA = LU.

Which page covers QR?

QR and Cholesky factorisations.

Which page covers row operations?

determinant under row operations.

More in Vectors and matrices and the formula sheets.