Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find the Cholesky Decomposition

A symmetric positive definite matrix factors as A=LLTA = LL^T with LL lower triangular and a positive diagonal. Compute LL column by column: a square root for each diagonal entry, a division for each entry below it.

Recognize the task

A symmetric matrix with positive diagonal entries and the words Cholesky or positive definite, a covariance or Gram matrix, or a request to factor A=LLTA = LL^T. Forms: (9665)\begin{pmatrix} 9 & 6 \\ 6 & 5 \end{pmatrix}, (412−161237−43−16−4398)\begin{pmatrix} 4 & 12 & -16 \\ 12 & 37 & -43 \\ -16 & -43 & 98 \end{pmatrix}. Test: A=ATA = A^T, and every number under a square root stays positive.
The method is in the Cholesky lesson; it needs a symmetric positive definite matrix.

Steps

StepOn A=(412−161237−43−16−4398)A = \begin{pmatrix} 4 & 12 & -16 \\ 12 & 37 & -43 \\ -16 & -43 & 98 \end{pmatrix}
1Check symmetry. Compare aija_{ij} with ajia_{ji}. A matrix that is not symmetric has no Cholesky factor; use the LU decomposition.a12=a21=12a_{12} = a_{21} = 12, a13=a31=−16a_{13} = a_{31} = -16, a23=a32=−43a_{23} = a_{32} = -43 ✓
2Fill column 1. Take l11=a11l_{11} = \sqrt{a_{11}}, then divide the rest of column 1 by it.l11=2l_{11} = 2, l21=122=6l_{21} = \frac{12}{2} = 6, l31=−162=−8l_{31} = \frac{-16}{2} = -8
3Fill column 2. Subtract the squares already in the row before taking the root (diagonal formula); subtract the products before dividing (off-diagonal formula).l22=37−62=1l_{22} = \sqrt{37 - 6^2} = 1, l32=−43−(−8)(6)1=5l_{32} = \frac{-43 - (-8)(6)}{1} = 5
4Fill the last diagonal entry. A zero or negative number under the root means AA is not positive definite: stop.l33=98−(−8)2−52=9=3l_{33} = \sqrt{98 - (-8)^2 - 5^2} = \sqrt{9} = 3
5Check by multiplying. LLTLL^T must give back AA.L=(200610−853)L = \begin{pmatrix} 2 & 0 & 0 \\ 6 & 1 & 0 \\ -8 & 5 & 3 \end{pmatrix}, LLT=ALL^T = A ✓

Worked examples

Example 1 · a two-by-two matrix

basic
A=(9665)A = \begin{pmatrix} 9 & 6 \\ 6 & 5 \end{pmatrix}: l11=3l_{11} = 3, l21=63=2l_{21} = \frac{6}{3} = 2
column 1
l22=5−22=1l_{22} = \sqrt{5 - 2^2} = 1
subtract the square first
L=(3021)L = \begin{pmatrix} 3 & 0 \\ 2 & 1 \end{pmatrix}
check: LLT=ALL^T = A ✓

Example 2 · not positive definite

test fails
A=(1223)A = \begin{pmatrix} 1 & 2 \\ 2 & 3 \end{pmatrix}: l11=1l_{11} = 1, l21=2l_{21} = 2
symmetric, positive diagonal
l22=3−22=−1l_{22} = \sqrt{3 - 2^2} = \sqrt{-1}
negative under the root
no Cholesky factor: AA is not positive definite
eigenvalues 2±52 \pm \sqrt{5}, one negative
Running the algorithm is the Cholesky positive definiteness test.

Example 3 · solving a system

two triangular solves
(42210)x=(6,12)\begin{pmatrix} 4 & 2 \\ 2 & 10 \end{pmatrix}\mathbf{x} = (6, 12): L=(2013)L = \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}
l22=10−1=3l_{22} = \sqrt{10 - 1} = 3
Ly=(6,12)L\mathbf{y} = (6, 12): y=(3,3)\mathbf{y} = (3, 3)
forward substitution
LTx=(3,3)L^T\mathbf{x} = (3, 3): x=(1,1)\mathbf{x} = (1, 1)
back substitution

See it happen

Cholesky is a square root for matrices: as 9=3⋅39 = 3 \cdot 3, so A=LLTA = LL^T. Each diagonal entry of LL is what is left of ajja_{jj} after the earlier columns have taken their share, and positive definiteness guarantees that the share never uses up the whole entry. Follow the entries one by one in the Cholesky visualizer.

Common mistakes

Dropping the subtracted sum

✗ l22=37l_{22} = \sqrt{37}
✓ l22=37−l212=37−36=1l_{22} = \sqrt{37 - l_{21}^2} = \sqrt{37 - 36} = 1

Dividing by the entry of A instead of L

✗ l21=a21a11=124=3l_{21} = \frac{a_{21}}{a_{11}} = \frac{12}{4} = 3
✓ l21=a21l11=122=6l_{21} = \frac{a_{21}}{l_{11}} = \frac{12}{2} = 6
Dividing by a11a_{11} gives the LU multiplier, not the Cholesky entry.

Using it on a matrix that is not symmetric

✗ Cholesky on (4205)\begin{pmatrix} 4 & 2 \\ 0 & 5 \end{pmatrix}
✓ LLTLL^T is always symmetric, so no such factor exists; use LU

Taking a negative square root

✗ l11=−2l_{11} = -2
✓ take the positive root; a positive diagonal makes LL unique