LU Decomposition Calculator

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

Matrix A
Size
2

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

Try

Result

You enteredLU decomposition of (4363)\text{LU decomposition of } \begin{pmatrix} 4 & 3 \\ 6 & 3 \end{pmatrix}

L=(10321),  U=(430−32)\displaystyle L = \begin{pmatrix} 1 & 0 \\ \frac{3}{2} & 1 \end{pmatrix},\ \ U = \begin{pmatrix} 4 & 3 \\ 0 & -\frac{3}{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=(4363)A = \begin{pmatrix} 4 & 3 \\ 6 & 3 \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=32l_{21} = \frac{3}{2}
  3. Check by multiplying back

    Multiplying LL by UU should give AA.

    LU=(10321)(430−32)=(4363)L U = \begin{pmatrix} 1 & 0 \\ \frac{3}{2} & 1 \end{pmatrix}\begin{pmatrix} 4 & 3 \\ 0 & -\frac{3}{2} \end{pmatrix} = \begin{pmatrix} 4 & 3 \\ 6 & 3 \end{pmatrix}
  4. Result

    So L=(10321),  U=(430−32)L = \begin{pmatrix} 1 & 0 \\ \frac{3}{2} & 1 \end{pmatrix},\ \ U = \begin{pmatrix} 4 & 3 \\ 0 & -\frac{3}{2} \end{pmatrix}.

Worked examples