Lesson Explainer: LU Decomposition: Doolittle’s Method | Nagwa Lesson Explainer: LU Decomposition: Doolittle’s Method | Nagwa

Reward Points

You earn points by engaging in sessions or answering questions. These points will give you a discount next time you pay for a class.

Lesson Explainer: LU Decomposition: Doolittle’s Method Mathematics

Join Nagwa Classes

Attend live Mathematics sessions on Nagwa Classes to learn more about this topic from an expert teacher!

In this explainer, we will learn how to find the LU decomposition (factorization) of a matrix using Doolittle’s method.

Despite all of the elegance and simplicity of the algebraic rules which govern many of the associated operations, there is no escaping the fact that linear algebra is a computationally heavy discipline and that this is especially true for those who are new to the subject. In order to properly understand and appreciate the benefits of linear algebra, it is necessary for a new student to undertake many of the common calculations manually, before these are either streamlined or replaced with more efficient methods. However, there are some operations such as matrix multiplication where there is little room for maneuver in terms of simplifying a calculation and, ultimately, there is no escape from having to perform a large number of arithmetic operations.

Due to the number of computations involved in linear algebra, we are constantly motivated to find better, less burdensome methods for completing calculations. There are few advantages in completing more calculations than is strictly necessary, especially in terms of the time taken and the possibility of introducing mistakes with each superfluous stage of the working. Even in the modern age of computing, where calculations can be completed flawlessly and autonomously at a rate of billions per second, we are still motivated to decrease the number of calculations that are needed, given that there are so few reasons not to!

In linear algebra, one of the most common tricks when working with a matrix is to see if it can be shifted or split up into a form that will be easier for subsequent calculations (especially matrix multiplication, exponentiation, and inversion). In many of these methods, it is often desirable to shift a matrix of interest into specific forms, with one of the most common being the triangular forms. In this explainer, we will show, where possible, how to take a general matrix and split it into two separate triangular matrices that can be combined together with matrix multiplication to obtain the original matrix. Although the process for completing this is actually less complicated than it often appears, it will help us to first clarify several definitions before demonstrating this method. We will begin with the notion of upper and lower-triangular matrices, which are common objects of interest in linear algebra.

Definition: Upper- and Lower-Triangular Matrices

Consider a square matrix 𝐴. If all entries below the diagonal entries are zero, then the matrix is called “upper triangular.” If all entries above the diagonal entries are zero, then the matrix is called “lower triangular.”

We will demonstrate this concept with several examples. Notice that all of the following matrices are upper triangular, because all entries below the (highlighted) diagonal entries are zero: 123034001,2051050200040001,3210304202003310001200003.

As shown in the middle matrix, it is perfectly valid for any of the diagonal entries to be equal to zero. The definition only requires that the entries below the diagonal entries all have a value of zero, and there is no mention of the value of the diagonal entries themselves or of the entries that are above the diagonal entries. Any matrix is not in upper-triangular form if any of the entries below the diagonal are nonzero. Taking the matrices above, we could easily add in some errant entries that would ruin the upper-triangular form: 123034201,2051050200040031,3210304202083311001200003.

Lower-triangular matrices are defined in a very similar way, except we require that all entries above the diagonal entries be zero. For example, all of the following are lower-triangular matrices: 1014,3000280030106127,1000013000042001731025144.

This property can be removed by adding some nonzero entries above the diagonal entries. For example, 1414,3010280030136127,1010013000042001731025144.

The aim of this explainer will be to take a general matrix 𝐴 and to split it into its “LU decomposition,” meaning that 𝐴=LU, where L is a lower-triangular matrix and U is an upper-triangular matrix. We should begin by saying that this will not always be possible and that we may occasionally need the “PLU” decomposition, for which there is a separate explainer. We will continue undaunted by this fact. We will begin to describe the general method that we will use.

As we begin to develop our method for finding the LU decomposition of a matrix, it will be easiest for us to think in terms of elementary row operations, as this is the method that we would normally choose if we were aiming to manipulate the entries of a matrix, either as part of Gauss–Jordan elimination or as one of the many other methods that rely on row operations. More specifically, we will show how each type of row operation can be written in terms of a simple, invertible, lower-triangular matrix, hence allowing a series of row operations to be encoded exactly and in full by an accompanying series of matrices. There are three types of elementary row operations, with the simplest two of the three being the row swap operation 𝑟𝑟. This is the only one of the three types of elementary row operations that we do not cover in this explainer, as it pertains to PLU decomposition rather than LU decomposition. For the other two types of row operations, we will define the equivalent elementary matrix. Please be aware that the literature on linear algebra has never reached a consensus as to how the elementary matrices should be labeled, so we are using our own terminology.

Definition: The Second Type of Elementary Row Operation and the Corresponding Elementary Matrix

Consider a matrix 𝐴 and the second type of elementary row operation 𝑟𝑐𝑟, where 𝑐0, giving the row-equivalent matrix 𝐴. Then, we can define the corresponding “elementary” matrix: 𝐷(𝑐)=1000𝑐0001, which is essentially the identity matrix but with the entry in the 𝑖th row and 𝑖th column being equal to 𝑐 instead of 1. Then, the row-equivalent matrix 𝐴 can be written as the matrix multiplication 𝐴=𝐷(𝑐)𝐴.

This result is simple enough to demonstrate by example. Suppose that we had the square matrix 𝐴=321013125 and that we wished to perform the row operation 𝑟5𝑟 in order to obtain the row-equivalent matrix 𝐴. Then, we would expect to find that 𝐴=32101351025.

Using the definition above, we can construct the corresponding elementary matrix. This will just be a copy of the 3×3 identity matrix but with the diagonal entry in the third row being equal to 5 instead of 1. The matrix is 𝐷(5)=100010005.

From this, we can check that 𝐴=𝐷(5)𝐴=100010005321013125=32101351025 has produced the row-equivalent matrix that we were expecting. Practically speaking, the second type of row operation is not as useful as the third type and we will find ourselves making less use of this type of row operation. However, given that we may choose to use this row operation, we will still explain how to calculate the inverse of 𝐷(𝑐). Fortunately, the result is simple to both state and verify, so we will summarize it in the following theorem without proof.

Theorem: Inverse of the Matrix 𝐷𝑖 (𝑐)

The inverse of the elementary matrix 𝐷(𝑐) is given by the formula 𝐷(𝑐)=𝐷1𝑐.

If we had scaled a row by a constant 𝑐 and wanted to undo this operation, then we would just multiply the same row in the new matrix by the constant 1𝑐, thus returning the original matrix. This rationale is respected by the theorem above and can be demonstrated by example. We can check that the theorem is correct in the case of the example above, by noting that the inverse matrix of 𝐷(5) is the matrix 𝐷(5)=𝐷15. We can then apply this to the row-equivalent matrix 𝐴 to recover the original matrix 𝐴: 𝐷15𝐴=100010001532101351025=321013125=𝐴.

We could equivalently have checked directly that 𝐷15𝐷(5)=𝐷(5)𝐷15=𝐼, where 𝐼 is the 3×3 identity matrix.

To complete the LU decomposition of a matrix, the most important type of row operation is the third type defined by 𝑟𝑟+𝑐𝑟. For example, it is possible to complete the LU decomposition of a matrix without using the second type of row operation that we described above. Generally speaking, however, it would be impossible to achieve this without the third type of row operation. This importance is easy to appreciate, given that the third type of row operation is the one which is used most commonly when completing any process that involves the elementary row operations. For example, there would generally be little hope of completing Gauss–Jordan elimination if we did not have license to use the third type of row operation. With this in mind, we now define the third type of elementary matrix.

Definition: The Third Type of Elementary Row Operation and the Corresponding Elementary Matrix

Consider a matrix 𝐴 and the third type of elementary row operation 𝑟𝑟+𝑐𝑟, giving the row-equivalent matrix 𝐴. Then, we can define the corresponding “elementary” matrix: 𝐸=100001000𝑐100001, which is essentially the identity matrix but with the entry in the 𝑖th row and 𝑗th column being equal to 𝑐 instead of 0. Then, the row-equivalent matrix 𝐴 can be written as the matrix multiplication 𝐴=𝐸(𝑐)𝐴.

We will demonstrate this in relation to the example above, where we had the matrix 𝐴=321013125.

If we wanted to apply the row operation 𝑟𝑟+3𝑟, then we would expect the resulting row-equivalent matrix 𝐴=321956125.

Because of the definition above, we know that we can encode the elementary row operation 𝑟𝑟+3𝑟 by the elementary matrix 𝐸(3). This matrix will be identical to the identity matrix 𝐼, except for an entry in the second row and first column having a value of 3 instead of 0. This matrix therefore has the form 𝐸(3)=100310001.

We can verify that this matrix can be used to recover the row-equivalent matrix 𝐴 by matrix multiplication: 𝐴=𝐸(3)𝐴=100310001321013125=321956125.

With the second type of row operation, we said that it was important to understand both the matrix itself and the corresponding inverse matrix, so that we can complete the LU decomposition. This is also the case of the third type of row operation that we were describing in the definition above. Even though the third type of row operation is more complicated than the second type, the inverse operation is little more difficult to express.

Theorem: Inverse of the Matrix 𝐸𝑖𝑗 (𝑐)

The inverse of the matrix 𝐸(𝑐) is given by the formula 𝐸(𝑐)=𝐸(𝑐).

Suppose that we had taken a matrix and performed the elementary row operation 𝑟𝑟+𝑐𝑟. If we wanted to undo this effect, then we would use the row operation 𝑟𝑟𝑐𝑟 on the new matrix, hence returning the original matrix. This understanding is totally encapsulated by the statement of the theorem above, for which we now provide a check. To test this, we can produce the inverse matrix corresponding to the example above. Since we used 𝐸(3), we have that the inverse matrix is 𝐸(3)=𝐸(3). We can then check that 𝐸(3)𝐴=100310001321956125=321013125=𝐴.

Now that we have discussed the necessary ingredients for LU decomposition, we will both define this concept and then show how it can be achieved. We will do so initially by way of example, wherein we will briefly justify all of the steps that we are taking. Many of the techniques are ostensibly similar to those used in Gauss–Jordan elimination and other related methods. The completion of the LU decomposition focuses on achieving an upper-triangular form, whereas Gauss–Jordan elimination focuses on achieving an echelon form. These two concepts are similar but are not identical, and in fact when attempting to complete the LU decomposition we will have fewer options than we do generally for Gauss–Jordan.

Definition: The LU Decomposition of a Matrix

Consider a matrix 𝐴. Then, the “LU decomposition” requires finding a lower-triangular matrix L and an upper-triangular matrix U such that LU=𝐴. This is sometimes referred to as the “LU factorization” of a matrix.

We will demonstrate this with the simplest possible example of a 2×2 matrix. We take the matrix 𝐴=3914 and task ourselves with finding a lower-triangular matrix L and an upper-triangular matrix U such that 𝐴=LU. Suppose that we begin with the familiar method of first highlighting all of the pivot entries of 𝐴: 𝐴=3914.

After having practiced Gauss–Jordan elimination, our first instinct might be to simplify 𝐴, which in this case would involve removing the factor of 3 that appears in every entry in the top row. To do this, we would use the elementary row operation 𝑟13𝑟, which has the corresponding elementary matrix 𝐷13=13001.

We will also state the inverse of this matrix: 𝐷13=𝐷(3)=3001.

Given that these two matrices are inverses of each other, they must obey the relationship 𝐷13𝐷(3)=𝐼, where 𝐼 is the 2×2 identity matrix. This is certainly the case, which means that we can write this equation in full:

300113001=1001.(1)

It is this statement that allows us to begin finding the LU decomposition of 𝐴. Given that 𝐼𝐴=𝐴 for any matrix 𝐴 of order 2×2, we can write 10013914=3914.

Now the reason for writing this equation is explained by equation (1), which we duly substitute into the equation immediately above, giving 3001130013914=3914.

Matrix multiplication is associative, which means that we can combine the second and third matrices using the operation of matrix multiplication. This gives precisely the desired effect, as the new middle matrix is the same as the original matrix but with the constant factor of 3 now removed from the first row:

30011314=3914.(2)

The leftmost matrix is a lower-triangular matrix, as all of the entries above diagonal entries are zero. In the case of a 2×2 matrix, this leaves only the entry in the top right, which is shown to be zero. Unfortunately, the middle matrix is not yet in upper-triangular form and so we have not yet found our LU decomposition. Now, once again inspecting the pivot entries shows that we can remove the pivot in the second row to turn the middle matrix into an upper-triangular matrix. This is completed with the row operation 𝑟𝑟𝑟. The corresponding elementary matrix is 𝐸(1)=1011, which has the inverse elementary matrix 𝐸(1)=𝐸(1)=1011.

Once again, these two elementary matrices are multiplicative inverses of each other, so we have the relationship 𝐸(1)𝐸(1)=𝐼. Written out in long form, this is

10111011=1001.(3)

We can take equation (2) and insert the identity matrix as shown, without changing the validity of the equation: 300110011314=3914.

Substituting equation (3) then gives 3001101110111314=3914.

We once again rely on the property of matrix multiplication being associative. Given that this is always the case, we can order the calculations in any way we would prefer. In this situation, it is best to order the calculations as shown: 3001101110111314=3914.

Then, completing the two matrix multiplications gives the required decomposition:

30111307=3914.(4)

We have therefore obtained the two matrices LU=3011,=1307,

such that LU=𝐴. It is easily checked that L is a lower-triangular matrix and that U is an upper-triangular matrix and the final confirmation of the result can be completed by checking that equation (4) is true.

The calculation of an LU decomposition, once practiced, would normally be completed without much of the supporting explanation that was given in the above example. Much as elementary row operations can be used to manipulate a matrix into any type of possible decomposition, obtaining an LU decomposition requires that we only ever produce lower-triangular matrices on the leftmost side of our equations. This means that our elementary matrices (and hence our elementary row operations) are chosen accordingly, as it will be counterproductive to use elementary row operations that incur a non-lower-triangular form in the leftmost terms. This is not as challenging as it might seem at first, and the criteria are essentially those described by Doolittle’s algorithm, which we will discuss in more detail later in this explainer.

Example 1: LU Decomposition for a 3 × 3 Matrix

Find the LU decomposition for the matrix 𝐴=183270301.

Answer

We begin by highlighting the pivot entries in the matrix 𝐴, which are the first nonzero entries of each row: 𝐴=183270301.

Our aim will be to move the pivot entries to the right, hence moving closer toward an upper-triangular form for 𝐴. There are infinitely many ways to achieve an upper-triangular form, although we will begin by aiming to remove the pivot which is in the second row. If we were thinking purely in terms of elementary row operations, then we could use 𝑟𝑟2𝑟 to achieve this. Thinking in terms of the corresponding matrix, we would require the elementary matrix (and inverse) 𝐸(2)=100210001,𝐸(2)=𝐸(2)=100210001.

Given that the two matrices above are multiplicative inverses of each other, the matrix multiplication 𝐸(2)𝐸(2) will necessarily return the 3×3 identity matrix. This means that we can multiply on the left-hand side of 𝐴 by this combined expression, without changing 𝐴 overall (since the identity matrix preserves any matrix under matrix multiplication). Thus, we could write 100210001100210001183270301=183270301, which is essentially just the same as writing the equation 𝐴=𝐴. However, once we combine the second and third matrices together by using matrix multiplication, we find that we have actually obtained the desired row-equivalent matrix in the middle matrix:

100210001183096301=183270301.(5)

The leftmost term is a lower-triangular matrix, and the middle matrix is not yet in upper-triangular form, so we still have some work to do. Now suppose that we wished to remove the pivot entry in the third row, to help manipulate the middle matrix toward upper-triangular form. One option would be the row operation 𝑟𝑟3𝑟, which has the equivalent elementary matrices 𝐸(3)=100010301,𝐸(3)=𝐸(3)=100010301.

We can now inject both of these matrices between the left and middle matrices in equation (5). Overall, this has no effect on the validity of the equation because the two inserted matrices are each other’s inverse. We obtain 100210001100010301100010301183096301=183270301.

Because matrix multiplication is associative, we could equally write this as 100210001100010301100010301183096301=183270301.

If we multiply together the first pair of matrices and then multiply together the second pair of matrices, we obtain the alternative form

1002103011830960248=183270301.(6)

The leftmost matrix is still in lower-triangular form, which is necessary for the LU decomposition to be complete. However, we have not quite finished yet because the middle matrix is not in upper-triangular form. We now have many options but, for the sake of neatness, we will choose to simplify both the second and the third rows. For the second row, we can use the row scaling operation 𝑟13𝑟, which has the elementary matrices 𝐷13=1000130001,𝐷13=𝐷(3)=100030001.

Injecting these into equation (6) gives 10021030110003000110001300011830960248=183270301.

By using the same approach as above, we recall that matrix multiplication is associative. Multiplying together the first pair of matrices and then multiplying together the second pair of matrices, we obtain

1002303011830320248=183270301.(7)

A similar trick can be applied to the third row, this time using the row operation 𝑟18𝑟. The corresponding elementary matrices are 𝐷18=1000100018,𝐷18=𝐷(8)=100010008.

By placing these two matrices into equation (7), we find 10023030110001000810001000181830320248=183270301.

By again multiplying together the first pair of matrices and then, separately, the second pair of matrices, we have the equation

100230308183032031=183270301.(8)

The leftmost matrix is still in lower-triangular form, as will be required for the LU decomposition. The middle matrix is very nearly in upper-triangular form and this can be completed with the row operation 𝑟𝑟𝑟. The elementary matrices that we require are 𝐸(1)=100010011,𝐸(1)=𝐸(1)=100010011.

Injecting these into equation (8) gives 100230308100010011100010011183032031=183270301, which then simplifies to give the desired form 100230388183032001=183270301.

We have now achieved exactly what we set out to achieve. Namely, we have written the matrix 𝐴 in the form LU=𝐴, where L is a lower-triangular matrix and U is an upper-triangular matrix. Indeed, we could (and arguably should) check that the above equation holds, which is a simple matter of completing the matrix multiplication.

The main point of understanding before the statement of Doolittle’s algorithm is that, for each elementary symmetric matrix, we are also calculating the corresponding inverse of this matrix. When a matrix is multiplied by its inverse, the result is the identity matrix. Also, when an identity matrix is multiplied by any other matrix, the result is this matrix. Doolittle’s algorithm requires both of these properties as it is normally phrased in a way that is more technical than the way we present the result below.

Theorem: Doolittle’s Method for Calculating the LU Decomposition of a Matrix

Consider a square matrix 𝐴, for which it is possible to find the LU decomposition. Also, suppose that there exist elementary, lower-triangular matrices 𝐹,𝐹,,𝐹 which place 𝐴 into upper-triangular form, as shown: U=𝐹𝐹𝐹𝐹𝐴.

Then, the lower-triangular matrix is constructed as the product of the inverses in the following way: L=𝐹𝐹𝐹𝐹.

It is then the case that LU=𝐴.

There are two key points to this theorem. Firstly, the matrices 𝐹 are lower-triangular, which means that the inverses 𝐹 will also be lower-triangular and so will the product of these matrices. This guarantees that the matrix 𝐿=𝐹𝐹𝐹𝐹 is in lower-triangular form, as needed. The second key point is that this decomposition, if possible, does actually achieve the matrix 𝐴. This is a simple matter of checking that

𝐴==𝐹𝐹𝐹𝐹(𝐹𝐹𝐹𝐹𝐴).LU(9)

The most useful property in this situation is that matrix multiplication is associative, meaning that we can bracket the terms in any order that we would find to be most helpful. In this case, we will pair together the matrices, working from the central point outward. Given that 𝐹 is the inverse of 𝐹, we would find that 𝐹𝐹=𝐼, the 𝑛×𝑛 identity matrix. This allows equation (9) to be written in the following way: 𝐴==𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐴=𝐹𝐹𝐹𝐼𝐹𝐹𝐹𝐴=𝐹𝐹𝐹𝐹𝐹𝐹𝐴,LU where the final line has been achieved by recalling that 𝐼𝑀=𝑀𝐼=𝑀 for any matrix 𝑀. It is now clear that because every elementary matrix will become paired with its own, which will then return the identity matrix, the next step follows exactly the same pattern: 𝐴=𝐹𝐹𝐹𝐹𝐹𝐹𝐴=𝐹𝐹𝐼𝐹𝐹𝐴=𝐹𝐹𝐹𝐹𝐴.

Continuing to pair up these matrices until the final pair gives 𝐴=𝐹𝐹𝐴=𝐼𝐴=𝐴.

It is now clear why Doolittle’s algorithm works. The only reason why this approach would not work would be if one of the elementary matrices 𝐹 was not lower triangular. If it is not possible to create the LU decomposition without the use of non-lower-triangular matrices, then a minor adjustment is needed, which is referred to as the PLU decomposition, wherein non-lower-triangular matrices of a certain type are temporarily permitted in the calculations. For the remainder of this explainer, we will give examples where it is possible to find the LU decomposition, with the PLU decomposition being treated in a separate explainer.

Example 2: LU Decomposition for a 3 × 3 Matrix

Find the LU decomposition for the matrix 𝐴=102411323.

Answer

We will begin immediately by highlighting the pivot entries of 𝐴, as this will help us guide the matrix into upper-triangular form by borrowing the principles from Gauss–Jordan elimination. We have 𝐴=102411323.

We need to remove both of the pivots in the second and third rows, using elementary row operations to replace these entries with zeroes. A good first step would be the elementary row operation 𝑟𝑟+4𝑟, which has the corresponding elementary matrices: 𝐸(4)=100410001,𝐸(4)=𝐸(4)=100410001.

Since these matrices are inverses of each other, their product will by the 3×3 identity matrix 𝐼. Introducing the product of the matrices 𝐸(4)𝐸(4) will therefore have no effect. Applying this to the trivial equation 𝐴=𝐴 gives 100410001100410001102411323=102411323.

Multiplying together the second and third matrices returns a lower-triangular matrix for the first matrix, as well as the second matrix being of the desired form, with the pivot in the second row no longer appearing in the first column:

100410001102019323=102411323.(10)

Much as the leftmost matrix is in lower-triangular form, the middle matrix is not yet in upper-triangular form. We can move closer to this by removing the pivot in the third row with the row operation 𝑟𝑟3𝑟. This has the corresponding elementary matrices 𝐸(3)=100010301,𝐸(3)=𝐸(3)=100010301.

As before, we place these matrices between the first and second matrices, this time of equation (10), which gives 100410001100010301100010301102019323=102411323.

By multiplying together the first pair of matrices and then the second pair of matrices, we obtain a new decomposition:

100410301102019023=102411323.(11)

The first matrix is still in lower-triangular form, as we will need for the completion of the LU decomposition. However, the middle matrix is still one row operation away from being placed in upper-triangular form. The final row operation that we will need to apply is 𝑟𝑟2𝑟, which gives the associated elementary matrices 𝐸(2)=100010021,𝐸(2)=𝐸(2)=100010021.

These matrices are injected into equation (11), giving 100410301100010021100010021102019023=102411323.

Finally, we multiply together the first pair of matrices and the second pair of matrices, giving the desired form: 1004103211020190021=102411323

We therefore have the following triangular matrices: LU=100410321,=1020190021, such that 𝐴=LU.

As ever with linear algebra, once a technique has been mastered for a matrix of a particular order, it is normally little extra conceptual effort to apply the same approach to matrices with different orders. This will again show to be the case with the application of Doolittle’s algorithm to a matrix with order 4×4. Much as the calculations for a 4×4 matrix are more numerous, the overall method is no more difficult than the previous examples, relying on exactly the same principles to decompose the matrix into LU form.

Example 3: LU Decomposition for a 4 × 4 Matrix

Find the LU decomposition for the matrix 𝐴=1011020212203211.

Answer

The initial step is to highlight the pivot entries of each row, as shown: 𝐴=1011020212203211.

The pivot in the second row is already in the correct position, given that we are aiming to turn 𝐴 into a row-equivalent, upper-triangular matrix. We should instead focus on removing the pivot entries in the third and fourth rows. The pivot in the third row can be removed with the row operation 𝑟𝑟𝑟, which has the corresponding elementary matrices 𝐸(1)=1000010010100001,𝐸(1)=𝐸(1)=1000010010100001.

Given that the product of these matrices is just the identity matrix 𝐼, we can introduce them to the trivial equation 𝐴=𝐴 without changing its validity. Thus, we obtain 100001001010000110000100101000011011020212203211=1011020212203211.

Multiplying together the second and third matrices gives an equation where the middle matrix no longer has a pivot in the third row, as was our intention:

10000100101000011011020202113211=1011020212203211.(12)

Note that the first matrix is in lower-triangular form but the middle matrix is not yet in upper-triangular form, which means that there is more work to do. Our next target will be the pivot in the fourth row, which can be removed with the row operation 𝑟𝑟3𝑟. The corresponding elementary matrices are 𝐸(3)=1000010000103001,𝐸(3)=𝐸(3)=1000010000103001 and these can be injected between the first and second matrices of equation (12) without affecting the validity. The result is 1000010010100001100001000010300110000100001030011011020202113211=1011020212203211.

Using the associativity of matrix multiplication, we take the product of the first pair of matrices and then separately take the product of the second pair of matrices, giving

10000100101030011011020202110244=1011020212203211.(13)

The first matrix is still in lower-triangular form because it was created by taking the product of lower-triangular matrices. The middle matrix is not yet in upper-triangular form, meaning that the LU decomposition has not yet been found. To manipulate the middle matrix into upper-triangular form, we at least need to remove the pivots in the third and fourth rows. The pivot in the third row can be removed with the row operation 𝑟𝑟𝑟. The elementary matrices are 𝐸(1)=1000010001100001,𝐸(1)=𝐸(1)=1000010001100001 and these can be sandwiched in between the two matrices on the left-hand side of equation (13), giving 1000010010103001100001000110000110000100011000011011020202110244=1011020212203211.

Multiplying out these matrices in the usual way gives

10000100111030011011020200130244=1011020212203211.(14)

The first matrix remains in lower-triangular form and the middle matrix is closer to the upper-triangular form that we require. We move further toward our target with the row operation 𝑟𝑟𝑟, which will remove the pivot in the fourth row. The elementary matrices are 𝐸(1)=1000010000100101,𝐸(1)=𝐸(1)=1000010000100101.

These are inserted into equation (14) as shown: 1000010011103001100001000010010110000100001001011011020200130244=1011020212203211.

Completing both sets of matrix multiplications shows that we are very close to our desired LU decomposition:

10000100111031011011020200130046=1011020212203211.(15)

There is now one final step that we can perform in order to transform the middle matrix into upper-triangular form. This is achieved by removing the pivot in the fourth row with the row operation 𝑟𝑟+4𝑟, for which the elementary matrices are as follows: 𝐸(4)=1000010000100041,𝐸(4)=𝐸(4)=1000010000100041.

Injecting these two matrices into equation (15) gives the penultimate equation: 1000010011103101100001000010004110000100001000411011020200130046=1011020212203211.

The final expression is therefore 100001001110314110110202001300018=1011020212203211.

To be explicit, we have obtained two matrices L and U such that 𝐴=LU, where LU=1000010011103141,=10110202001300018.

The advantages of the LU decomposition are both conceptual and computational. If a matrix 𝐴 can be written in the form 𝐴=LU, then we are essentially able to think of this matrix as two different matrices, both of which are triangular. Triangular matrices are often easier to work with, especially when trying to understand the determinant of a square matrix. If a square matrix 𝐴 is in either of the two triangular forms, then the determinant of this matrix is the product of the diagonal entries. Suppose that we had the a square matrix 𝐴 with order 𝑛×𝑛, having the form 𝐴=𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎.

Ordinarily, finding the determinant of 𝐴 might be a computationally expensive process, which we would rather avoid if an alternative method was available. Let us further suppose that it is possible to achieve an LU decomposition for 𝐴, meaning that we can write 𝐴=LU, where L and U are, respectively, the lower and triangular matrices: LU=𝑙00𝑙𝑙0𝑙𝑙𝑙,=𝑢𝑢𝑢0𝑢𝑢00𝑢.

Due to the fact that L and U are triangular matrices, we can calculate their determinants as the products of the diagonal entries. Therefore, ||=𝑙𝑙𝑙,||=𝑢𝑢𝑢.LU

One of the key properties of the determinant is that it is multiplicative, meaning that if 𝐴=𝐵𝐶 then |𝐴|=|𝐵||𝐶|. The purpose of the above representations is now revealed: we can use the multiplicative property of the determinant on the LU decomposition 𝐴=LU, giving the final result |𝐴|=||||=𝑙𝑙𝑙𝑢𝑢𝑢.LU

Therefore, if the LU decomposition of 𝐴 is either known or easily obtainable, the determinant |𝐴| can be calculated in a way that is essentially trivial.

Key Points

  • The LU decomposition of a matrix is not always possible, sometimes requiring the PLU decomposition instead.
  • The second type of elementary row operation 𝑟𝑐𝑟, where 𝑐0, can alternatively be represented by the elementary matrix 𝐷(𝑐). This matrix is the same as the corresponding identity matrix, except for the value of 𝑐 in the 𝑖th diagonal entry.
  • The third type of elementary row operation 𝑟𝑟+𝑐𝑟 can alternatively be represented by the elementary matrix 𝐸(𝑐). This matrix is the same as the corresponding identity matrix, except for the value of 𝑐 in the 𝑖th row and 𝑗th column.
  • All elementary matrices act on the left-hand side when being used for matrix multiplication.
  • All elementary matrices have a multiplicative inverse. For the second type of elementary matrix, we have 𝐷(𝑐)=𝐷1𝑐 and for the third type we have 𝐸(𝑐)=𝐸(𝑐).
  • A series of elementary row operations can be entirely encoded by the corresponding elementary matrices, multiplied together in the correct order.
  • By systematically inserting appropriate pairs of elementary matrices and their inverses, we can complete Doolittle’s algorithm to find the LU decomposition of a matrix (if this is possible).

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy