Intuition The ONE core idea
A square grid of numbers (a matrix ) can be split into two simpler grids: one whose numbers only sit on-or-below a slanted line, and one whose numbers only sit on-or-above it. Solving equations with those two simple grids is trivial, so if you split once you can reuse the split forever.
This page assumes you have seen nothing . Every symbol the parent note throws at you — A , L , U , ℓ ij , x , b , the multiplier m ik , "pivot", "triangular", det , P — is built here, from a picture, in an order where each brick rests on the last.
Before any letter with fancy subscripts, three objects.
Definition Scalar, vector, matrix
A scalar is a single number, like 7 or − 2 .
A vector x is a vertical list of numbers. We write it bold and stacked: x = ( x 1 x 2 ) .
A matrix A is a rectangular grid of numbers arranged in rows and columns.
Figure 1 — Scalar vs vector vs matrix. One yellow dot is a scalar (a lone number, 7 ). A blue column of dots joined by a stroke is a vector (a stacked list, x 1 over x 2 ). A green 2 × 2 block of dots is a matrix (the full grid). Read left to right: complexity grows from one number, to a list, to a grid.
Definition The size symbol
n
Throughout, n is the whole number counting how many rows and how many columns a matrix has when those two counts are equal. So an n × n matrix has n rows and n columns; a vector of length n has n entries. In Figure 1 the green matrix has n = 2 .
Intuition Why we need a grid at all
A system of equations like
2 x 1 + 3 x 2 = 8 , 4 x 1 + 7 x 2 = 18
is really "a grid of coefficients acting on a list of unknowns". Pulling the coefficients out into a grid A and the unknowns into a list x lets us write the whole system as one short symbol: A x = b . The grid is the machine; the vector is what you feed it.
x and b
x is the unknown vector : the list of numbers we are solving for. For an n × n matrix A , it has n entries x 1 , … , x n .
b is the right-hand-side vector : the list of known numbers the system must equal. It also has n entries b 1 , … , b n .
In the example above, b = ( 8 18 ) — a length-2 vector, since n = 2 .
Definition Square matrix (and why LU needs it)
A matrix is square when its number of rows equals its number of columns (n × n ). LU decomposition is only defined for square matrices: you need one pivot per column sitting on the diagonal, which requires equal counts. A tall or wide (non-square) grid has no full diagonal to factor along.
Intuition A condition we can only name fully later
For plain A = LU to go through with no row swaps, the pivots must never land on zero as we work down the diagonal. Later — once we have defined the pivot (Section 5) and the determinant (Section 6) — we will be able to state this precisely as "every top-left square corner of A is non-degenerate". For now, just hold the intuition: the diagonal anchors must stay non-zero, or we shuffle rows to fix them (Section 7). No symbol here is used before its home section.
Every entry of a grid needs an address.
a ij
a ij means "the number in row i , column j of matrix A ". The first subscript is the row (counting top to bottom), the second is the column (counting left to right). Both i and j run from 1 up to n .
Figure 2 — The address a ij . A 3 × 3 grid of blue dots each labelled with its address. The yellow arrows show the two counting directions: rows counted downward, columns counted rightward. The red dot marks a 21 — row 2 , column 1 — showing the "row first, column second" rule in action.
In the figure, a 21 (highlighted red) sits in row 2, column 1. This ordering never changes: row first, column second . The parent note writes a ik and u ij and ℓ ij — all of them obey this same rule.
Common mistake The subscripts are NOT
x , y coordinates
In graphing, ( x , y ) means "right then up". A matrix subscript a ij means "down then right". They feel backwards. Point at row 2, then slide to column 1 — that is a 21 .
Draw the line from the top-left corner down to the bottom-right corner. The entries this line passes through — a 11 , a 22 , a 33 , … — are the diagonal .
Definition Diagonal / lower / upper triangular
The diagonal entries are those with equal subscripts: a ii (row number = column number).
A matrix is lower triangular if every entry above the diagonal is zero (all the numbers live on or below the line).
A matrix is upper triangular if every entry below the diagonal is zero (all the numbers live on or above the line).
Figure 3 — Lower vs upper triangular. Left grid: non-zero entries (marked ∗ ) fill the lower-left triangle, zeros sit above the yellow dashed diagonal — lower triangular. Right grid: non-zeros fill the upper-right triangle, zeros sit below the diagonal — upper triangular. The dashed yellow line in each is the diagonal that splits the grid in half.
The figure shows both. The word "triangular" is literal: the non-zero numbers fill a triangle , one half of the grid.
Intuition WHY triangular matrices are the whole point
Solving A x = b is hard because every unknown tangles with every other. But if the grid is triangular, one row has only one unknown — solve it instantly, plug it in, the next row now has only one unknown, and so on. Triangular = "the equations queue up politely." The tool Triangular Systems & Substitution is exactly this cascade.
A x is not "multiply everything by everything". It has a precise recipe.
Definition Matrix times vector
To get entry i of the result: walk along row i of A and along the vector x at the same time, multiply the pairs, and add them up. With n the number of columns (defined in Section 1),
( A x ) i = a i 1 x 1 + a i 2 x 2 + ⋯ + a in x n .
For the 2 × 2 example (n = 2 ):
( 2 4 3 7 ) ( x 1 x 2 ) = ( 2 x 1 + 3 x 2 4 x 1 + 7 x 2 ) .
Intuition WHY this recipe = a system of equations
Setting A x = b means "2 x 1 + 3 x 2 = b 1 AND 4 x 1 + 7 x 2 = b 2 ". So the single tidy symbol A x = b is identical to the messy list of equations. The matrix picture and the equations picture are the same thing wearing different clothes.
Matrix times matrix — for us the product LU of the two half-grids defined in Section 3 — follows the same row-walks-column rule, done for every column of the second matrix. That is why the parent's check LU = A makes sense: multiply the two half-grids back together and you rebuild the original.
Now the two starring symbols of the whole topic.
When you clean up a column, the pivot is the diagonal entry you use as your "anchor" — the number you divide by to knock out everything beneath it. In the finished U , the pivots are exactly the diagonal entries u ii .
Definition The iteration convention
k = 1 , … , n − 1
Elimination happens in stages , one per column. We label the current stage k , and k marches from 1 up to n − 1 (there is nothing below the last pivot, so we stop one short of n ). At stage k we use the pivot sitting in row k , column k to clear every entry beneath it — that is, in rows i = k + 1 , … , n of column k . When we say "the current entry", we mean the value after all earlier stages have already updated it ; to keep this honest we write a ij ( k ) for the value of entry ( i , j ) at the start of stage k , with a ij ( 1 ) = a ij being the original matrix.
m ik
At stage k , to erase the entry in row i (with i > k ), column k , you subtract a certain multiple of row k . That multiple is
m ik = a k k ( k ) a ik ( k ) = the pivot above it the entry we want to kill .
The row update that actually clears it — applied across the whole row j = k , … , n — is
a ij ( k + 1 ) = a ij ( k ) − m ik a k j ( k ) .
This is the single rule that, repeated over all stages k and all rows i > k , drives A down to the upper-triangular U .
Figure 4 — Pivot and multiplier in action. The green dot is the pivot a 11 = 2 ; the red dot below it is the entry a 21 = 4 we want to erase. The yellow arrow points from pivot to target. The formula m 21 = a 21 / a 11 = 4/2 = 2 shows the ratio, and the bottom line shows the row operation ( 4 , 7 ) − 2 ( 2 , 3 ) = ( 0 , 1 ) that zeros the red entry.
Intuition WHY divide? Why
this ratio and not another?
We want rowi minus (something)×rowk to make position ( i , k ) become 0 . That position currently holds a ik ( k ) ; rowk holds a k k ( k ) there. Subtracting m copies leaves a ik ( k ) − m a k k ( k ) . Setting that to zero forces m = a ik ( k ) / a k k ( k ) — division is the only operation that answers "how many pivots fit into the entry I want gone?" That is the whole reason m ik is a fraction.
Worked example The full inductive algorithm on an
n × n matrix
Putting the loop together:
For each stage k = 1 , 2 , … , n − 1 :
the pivot is a k k ( k ) ;
for each row below, i = k + 1 , … , n : compute m ik = a ik ( k ) / a k k ( k ) , store it as ℓ ik , then update the whole row a ij ( k + 1 ) = a ij ( k ) − m ik a k j ( k ) for j = k , … , n .
After the last stage, the remaining grid is U (its diagonal entries u k k = a k k ( k ) are the pivots), and L carries the stored multipliers with 1 's on the diagonal.
The 2 × 2 walk-through below is exactly this loop with n = 2 , so only stage k = 1 runs.
The punchline the parent relies on: these multipliers, written into a grid with 1 's on the diagonal by the rule above, are L . The pivots, sitting on the diagonal of the cleaned-up grid, are the diagonal of U . Nothing extra is computed — you just save what you already did. That saving is Gaussian Elimination with a memory, which is the whole idea of LU.
det A is a single scalar squeezed out of a square matrix (Section 1). Geometrically it is the area-scaling factor of the matrix machine: feed it a unit square, and ∣ det A ∣ is the area of the parallelogram that comes out. If det A = 0 , the machine flattens everything and cannot be undone.
Now that this exists, we can finally state Section 1's condition exactly: plain A = LU (no swaps) works precisely when every leading principal minor — the determinant of the top-left k × k corner of A , for each k = 1 , … , n — is non-zero. That is what keeps every pivot a k k ( k ) away from 0 .
Sometimes the pivot lands on a 0 . You cannot divide by zero, so you swap rows to bring a good pivot up. Recording which rows swapped is the job of P .
Definition Permutation matrix
A permutation matrix P is an identity grid (1 's on the diagonal, 0 's elsewhere) with its rows shuffled. Multiplying P A reorders the rows of A in exactly that shuffle — nothing is scaled, only reshuffled.
That is why pivoting turns A = LU into P A = LU . Full detail lives in Permutation Matrices .
Intuition Beyond zero pivots: partial pivoting and stability
Swapping is not only for an exactly zero pivot. Even a tiny pivot is dangerous: dividing by a number near 0 makes the multiplier m ik = a ik ( k ) / a k k ( k ) enormous, and enormous multipliers magnify the small rounding errors a computer always carries — the answer can come out badly wrong. The standard cure is partial pivoting : before eliminating column k , look down that column at all rows from k downward, find the entry with the largest absolute value , and swap that row up to become the pivot. This keeps every multiplier at size ≤ 1 , so errors never blow up. In practice, LU is always done with partial pivoting, giving P A = LU ; plain A = LU is the ideal case where no swap happened to be needed. When the matrix is symmetric positive-definite, the split simplifies even further into Cholesky Decomposition (no pivoting needed), and the inverse of A can be assembled solve-by-solve as in Matrix Inverse .
Subscript a_ij row then column
Diagonal and triangular shape
Matrix times vector equals equations
Determinant product of pivots
Permutation matrix row swaps
LU decomposition A equals LU
The parent factors A = ( 2 4 3 7 ) (square, n = 2 ). Let us confirm every symbol above lands correctly — this is stage k = 1 of the loop, the only stage since n − 1 = 1 .
Pivot a 11 ( 1 ) = 2 (the anchor, top-left of the diagonal).
Kill a 21 ( 1 ) = 4 : multiplier m 21 = a 11 ( 1 ) a 21 ( 1 ) = 2 4 = 2 .
Update row 2: ( 4 , 7 ) − 2 ⋅ ( 2 , 3 ) = ( 0 , 1 ) , so u 22 = 1 is the second pivot.
U = ( 2 0 3 1 ) (upper triangular, pivots 2 , 1 on the diagonal).
Assemble L by the rule ℓ 11 = ℓ 22 = 1 , ℓ 21 = m 21 = 2 : L = ( 1 2 0 1 ) .
det A = 2 ⋅ 1 = 2 (product of pivots) — matches 2 ⋅ 7 − 3 ⋅ 4 = 2 . ✓
Every symbol earned; nothing borrowed.
Read each line's left side, answer aloud, then reveal.
What does the subscript a ij point to? The entry in row i , column j — row first, column second.
What does n stand for? The common count of rows and columns of a square matrix (n × n ); also the length of x and b .
What are x and b in A x = b ? x is the unknown vector we solve for; b is the known right-hand-side vector — both length n .
Why must A be square for LU? You need one diagonal pivot per column, which requires equal row and column counts (n × n ).
Where do the diagonal entries of a matrix live? On the line from top-left to bottom-right, where row number equals column number (a ii ).
What makes a matrix lower triangular? Every entry above the diagonal is zero.
What does "unit lower triangular" add to that? The diagonal entries are all 1 .
How do you compute entry i of A x ? Walk row i of A against x , multiply matched pairs, sum them.
Why is A x = b the same as a system of equations? Each row of the product spells out one equation exactly.
What range does the stage index k run over? k = 1 , … , n − 1 — one stage per column, stopping one short of n .
What is a pivot? The diagonal anchor entry a k k ( k ) you divide by to eliminate the column below it; the diagonal of U .
What is the multiplier m ik and why a ratio? m ik = a ik ( k ) / a k k ( k ) ; it is the only number that makes rowi − m ik rowk zero out position ( i , k ) .
How are the entries of L assembled? ℓ ii = 1 , ℓ ik = m ik for i > k , and ℓ ik = 0 for i < k .
How do you read det A off the factors (no swaps)? Product of the pivots ∏ i u ii (since det L = 1 ).
How does a row swap change det A ? It multiplies by sign ( P ) = ( − 1 ) # swaps , so det A = sign ( P ) ∏ i u ii .
What does a permutation matrix P do? Shuffles the rows of A (identity with rows swapped), used when a pivot is zero or tiny.
What is partial pivoting and why do it? Swap the row with the largest-magnitude entry into the pivot position, keeping every multiplier ≤ 1 so rounding errors do not blow up.
Gaussian Elimination — the elimination process that spits out pivots and multipliers.
Triangular Systems & Substitution — why triangular grids solve instantly.
Determinants — the product-of-pivots shortcut.
Permutation Matrices — the row-swap bookkeeping P .
Matrix Inverse — assembling A − 1 column by column from L , U .
Cholesky Decomposition — the symmetric positive-definite special case.
LU decomposition — algorithm, applications — the parent topic these foundations feed.