LU Decomposition Calculator

Enter a square matrix to factor it into lower and upper triangular matrices.

Matrix A
Size
3

A square matrix from 2 by 2 to 5 by 5, rows separated by semicolons.

Try

Result

You enteredLU decomposition of (211433879)\text{LU decomposition of } \begin{pmatrix} 2 & 1 & 1 \\ 4 & 3 & 3 \\ 8 & 7 & 9 \end{pmatrix}

L=(100210431),  U=(211011002)\displaystyle L = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 4 & 3 & 1 \end{pmatrix},\ \ U = \begin{pmatrix} 2 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 2 \end{pmatrix}
Show the work
  1. LU decomposition

    Write the matrix as a product of a lower-triangular matrix LL (with 1s on its diagonal) and an upper-triangular matrix UU. UU is what Gaussian elimination leaves, and LL remembers the multipliers used.

    Using A=LUA = L U

    A=(211433879)A = \begin{pmatrix} 2 & 1 & 1 \\ 4 & 3 & 3 \\ 8 & 7 & 9 \end{pmatrix}
  2. Multipliers for one column

    Each multiplier likl_{ik} is the entry to clear divided by the pivot in column 1. Subtracting that multiple of the pivot row from row ii makes the entry 0, and likl_{ik} is stored in LL.

    Using lik=uikukkl_{ik} = \frac{u_{ik}}{u_{kk}}

    l21=2, l31=4l_{21} = 2,\ l_{31} = 4
  3. Multipliers for one column

    Each multiplier likl_{ik} is the entry to clear divided by the pivot in column 2. Subtracting that multiple of the pivot row from row ii makes the entry 0, and likl_{ik} is stored in LL.

    Using lik=uikukkl_{ik} = \frac{u_{ik}}{u_{kk}}

    l32=3l_{32} = 3
  4. Check by multiplying back

    Multiplying LL by UU should give AA.

    LU=(100210431)(211011002)=(211433879)L U = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 4 & 3 & 1 \end{pmatrix}\begin{pmatrix} 2 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 2 \end{pmatrix} = \begin{pmatrix} 2 & 1 & 1 \\ 4 & 3 & 3 \\ 8 & 7 & 9 \end{pmatrix}
  5. Result

    So L=(100210431),  U=(211011002)L = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 4 & 3 & 1 \end{pmatrix},\ \ U = \begin{pmatrix} 2 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 2 \end{pmatrix}.

Worked examples