Matrix Calculator

🌐 English
A (3×3)
Rows: 3
Cols: 3
B (3×3)
Rows: 3
Cols: 3
Supports: fractions (1/2), decimals (0.5), constants (pi, e). Empty cells are treated as 0.

Calculation Results

LU Decomposition: Definition and Formula

LU decomposition is a method that factors a square matrix \(A\) into two matrices:

\[ A = LU \]

Where:

  • \(L\) is a lower triangular matrix (diagonal elements are 1 or non-zero depending on convention).
  • \(U\) is an upper triangular matrix.

LU decomposition is widely used for solving systems of linear equations, computing determinants, and numerical analysis.

Formula

For a matrix: \[ A = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix} \] we find matrices \[ L = \begin{pmatrix} 1 & 0 & 0 \\ l_{21} & 1 & 0 \\ l_{31} & l_{32} & 1 \end{pmatrix}, \quad U = \begin{pmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{pmatrix}. \]

The goal is to perform Gaussian elimination on \(A\) and record the multipliers into \(L\).


Example 1

Decompose the matrix:

\[ A = \begin{pmatrix} 2 & 3 \\ 4 & 7 \end{pmatrix} \]

Step 1: Compute \(L\) multipliers

\[ l_{21} = \frac{4}{2} = 2 \]

Step 2: Form \(U\)

\[ U = \begin{pmatrix} 2 & 3 \\ 0 & 7 - 2\cdot 3 \end{pmatrix} = \begin{pmatrix} 2 & 3 \\ 0 & 1 \end{pmatrix} \]

Step 3: Form \(L\)

\[ L = \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix} \]

Final Answer:

\[ A = LU = \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix} \begin{pmatrix} 2 & 3 \\ 0 & 1 \end{pmatrix} \]

Example 2

Find the LU decomposition of:

\[ A = \begin{pmatrix} 1 & 2 & 4 \\ 3 & 8 & 14 \\ 2 & 6 & 13 \end{pmatrix} \]

Step 1: Eliminate entries below pivot.

\[ l_{21} = 3,\quad l_{31} = 2 \]

After elimination, compute next multiplier:

\[ l_{32} = 1 \]

Final Result:

\[ L = \begin{pmatrix} 1 & 0 & 0 \\ 3 & 1 & 0 \\ 2 & 1 & 1 \end{pmatrix}, \quad U = \begin{pmatrix} 1 & 2 & 4 \\ 0 & 2 & 2 \\ 0 & 0 & 1 \end{pmatrix} \]

Thus:

\[ A = LU \]

Common Mistakes (Important!)

  • Forgetting that \(L\) must be lower triangular.
  • Using wrong multipliers during elimination.
  • Forgetting to update rows when computing entries of \(U\).
  • Assuming all matrices have an LU decomposition—pivoting may be required.

Practice Problems

1. Compute the LU decomposition of:

\[ A = \begin{pmatrix} 1 & 3 \\ 2 & 7 \end{pmatrix} \]
Show Answer \[ L= \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix}, \quad U= \begin{pmatrix} 1 & 3 \\ 0 & 1 \end{pmatrix} \]

2. Find the LU decomposition of:

\[ A = \begin{pmatrix} 2 & 1 \\ 6 & 4 \end{pmatrix} \]
Show Answer \[ L= \begin{pmatrix} 1 & 0 \\ 3 & 1 \end{pmatrix}, \quad U= \begin{pmatrix} 2 & 1 \\ 0 & 1 \end{pmatrix} \]

3. Decompose the matrix:

\[ A = \begin{pmatrix} 4 & 2 & 0 \\ 4 & 4 & 2 \\ 2 & 2 & 3 \end{pmatrix} \]
Show Answer \[ L= \begin{pmatrix} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0.5 & 0 & 1 \end{pmatrix}, \quad U= \begin{pmatrix} 4 & 2 & 0 \\ 0 & 2 & 2 \\ 0 & 0 & 3 \end{pmatrix} \]

4. LU decomposition of:

\[ A = \begin{pmatrix} 3 & 1 & 1 \\ 6 & 3 & 4 \\ 3 & 1 & 5 \end{pmatrix} \]
Show Answer \[ L= \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 1 & 0 & 1 \end{pmatrix}, \quad U= \begin{pmatrix} 3 & 1 & 1 \\ 0 & 1 & 2 \\ 0 & 0 & 4 \end{pmatrix} \]

Copyright Notice: This article is original content from the Matrix Calculator website. Please credit the source when sharing or reproducing it. For more matrix computation tools, visit matrixcalcu.com.

Learn matrix multiplication more easily in just 2 minutes with this free game.

Matrix Multiplication Game