Linear Equations

William Ford , in Numerical Linear Algebra with Applications, 2015

2.3.1 Upper-Triangular Form

In upper-triangular form, a simple procedure known as back substitution determines the solution. Since the linear algebraic systems corresponding to the original and final augmented matrix have the same solution, the solution to the upper-triangular system

c 11 c 12 c 1 n 0 c 22 c 2 n 0 c n 1 , n 1 c n 1 , n 0 0 c n b 1 b 2 b n 1 b n

begins with

x n = b n c nn

followed by

x n 1 = b n 1 c n 1 , n x n c n 1 , n 1 .

In general,

x i = b i j = i + 1 n c ij x j c ii , i = n 1 , n 2 , , 1 .

We now formally describe the Gaussian elimination procedure. Start with matrix A and produce matrix B in upper-triangular form which is row-equivalent to A. If A is the augmented matrix of a system of linear equations, then applying back substitution to B determines the solution to the system. It is also possible that there is no solution to the system, and the row-reduction process will make this evident.

Begin at element a 11. If a 11  =   0, exchange rows so a 11    0. Now make all the elements below a 11 zero by subtracting a multiple of row 1 from row i, 2   i  n. The multiplier used for row i is

a i 1 a 11 .

The matrix is now in this form

a 11 a 12 a 1 n 0 a 22 a 2 n 0 a n 2 a nn b 1 b 2 b n .

Now perform the same process of elimination by using a 22 and multipliers a i 2 / a 22 , making a row exchange if necessary, so that all the elements below a 22 are 0,

a 11 a 12 a 1 n 0 a 22 a 2 n 0 a 33 a 3 n 0 0 a 43 a 4 n 0 0 a n 3 a nn b 1 b 2 b 3 b 4 b n

Repeat this process until the matrix is in upper-triangular form, and then execute back substitution to compute the solution.

Example 2.4

Solve the system

x 1 + x 2 x 3 = 1 , 2 x 1 + x 2 + x 3 = 0 , x 1 2 x 2 + 3 x 3 = 2 .

Row reduce the augmented matrix to upper-triangular form.

1 1 1 2 1 1 1 2 3 1 0 2 R 2 = R 2 2 R 1 1 1 1 0 1 3 1 2 3 1 2 2 1 1 1 0 1 3 1 2 3 1 2 2 R 3 = R 3 1 R 1 1 1 1 0 1 3 1 2 2 1 2 3 1 1 1 0 1 3 1 2 3 1 2 2 R 3 = R 3 1 R 2 1 1 1 0 1 3 0 0 2 1 2 5

Execute back substitution.

1 x 3 = 5 , x 3 = 5 , x 2 + 3 5 = 2 , x 2 = 13 , x 1 + 1 13 5 = 1 , x 1 = 9 .

Final solution: x 1  =   9, x 2  =     13, x 3  =     5

When computing a solution "by hand," it is a good idea to verify that the solution is correct.

9 + 13 5 = 1 , 2 9 + 13 + 5 = 0 , 9 2 13 + 3 5 = 2 .

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123944351000028

The inverse

Richard Bronson , Gabriel B. Costa , in Matrix Methods (Fourth Edition), 2021

3.5 LU decomposition

Matrix inversion of elementary matrices (see Section 3.1) can be combined with the third elementary row operation (see Section 2.3) to generate a good numerical technique for solving simultaneous equations. It rests on being able to decompose a nonsingular square matrix A into the product of lower triangular matrix L with an upper triangular matrix U. Generally, there are many such factorizations. If, however, we add the additional condition that all diagonal elements of L be unity, then the decomposition, when it exists, is unique, and we may write

(7) A = L U

with

L = [ 1 0 0 0 l 21 1 0 0 l 31 l 32 1 0 l n 1 l n 2 l n 3 1 ]

and

U = [ u 11 u 12 u 13 u 1 n 0 u 22 u 23 u 2 n 0 0 u 33 u 3 n 0 0 0 u n n ] .

To decompose A into from (7), we first reduce A to upper triangular form using just the third elementary row operation: namely, add to one row of a matrix a scalar times another row of that same matrix. This is completely analogous to transforming a matrix to row-reduced form, except that we no longer use the first two elementary row operations. We do not interchange rows and we do not multiply a row by a nonzero constant. Consequently, we no longer require the first nonzero element of each nonzero row to be unity, and if any of the pivots are zero—which in the row-reduction scheme would require a row interchange operation—then the decomposition scheme we seek cannot be done.

Example 1

Use the third elementary row operation to transform the matrix

A = [ 2 1 3 4 2 1 6 1 2 ]

into upper triangular form.

Solution

A = [ 2 1 3 4 2 1 6 1 2 ] [ 2 1 3 0 4 5 6 1 2 ] { by adding to the second row ( 2 ) times the first row [ 2 1 3 0 4 5 0 4 11 ] { by adding to the third row ( 3 ) times the first row [ 2 1 3 0 4 5 0 0 6 ] . { by adding to the third row ( 1 ) times the second row

If a square matrix A can be reduced to upper triangular form U by a sequence of elementary row operations of the third type, then there exists a sequence of elementary matrices E 21, E 31, E 41, , E n, n−1 such that

(8) ( E n 1 , n E 41 E 31 E 21 ) A = U ,

where E 21 denotes the elementary matrix that places a zero in the 2−1 position, E 31 denotes the elementary matrix that places a zero in the 3−1 position, E 41 denotes the elementary matrix that places a zero in the 4−1 position, and so on. Since elementary matrices have inverses, we can write (8) as

(9) A = ( E 21 1 E 31 1 E 41 1 E n , n 1 1 ) U .

Each elementary matrix in (8) is lower triangular. It follows from Property 7 of Section 3.4 that each of the inverses in (9) are lower triangular and then from Theorem 1 of Section 1.4 that the product of these lower triangular matrices is itself lower triangular. Setting

L = E 21 1 E 31 1 E 41 1 E n , n 1 1 ,

we see that (9) is identical to (7), and we have the decomposition we seek.

Example 2

Construct an LU decomposition for the matrix given in Example 1.

Solution The elementary matrices associated with the elementary row operations described in Example 1 are

E 21 = [ 1 0 0 2 1 0 0 0 1 ] , E 31 = [ 1 0 0 0 1 0 3 0 1 ] , and E 42 = [ 1 0 0 0 1 0 0 1 1 ] ,

with inverses given respectively by

E 21 1 = [ 1 0 0 2 1 0 0 0 1 ] , E 31 1 = [ 1 0 0 0 1 0 3 0 1 ] , and E 42 1 = [ 1 0 0 0 1 0 0 1 1 ] .

Then,

[ 2 1 3 4 2 1 6 1 2 ] = [ 1 0 0 2 1 0 0 0 1 ] [ 1 0 0 0 1 0 3 0 1 ] [ 1 0 0 0 1 0 0 1 1 ] [ 2 1 3 0 4 5 0 0 6 ]

or, upon multiplying together the inverses of the elementary matrices,

[ 2 1 3 4 2 1 6 1 2 ] = [ 1 0 0 2 1 0 3 1 1 ] [ 2 1 3 0 4 5 0 0 6 ] .

Example 2 suggests an important simplification of the decomposition process. Note the elements in L below the main diagonal are the negatives of the scalars used in the elementary row operations to reduce the original matrix to upper triangular form! This is no coincidence. In general

Observation 1

If an elementary row operation is used to put a zero in the i−j position of A(i  > j) by adding to row i a scalar k times row j, then the i−j element of L in the LU decomposition of A is −k.

We summarize the decomposition process as follows: Use only the third elementary row operation to transform a given square matrix A to upper triangular form. If this is not possible, because of a zero pivot, then stop; otherwise, the LU decomposition is found by defining the resulting upper triangular matrix as U and constructing the lower triangular matrix L utilizing Observation 1.

Example 3

Construct an LU decomposition for the matrix

A = [ 2 1 2 3 6 2 4 8 1 1 0 4 0 1 3 4 ] .

Solution Transforming A to upper triangular form, we get

[ 2 1 2 3 6 2 4 8 1 1 0 4 0 1 3 4 ] [ 2 1 2 3 0 1 2 1 1 1 0 4 0 1 3 4 ] { by adding to the second row ( 3 ) times the first row [ 2 1 2 3 0 1 2 1 0 3 2 1 5 2 0 1 3 4 ] { by adding to the third row ( 1 2 ) times the first row [ 2 1 2 3 0 1 2 1 0 0 2 4 0 1 3 4 ] { by adding to the third row ( 3 2 ) times the second row [ 2 1 2 3 0 1 2 1 0 0 2 4 0 0 5 5 ] { by adding to the fourth row ( 1 ) times the second row [ 2 1 2 3 0 1 2 1 0 0 2 4 0 0 0 5 ] . { by adding to the fourth row ( 5 2 ) times the third row

We now have an upper triangular matrix U. To get the lower triangular matrix L in the decomposition, we note that we used the scalar −3 to place a zero in the 2−1 position, so its negative −(−3)   =   3 goes into the 2−1 position of L. We used the scalar 1 2 to place a zero in the 3−1 position in the second step of the above triangularization process, so its negative, 1 2 , becomes the 3−1 element in L; we used the scalar 5 2 to place a zero in the 4−3 position during the last step of the triangularization process, so its negative, 5 2, becomes the 4−3 element in L. Continuing in this manner, we generate the decomposition

[ 2 1 2 3 6 2 4 8 1 1 0 4 0 1 3 4 ] = [ 1 0 0 0 3 1 0 0 1 2 3 2 1 0 0 1 5 2 1 ] [ 2 1 2 3 0 1 2 1 0 0 2 4 0 0 0 5 ] .

LU decompositions, when they exist, can be used to solve systems of simultaneous linear equations. If a square matrix A can be factored into A  = LU, then the system of equations Ax  = b can be written as L(Ux)   = b. To find x, we first solve the system

(10) L y = b

for y, and then, once y is determined, we solve the system

(11) U x = y

for x. Both systems (10) and (11) are easy to solve, the first by forward substitution and the second by backward substitution.

Example 4

Solve the system of equations

2 x y + 3 z = 4 x + 2 y + z = 6 x y + 2 z = 9 , 9 , 12.

Solution This system has the matrix form

[ 2 1 3 4 2 1 6 1 2 ] [ x y z ] = [ 9 9 12 ] .

The LU decomposition for the coefficient matrix A is given in Example 2. If we define the components of y by α, β, and γ, respectively, the matrix system Ly   =   b is

[ 1 0 0 2 1 0 3 1 1 ] [ α β γ ] = [ 9 9 12 ] ,

which is equivalent to the system of equations

α 2 α + β 3 α β + γ = = = 9 , 9 , 12.

Solving this system from top to bottom, we get α  =   9, β  =   −9, and γ  =   30. Consequently, the matrix system Ux  = y is

[ 2 1 3 0 4 5 0 0 6 ] [ x y z ] = [ 9 9 30 ] .

which is equivalent to the system of equations

2 x y + 3 z = 4 y 5 z = 6 z = 9 , 9 , 30.

Solving this system from bottom to top, we obtain the final solution x  =   −1, y  =   4, and z  =   5. ■

Example 5

Solve the system

2 a + b + 2 c + 3 d = 5 , 6 a + 2 b + 4 c + 8 d = 8 , a b + 4 d = 4 , b 3 c 4 d = 3.

Solution The matrix representation for this system has as its coefficient matrix the matrix A of Example 3. Define

y = [ α , β , γ , δ ] T .

Then, using the decomposition determined in Example 3, we can write the matrix system Ly  = b as the system of equations

α = 5 , 3 α + β = 8 , 1 2 α + 3 2 β + γ = 4 , β 5 2 γ + δ = 3 ,

which has as its solution α  =   5, β  =   −7, γ  =   4, and δ  =   0. Thus, the matrix system Ux  = y is equivalent to the system of equations

2 a + b + 2 c + 3 d b 2 c d 2 c + 4 d 5 d = = = = 5 , 7 , 4 , 0.

Solving this set from bottom to top, we calculate the final solution a  =   −1, b  = 3, c  =   2, and d  =   0. ■

LU decomposition and Gaussian elimination are equally efficient for solving Ax  = b, when the decomposition exists. LU decomposition is superior when Ax  = b must be solved repeatedly for different values of b but the same A, because once the factorization of A is determined it can be used with all b. (See Problems 17 and 18.) A disadvantage of LU decomposition is that it does not exist for all nonsingular matrices, in particular whenever a pivot is zero. Fortunately, this occurs rarely and when it does the difficulty usually overcome by simply rearranging the order of the equations. (See Problems 19 and 20.)

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780128184196000034

Determinants and Eigenvalues

Stephen Andrilli , David Hecker , in Elementary Linear Algebra (Fourth Edition), 2010

Calculating the Determinant by Row Reduction

We will now illustrate how to use row operations to calculate the determinant of a given matrix A by finding an upper triangular matrix B that is row equivalent to A.

Example 4

Let

A = [ 0 14 8 1 3 2 2 0 6 ] .

We row reduce A to upper triangular form, as follows, keeping track of the effect on the determinant at each step:

A = [ 0 14 8 1 3 2 2 0 6 ]

( III ) : 1 2 B 1 = [ 1 3 2 0 14 8 2 0 6 ] ( | B 1 | = | A | )

( II ) : 3 2 1 + 3 B 2 = [ 1 3 2 0 14 8 0 6 10 ] ( | B 2 | = | B 1 | = | A | )

( I ) : 2 1 14 2 B 3 = [ 1 3 2 0 1 4 7 0 6 10 ] ( | B 3 | = 1 14 | B 2 | = + 1 14 | A | )

Because the last matrix B is in upper triangular form, we stop. (Notice that we do not target the entries above the main diagonal, as in reduced row echelon form.) From Theorem 3.2, | B | = ( 1 ) ( 1 ) ( 46 7 ) = 46 7 . Since | B | = + 1 14 | A | , we see that | A | = 14 | B | = 14 ( 46 7 ) = 92 .

A more convenient method of calculating |A| is to create a variable P (for "product") with initial value 1, and update P appropriately as each row operation is performed. That is, we replace the current value of P by

{ P × c for type (I) row operations P × ( 1 ) for type (III) row operations .

Of course, row operations of type (II) do not affect the determinant. Then, using the final value of P, we can solve for |A| using |B| = P|A|, where B is the upper triangular result of the row reduction process. This method is illustrated in the next example.

Example 5

Let us redo the calculation for |A| in Example 4. We create a variable P and initialize P to 1. Listed below are the row operations used in that example to convert A into upper triangular form B, with | B | = 46 7 . After each operation, we update the value of P accordingly.

Row Operation Effect P
( III ) : 1 2 Multiply P by −1 −1
( II ) : 3 2 1 + 3 No change −1
( I ) : 2 1 14 2 Multiply P by 1 14 1 14
( II ) : 3 6 2 + 3 No change 1 14

Then |A| equals the reciprocal of the final value of P times |B| that is, | A | = ( 1 / P ) | B | = 14 × 46 7 = 92 .

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123747518000226

Conditioning of Problems and Stability of Algorithms

William Ford , in Numerical Linear Algebra with Applications, 2015

Reasons Why the Study of Numerical Linear Algebra Is Necessary

Floating point roundoff and truncation error cause many problems. We have learned how to perform Gaussian elimination in order to row reduce a matrix to upper-triangular form. Unfortunately, if the pivot element is small, this can lead to serious errors in the solution. We will solve this problem in Chapter 11 by using partial pivoting. Sometimes an algorithm is simply far too slow, and Cramer's Rule is an excellent example. It is useful for theoretical purposes but, as a method of solving a linear system, should not be used for systems greater than 2   ×   2. Solving Ax  = b by finding A   1 and then computing x  = A   1 b is a poor approach. If the solution to a single system is required, one step of Gaussian elimination, properly performed, requires far fewer flops and results in less roundoff error. Even if the solution is required for many right-hand sides, we will show in Chapter 11 that first factoring A into a product of a lower- and an upper-triangular matrix and then performing forward and back substitution is much more effective. A classical mistake is to compute eigenvalues by finding the roots of the characteristic polynomial. Polynomial root finding can be very sensitive to roundoff error and give extraordinarily poor results. There are excellent algorithms for computing eigenvalues that we will study in Chapters 18 and 19. Singular values should not be found by computing the eigenvalues of A T A. There are excellent algorithms for that purpose that are not subject to as much roundoff error. Lastly, if m     n a theoretical linear algebra course deals with the system using a reduction to what is called reduced row echelon form. This will tell you whether the system has infinitely many solutions or no solution. These types of systems occur in least-squares problems, and we want a single meaningful solution. We will find one by requiring that x be such that ‖b  Ax2 is minimum.

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123944351000107

Matrix Representation of Linear Algebraic Equations

Stormy Attaway , in Matlab (Second Edition), 2012

Gauss elimination

The Gauss elimination method consists of:

creating the augmented matrix [A|b]

applying EROs to this augmented matrix to get an upper triangular form (this is called forward elimination )

back substitution to solve

For example, for a 2 × 2 system, the augmented matrix would be:

[ a 11 a 12 b 1 a 21 a 22 b 2 ]

Then, elementary row operations are applied to get the augmented matrix into an upper triangular form (i.e., the square part of the matrix on the left is in upper triangular form):

[ a 11 a 12 b 1 0 a 22 b 2 ]

So, the goal is simply to replace a 21 with 0. Here, the primes indicate that the values (may) have been changed.

Putting this back into the equation form yields

[ a 11 a 12 0 a 22 ] [ x 1 x 2 ] = [ b 1 b 2 ]

Performing this matrix multiplication for each row results in:

a′11 x1 + a′12 x2 = b′1

a′22 x2 = b′2

So, the solution is

x2 = b′2 / a′22

x1 = (b′1 − a′12 x2) / a′11

Similarly, for a 3 × 3 system, the augmented matrix is reduced to upper triangular form:

[ a 11 a 12 a 13 b 1 a 21 a 22 a 23 b 2 a 31 a 32 a 33 b 3 ] [ a 11 a 12 a 13 b 1 0 a 22 a 23 b 2 0 0 a 33 b 3 ]

(This will be done systematically by first getting a 0 in the a 21 position, then a 31, and finally a 32.) Then, the solution will be:

x3 = b3′ / a33

x2 = (b2′ − a23′x3) / a22

x1 = (b1′ − a13x3 − a12′x2) / a11

Note that we find the last unknown, x3, first, then the second unknown, and then the first unknown. This is why it is called back substitution.

As an example, consider the following 2 × 2 system of equations:

x1 + 2x2 = 2

2x1 + 2x2 = 6

As a matrix equation Ax = b, this is:

[ 1 2 2 2 ] [ x 1 x 2 ] = [ 2 6 ]

The first step is to augment the coefficient matrix A with b to get an augmented matrix [A|b]:

[ 1 2 2 2 2 6 ]

For forward elimination, we want to get a 0 in the a 21 position. To accomplish this, we can modify the second line in the matrix by subtracting from it 2 * the first row.

The way we would write this ERO follows:

[ 1 2 2 2 2 6 ] r 2 2 r 1 r 2 [ 1 2 2 0 2 2 ]

Now, putting it back in matrix equation form:

[ 1 2 0 2 ] [ x 1 x 2 ] = [ 2 2 ]

says that the second equation is now −2x2 = 2, so x2 = −1. Plugging into the first equation,

x 1 + 2 ( - 1 ) = 2 , so x 1 = 4

This is back substitution.

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123850812000120

Vectors and Matrices

Frank E. Harris , in Mathematics for Physical Science and Engineering, 2014

Exercises

For each of the following equation sets:

(a)

Compute the determinant of the coefficients, using Eq. (4.61).

(b)

Row-reduce the coefficient matrix to upper triangular form and either obtain the most general solution to the equations or explain why no solution exists.

(c)

Confirm that the existence and/or uniqueness of the solutions you found in part (b) correspond to the zero (or nonzero) value you found for the determinant.

4.6.1

x - y + 2 z = 5 , 2 x + z = 3 , x + 3 y - z = - 6 .

4.6.2

2 x + 4 y + 3 z = 4 , 3 x + y + 2 z = 3 , 4 x - 2 y + z = 2 .

4.6.3

2 x + 4 y + 3 z = 2 , 3 x + y + 2 z = 1 , 4 x - 2 y + z = - 1 .

4.6.4

x - y + 2 z = 0 , 2 x + z = 0 , x + 3 y - z = 0 .

4.6.5

6 x + 2 3 y + 3 2 z = 0 , 2 x + 2 y + 6 z = 0 , ( 1 / 2 ) x + y + 1.5 z = 0 .

4.6.6

6 x + 2 3 y + 3 2 z = 3 , 2 x + 2 y + 6 z = 2 , ( 1 / 2 ) x + y + 1.5 z = 1 .

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780128010006000043

Determinants and Eigenvalues

Stephen Andrilli , David Hecker , in Elementary Linear Algebra (Fifth Edition), 2016

Techniques for Finding the Determinant of an n × n Matrix A

2×2 case: A = a 11 a 22 a 12 a 21 (Sections 2.4 and 3.1).

3×3 case: Basketweaving (Section 3.1).

Row reduction: Row reduce A to an upper triangular form matrix B, keeping track of the effect of each row operation on the determinant using a variable P. Then | A | = ( 1 P ) | B | , using the final value of P. Advantages: easily computerized; relatively efficient (Section 3.2).

Cofactor expansion: Multiply each element along any row or column of A by its cofactor and sum the results. Advantage: useful for matrices with many zero entries. Disadvantage: not as fast as row reduction (Sections 3.1 and 3.3).

Also remember that A = 0 if A is row equivalent to a matrix with a row or column of zeroes, or with two identical rows, or with two identical columns.

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780128008539000037

Gaussian Elimination and the LU Decomposition

William Ford , in Numerical Linear Algebra with Applications, 2015

In Chapter 2, we presented the process of solving a nonsingular linear system Ax = b using Gaussian elimination. We formed the augmented matrix A |b and applied the elementary row operations

1.

Multiplying a row by a scalar.

2.

Subtracting a multiple of one row from another

3.

Exchanging two rows

to reduce A to upper-triangular form. Following this step, back substitution computed the solution. In many applications where linear systems appear, one needs to solve Ax = b for many different vectors b. For instance, suppose a truss must be analyzed under several different loads. The matrix remains the same, but the right-hand side changes with each new load. Most of the work in Gaussian elimination is applying row operations to arrive at the upper-triangular matrix. If we need to solve several different systems with the same A, then we would like to avoid repeating the steps of Gaussian elimination on A for every different b. This can be accomplished by the LU decomposition, which in effect records the steps of Gaussian elimination.

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123944351000119

Integer Discrete Cosine/Sine Transforms

Vladimir Britanak , ... K.R. Rao , in Discrete Cosine and Sine Transforms, 2007

5.2.7 QR, LU, LDU and PLUS factorizations

We mentioned that in linear algebra and matrix computations, a real nonsingular matrix is reduced by elementary rotation matrices and elementary transformations into various canonical forms in order to simplify subsequent computational steps of a solved problem.

Such procedures lead to various useful factorizations of the matrix into the products of structurally simpler matrices.

There exist two basic methods how to reduce a real nonsingular matrix of order N into equivalent upper triangular form. The first method is based on premultiplications of the matrix by elementary Givens–Jacobi rotation matrices. This procedure leads to the well-known QR factorization, where Q is an orthogonal matrix and R is an upper triangular matrix. The QR factorization is also discussed in the Appendix A.3 (see equations (A.27)(A.34)). The following theorem and corollaries state the QR factorization [1].

Theorem 5.1: ([1], Chapter 1, p. 37)

Arbitrary real nonsingular matrix

A = ( a 11 ( 0 ) a 12 ( 0 ) a 1 n ( 0 ) a 21 ( 0 ) a 22 ( 0 ) a 2 n ( 0 ) a n 1 ( 0 ) a n 2 ( 0 ) a n n ( 0 ) )

can be reduced through successive premultiplications by elementary Givens–Jacobi rotation matrices Gij to an upper triangular matrix, whose all diagonal elements are positive besides the last one, i.e.,

A ( n 1 ) = G n 1 , n G 13 G 12 A = ( a 11 ( 1 ) a 12 ( 1 ) a 1 n ( 1 ) 0 a 22 ( 2 ) a 2 n ( 2 ) 0 0 a n n ( n 1 ) ) .

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123736246500072

Matrices

Richard Bronson , ... John T. Saccoman , in Linear Algebra (Third Edition), 2014

1.7 LU Decomposition

Matrix inversion of elementary matrices is at the core of still another popular method, known as LU decomposition, for solving simultaneous equations in the matrix form Ax  = b. The method rests on factoring a nonsingular coefficient matrix A into the product of a lower triangular matrix L with an upper triangular matrix U. Generally, there are many such factorizations. If L is required to have all diagonal elements equal to 1, then the decomposition, when it exists, is unique and we may write

(1.33) A = LU

with

L = 1 0 0 0 l 21 1 0 0 l 31 l 32 1 0 l n 1 l n 2 l n 3 1

U = u 11 u 12 u 13 u 1 n 0 u 22 u 23 u 2 n 0 0 u 23 u 3 n 0 0 0 u nn

To decompose A into form (1.33), we first transform A to upper triangular form using just the third elementary row operation R 3. This is similar to transforming a matrix to row-reduced form, except we no longer use the first two elementary row operations. We do not interchange rows, and we do not multiply rows by nonzero constants. Consequently, we no longer require that the first nonzero element of each nonzero row be 1, and if any of the pivots are 0—which would indicate a row interchange in the transformation to row-reduced form—then the decomposition scheme we seek cannot be done.

Example 1 Use the third elementary row operation to transform the matrix

A = 2 1 3 4 2 1 6 1 2

into upper triangular form.

Solution:

A = 2 1 3 4 2 1 6 1 2 2 1 3 0 4 5 6 1 2 by adding to the second row − 2 times the first row
2 1 3 0 4 5 0 4 11 by adding to the third row 3 times the first row
2 1 3 0 4 5 0 0 6 by adding to the third row 1 times the second row

If a square matrix A can be reduced to upper triangular form U by a sequence of elementary row operations of the third type, then there exists a sequence of elementary matrices E 21, E 31, E 41, …   , E n,n  1 such that

(1.34) E n , n 1 E 41 E 31 E 21 A = U

where E 21 denotes the elementary matrix that places a 0 in the 2-1 position, E 31 denotes the elementary matrix that places a 0 in the 3-1 position, E 41 denotes the elementary matrix that places a 0 in the 4-1 position, and so on. Since elementary matrices have inverses, we can write Equation (1.29) as

(1.35) A = E 21 1 E 31 1 E 41 1 E n , n 1 1 U

Each elementary matrix in Equation (1.34) is lower triangular. It follows from Theorem 4 of Section 1.5 that each of the inverses in Equation (1.35) are lower triangular and then from Theorem 2 of Section 1.3 that the product of these lower triangular inverses is itself lower triangular. If we set

L = E 21 1 E 31 1 E 41 1 E n , n 1 1

then L is lower triangular and Equation (1.35) may be rewritten as A  = LU, which is the decomposition we seek.

A square matrix A has an LU decomposition if A can be transformed to upper triangular form using only the third elementary row operation.

Example 2 Construct an LU decomposition for the matrix given in Example 1.

Solution: The elementary matrices associated with the elementary row operations described in Example 1 are

E 21 = 1 0 0 2 1 0 0 0 1 , E 31 = 1 0 0 0 1 0 3 0 1 , and E 32 = 1 0 0 0 1 0 0 1 1

with inverses given respectively by

E 21 1 = 1 0 0 2 1 0 0 0 1 , E 31 1 = 1 0 0 0 1 0 3 0 1 , and E 32 1 = 1 0 0 0 1 0 0 1 1 .

Then,

2 1 3 4 2 1 6 1 2 = 1 0 0 2 1 0 0 0 1 1 0 0 0 1 0 3 0 1 1 0 0 0 1 0 0 1 1 2 1 3 0 4 5 0 0 6

or, upon multiplying together the inverses of the elementary matrices,

2 1 3 4 2 1 6 1 2 = 1 0 0 2 1 0 3 1 1 2 1 3 0 4 5 0 0 6 .

Example 2 suggests an important simplification of the decomposition process. Note that the elements in L located below the main diagonal are the negatives of the scalars used in the elementary row operations in Example 1 to reduce A to upper triangular form! This is no coincidence.

▸Observation 1

If, in transforming a square matrix A to upper triangular form, a zero is placed in the i-j position by adding to row i a scalar k times row j, then the i-j element of L in the LU decomposition of A is − k.

We summarize the decomposition process as follows: Use only the third elementary row operation to transform a square matrix A to upper triangular form. If this is not possible, because of a zero pivot, then stop. Otherwise, the LU decomposition is found by defining the resulting upper triangular matrix as U and constructing the lower triangular matrix L according to Observation 1.

Example 3 Construct an LU decomposition for the matrix

A = 2 1 2 3 6 2 4 8 1 1 0 4 0 1 3 4

Solution: Transforming A to upper triangular form, we get

2 1 2 3 6 2 4 8 1 1 0 4 0 1 3 4 2 1 2 3 0 1 2 1 1 1 0 4 0 1 3 4 by adding to the second row −   3 times the first row
2 1 2 3 0 1 2 1 0 3 2 1 5 2 0 1 3 4 by adding to the third row −   1/2 times the first row
2 1 2 3 0 1 2 1 0 0 2 4 0 1 3 4 by adding to the third row −   3/2 times the second row
2 1 2 3 0 1 2 1 0 0 2 4 0 0 5 5 by adding to the fourth row 1 times the second row
2 1 2 3 0 1 2 1 0 0 2 4 0 0 0 5 by adding to the fourth row 5/2 times the third row

We now have an upper triangular matrix U. To get the lower triangular matrix L in the decomposition, we note that we used the scalar −   3 to place a 0 in the 2-1 position, so its negative −(−   3)   =   3 goes into the 2-1 position of L. We used the scalar −   1/2 to place a 0 in the 3-1 position in the second step of the preceding triangularization process, so its negative, 1/2, becomes the 3-1 element in L; we used the scalar 5/2 to place a 0 in the 4-3 position during the last step of the triangularization process, so its negative, −   5/2, becomes the 4-3 element in L. Continuing in this manner, we generate the decomposition

2 1 2 3 6 2 4 8 1 1 0 4 0 1 3 4 = 1 0 0 0 3 1 0 0 1 2 3 2 1 0 0 1 5 2 1 2 1 2 3 0 1 2 1 0 0 2 4 0 0 0 5

LU decompositions, when they exist, are used to solve systems of simultaneous linear equations. If a square matrix A can be factored into A  = LU, then the system of equations Ax  = b can be written as L(Ux)  = b. To find x, we first solve the system

(1.36) Ly = b

for y, and then once y is determined, we solve the system

(1.37) Ux = y

for x. Both systems (1.36) and (1.37) are easy to solve, the first by forward substitution and the second by backward substitution.

If A  = LU for a square matrix A, then the equation Ax  = b is solved by first solving the equation Ly  = b for y and then solving the equation Ux  = y for x.

Example 4 Solve the system of equations:

2 x y + 3 z = 9 4 x + 2 y + z = 9 6 x y + 2 z = 12

Solution: This system has the matrix form

2 1 3 4 2 1 6 1 2 x y z = 9 9 12

The LU decomposition for the coefficient matrix A is given in Example 2. If we define the components of y by α, β, and γ, respectively, the matrix system Ly  = b is

1 0 0 2 1 0 3 1 1 α β γ = 9 9 12

which is equivalent to the system of equations

α = 9 2 α + β = 9 3 α β + γ = 12

Solving this system from top to bottom, we get α   =   9, β  =     9, and γ   =   30. Consequently, the matrix system Ux  = y is

2 1 3 0 4 5 0 0 6 x y z = 9 9 30

which is equivalent to the system of equations

2 x y + 3 z = 9 4 y 5 z = 9 6 z = 30

Solving this system from bottom to top, we obtain the final solution x  =     1, y  =   4, and z  =   5.

Example 5 Solve the system

2 a + b + 2 c + 3 d = 5 6 a + 2 b + 4 c + 8 d = 8 a b + 4 d = 4 b 3 c 4 d = 3

Solution: The matrix representation for this system has as its coefficient matrix the matrix A of Example 3. Define

y = α β γ δ T

Then, using the decomposition determined in Example 3, we can write the matrix system Ly  = b as the system of equations

α = 5 3 α + β = 8 1 2 α + 3 2 β + γ = 4 β 5 2 γ + δ = 3

which has as its solution α   =   5, β  =     7, γ   =   4, and δ  =   0. Thus, the matrix system Ux  = y is equivalent to the system of equations

2 a + b + 2 c + 3 d = 5 b 2 c d = 7 2 c + 4 d = 4 5 d = 0

Solving this set from bottom to top, we calculate the final solution as a  =     1, b  =   3, c  =   2, and d  =   0.

Problems 1.7

In Problems 1 through 14, A and b are given. Construct an LU decomposition for the matrix A and then use it to solve the system Ax  = b for x.

(1)

A = 1 1 3 4 , b = 1 6 .

(2)

A = 2 1 1 2 , b = 11 2 .

(3)

A = 8 3 5 2 , b = 625 550 .

(4)

A = 1 1 0 1 0 1 0 1 1 , b = 4 1 1 .

(5)

A = 1 2 0 1 3 1 2 2 3 , b = 1 2 3 .

(6)

A = 2 1 3 4 1 0 2 1 2 , b = 10 40 0 .

(7)

A = 3 2 1 4 0 1 3 9 2 , b = 50 80 20 .

(8)

A = 1 2 1 2 0 1 1 1 3 , b = 80 159 75 .

(9)

A = 1 2 1 0 2 1 0 0 1 , b = 8 1 5 .

(10)

A = 1 0 0 3 2 0 1 1 2 , b = 2 4 2 .

(11)

A = 1 0 1 1 1 1 0 1 1 1 1 0 0 1 1 1 , b = 4 3 2 2 .

(12)

A = 2 1 1 3 1 4 2 1 0 0 1 1 0 1 1 1 , b = 1000 200 100 100 .

(13)

A = 1 2 1 1 1 1 2 1 1 1 1 2 0 1 1 1 , b = 30 30 10 10 .

(14)

A = 2 0 2 0 2 2 0 6 4 3 1 1 1 0 3 1 , b = 2 4 9 4 .

(15)
(a)

Use LU decomposition to solve the system

x + 2 y = 9 2 x + 3 y = 4

(b)

Use the decomposition to solve the preceding system when the right sides of the equations are replaced by 1 and −   1, respectively.

(16)
(a)

Use LU decomposition to solve the system

x + 3 y z = 1 2 x + 5 y + z = 4 2 x + 7 y 4 z = 6

(b)

Use the decomposition to solve the preceding system when the right side of each equation is replaced by 10, 10, and 10, respectively.

(17)

Solve the system Ax  = b for the following vectors b when A is given as in Problem 4:

(a)

5 7 4 ,

(b)

2 2 0 ,

(c)

40 50 20 ,

(d)

1 1 3 .

(18)

Solve the system Ax  = b for the following vectors b when A is given as in Problem 13:

(a)

1 1 1 1 ,

(b)

0 0 0 0 ,

(c)

190 130 160 60 ,

(d)

1 1 1 1 .

(19)

Show that LU decomposition cannot be used to solve the system

2 y + z = 1 x + y + 3 z = 8 2 x y z = 1

but that the decomposition can be used if the first two equations are interchanged.

(20)

Show that LU decomposition cannot be used to solve the system

x + 2 y + z = 2 2 x + 4 y z = 7 x + y + 2 z = 2

but that the decomposition can be used if the first and third equations are interchanged.

(21)
(a)

Show that the LU decomposition procedure given in this section cannot be applied to

A = 0 2 0 9

(b)

Verify that A  = LU, when

L = 1 0 1 1 and U = 0 2 0 7

(c)

Verify that A  = LU, when

L = 1 0 3 1 and U = 0 2 0 3

(d)

Why do you think the LU decomposition procedure fails for this A? What might explain the fact that A has more than one LU decomposition?

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123914200000019