Our factorization procedure divides by pivots. What if a pivot is zero? Sometimes the system has a unique solution, but its equations are in an inconvenient order.
The first row forces p=0 and q=3. But then the bottom-left entry of the product is ℓ⋅0=0, whereas we need it to be 2. There is no LU factorization in this row order.
The system itself is easy to solve: 3y=6 gives y=2, and 2x−y=8 then gives x=5.
Swap the two equations, keeping each right-hand side with its equation:
[20−13][xy]=[86].
Now the matrix is upper triangular, so its LU factorization has L=I2 and U=[20−13].
The theorem does not say that P is unique, or that every invertible matrix factors without reordering. Our first example shows why we may need a row swap.
At each stage, we subtract contributions already accounted for and look for the next nonzero pivot among the remaining rows. If the current row supplies a zero but a later row supplies a nonzero value, we move that row into the next position.
For an invertible matrix, a suitable row reordering always exists. We’ll explain why in Chapter 5, after introducing linear independence. For now, we’ll work out the complete two-by-two argument below.
Once the row ordering is fixed, matching entries forces the first row of U. The nonzero first pivot forces the first column of L. Next, matching entries forces the second row of U, and its nonzero pivot forces the second column of L. Continuing leaves no choices.
The ones on the diagonal of L matter. Without that convention, even A=I2 could be written as (2I2)(21I2) as well as I2I2.
Since A is invertible, ad−bc=−bc=0. Thus both b and c are nonzero. The equation ℓ⋅0=c is impossible, so there is no LU factorization in the original row order.
Swapping the rows gives
PA=[c0db]=L[1001]U[c0db].
Both pivots are nonzero, so substitution works.
For an invertible two-by-two matrix, we now have a complete rule: factor in the original order when a=0; swap the equations first when a=0. Larger matrices can require swaps at later stages too.
A zero pivot by itself does not tell us that a matrix is non-invertible. We first need to ask whether reordering can resolve it. Next, we’ll turn to square matrices that really are non-invertible, and then to systems whose coefficient matrices aren’t square.