The LU and PLU factorizations

The LU factorization

Let F be a field and AFn×n. Given a bFn, recall that the linear system Ax=b can be solved by performing Gaussian elimination (also known as row reduction) on the augmented matrix [Ab] to transform it into an augmented matrix of the form [Uy], where UFn×n is upper triangular and yFn, which represents an equivalent linear system Ux=y. Such a system can then be solved readily by backward substitution. In fact, this process (under certain conditions) amounts to computing an LU factorization of A as LU, where LFn×n is unit lower triangular and UFn×n is upper triangular.

To illustrate this, suppose that F=R and [1512263437244813]A[x1x2x3x4]xA=[7878]bA. Then the variable x1 can be eliminated from the second equation 2x1+6x2+3x3+4x4=8 by multiplying the first equation 1x1+5x2+1x3+2x4=7 by 21 and subtracting the resulting equation from the second. The quotient 21=2 is called a multiplier and the divisor 1 is called a pivot. In other words (ignoring the vector b​ for now), [2634]2[1512]=[0410].

Similarly, x1 can be eliminated from the third and fourth equations, yielding the factorization

[1512263437244813]=[1[1512]+1[08212]2[1512]+1[04210]3[1512]+1[08212]4[1512]+1[01235]]=[1213141][15124108121235]

(where blanks denote zeroes).

The variable x2 can then be eliminated analogously from the new third and fourth equations. For instance,

[0812]2[0410]=[0032].

In view of the previous step, this means that

[3724]3[1512]2[0410]=[0032].

Thus, after the second step of the factorization, we have

[1512263437244813]=[121321431][15124103265].

Finally, an entirely analogous third step completes the LU factorization:

[1512263437244813]A=[1213214321]L[1512410321]U.

In general, we can regard LU factorization as partitioning a matrix AFn×n as A=[αbcD], where αF, bFn1, cFn1, and DF(n1)×(n1). Provided that the pivot α is nonzero, we can eliminate c by using the multipliers cα to write [cD]cα[αb]=[0A] for some AF(n1)×(n1); the matrix A=Dcαb is known as the Schur complement of [α] in A. This yields the factorization A=[1cαI][αbA], which can be recursively continued by computing an LU factorization LU of A. If one exists, then [cD]cα[αb]L[0U]=[00], so A=[1cαL]L[αbU]U is an LU factorization of A.

Existence and uniqueness

Let aij(k) denote the ( i, j)-entry of A after the kth step in the LU factorization. From the example above, it is clear that A will have an LU factorization provided that the pivots a11(0),a22(1),,an1,n1(n2) are nonzero. Moreover, we see after k1 steps that the kth leading principal minor of A is equal to a11(0)a22(1)akk(k1), so A will have an LU factorization if its first n1 leading principal minors are nonzero.

If A is nonsingular, this condition is also necessary because the kth leading principal minor of A must be equal to u11u22ukk. Furthermore, the LU factorization is unique in this case, for if L1U1 and L2U2 are both LU factorizations of A, then L21L1=U2U11 must be simultaneously unit lower triangular and upper triangular, and hence equal to the identity.

Solving linear systems

If the same row operations that were applied to A are applied to b as well, evidently the resulting vector y will satisfy b=Ly (since [Ab] = L[Uy]). Therefore the solutions of Ax=b will indeed be those of Ux=y. Notably, once an LU factorization of A has been computed, it is possible to solve Ax=b for any given bFn by solving Ly=b for y and then Ux=y for x, reusing the computed factors L and U! (The former system can be solved readily by forward substitution and the latter by backward substitution.)

The PLU factorization

It is possible to produce an LU-like factorization for any AFn×n by allowing for row interchanges in addition to the elementary row operation above. The resulting PLU factorization consists of a permutation matrix PFn×n along with matrices L and U as above such that PA=LU (or equivalently, A=PLU​).

As an illustration, consider the matrix [4444112245562444]A. Following one elimination step as before, we arrive at A=[44441111224556112444]=[114111121][44441101111211222].

Since the (2, 2)-entry of the factor on the right is zero, it is impossible to introduce zeroes in the second column using this entry as a pivot. However, by interchanging the second row with a row below it whose entry in the second column is nonzero, we can obtain a nonzero pivot to perform the elimination. 1 Also, note that had such a row not existed, it could only have been because all subdiagonal entries in the second column were zero, in which case we could have immediately continued to the next elimination step!

For example, suppose we wish to use the (4, 2)-entry, 2, as a pivot. We have

{[1122]=14[4444]+[0011][2444]=12[4444]+[0222],

so if P2 is the permutation matrix that interchanges the second and fourth rows, then

P2A=[44441124444556111122]=[112111141][44441122211211011],

from which elimination can proceed as in the LU factorization. Namely,

P2A=[4444112444114556111122]=[112111211401][44441122211011111].

Once again, we see that a row interchange is required. We have

{[4556]=1[4444]+12[0222]+[0001][1122]=14[4444]+0[0222]+[0011],

so if P3 is the permutation matrix that interchanges the third and fourth rows, then

P3P2A=[4444112444111122114556]=[112114011121][44441122211111101].

The product of all the permutation matrices used for row interchanges becomes the permutation matrix P; if no interchange is performed in the kth step, we can regard this as multiplication by Pk=I at that step. For instance, after the final elimination step in our example (which is trivial since the (4, 3)-entry is already zero), P3P2P1PA=[4444112444111122114556]PA=[1121140111201]L[4444112221111111]U.

In general, given a matrix AFn×n, either there exists a permutation matrix P1Fn×n such that P1A is of the form P1A=[αbcD] for some nonzero αF, or the first column of A is zero, in which case P1A is of the form P1A=[αb0D] for any permutation matrix P1Fn×n​. Let c^=cα in the former case and c^=0 in the latter. Then P1A=[1c^I][αbA], where A=Dc^b, and if PA=LU is a PLU factorization of A, then [1P]P1PA=[1Pc^L]L[αbU]U is a PLU factorization of A​.

Solving linear systems

By the same reasoning as above, row-reducing b in the manner that A was reduced results in a vector y satisfying Pb=Ly. Therefore the solutions of Ax=b will be those of Ux=y. Once a PLU factorization of A has been computed, it is possible to solve Ax=b for any given bFn by solving Ly=Pb for y and then Ux=y for x, reusing the computed factors L and U and the permutation represented by P.


  1. In practice, implementations of PLU factorization typically perform a row interchange that maximizes the absolute value of the pivot, regardless of whether it is needed to prevent division by zero. With this convention, all multipliers are at most 1 in absolute value. ↩︎