 # 14a-Solution of linear systems by LU-partial pivoting-2/2

## Solution of linear systems by LU-partial pivoting-2/2.

In this post, we will continue our discussion of the solution Solution of linear systems by LU-partial pivot. Our aim is how to get x1,x2, and x3 using LU-partial pivot. We need to find the inverse of matrix A, which can be done by using the following steps.

This is the second part of the solved problem for the Solution of linear systems by LU-partial pivoting. To check the previous post-part-1 click here.

The equation used in the solving of this problem will be P*A=L*U, where P is the permutation matrix. A is the coefficient matrix, L is the Lower matrix, and U is the upper matrix. We want to solve for the values of the three unkownsx1,x2,x3.

### Modification of the product of M2*P23*M1*P12*A.

We want to find the value of the P matrix in the expression of P*A=L*U. We can use the expression of P23*P23=I. the product of the permutation matrix P23 by itself will be equal to identity matrix I.

If we multiply I by U, where U is the upper matrix, and equate the product to U. We can rewrite the expression of M2*P23*M1*P12*A as a product of two items. The first item is (M2*P23*M1*P23), while the second item is (P23*P12*A), which is simply the product of P*A.

Since we have the expression of P*A=L*U, in order to get the value of L which is the lower matrix, we will divide both sides by the first item which is (M2*P23*M1*P23). We will get P*A=the inverse of (M2*P23*M1*P23)*U

The inverse is nothing but the value of the lower matrix L. the full details of the estimation can be seen in the next slide image. Solution of linear systems by LU-partial pivoting-2/2. Value of L matrix.

### The value of Lower matrix L.

In the solution of linear systems by LU-partial pivoting-2/2, we will multiply (M2*P23*M1*P23) and then get the product inverse for the value of L.

M2 matrix is a 3×3 matrix that can be written as (1 0 0, 0 1 0, 0 -2/5.5 1).

P23 matrix is a 3×3 matrix that can be written as (1 0 0, 0 0 1, 0 1 0).

M1 matrix is a 3×3 matrix that can be written as (1 0 0, 0 1 0, -1/2 0 1).

P23 matrix is a 3×3 matrix that can be written as (1 0 0, 0 0 1, 0 1 0).

When multiplying M2*P23, there will be a swap of the second column to the third column of the M2 matrix, the product will give a new matrix which is 3×3 and is equal to (1 0 0, 0 0 1, 0 1 -2/5.5). While multiplying (M1*P23), there will be a swap of the second column to the third column of the M1 matrix, the product will give a new matrix which is 3×3 and is equal to (1 0 0, 0 0 1, -1/2 1 0).

The next step is to multiply these two new matrices to get the value of the inverse of Matrix L.

The final value of L matrix can be found as a 3×3 matrix (1 0 0, 1/2 1 0, 0 1/2.75 1). the value is identical to the value earlier estimated by using the first method, please refer to the previous post. The details of the estimation can be seen from the next slide image.

### How to get the inverse of matrix A-Partial pivoting?

We have the expression of P*A=L*U, if we multiply both sides by the inverse of the P matrix, the left side will be =A, while the right side will be equal to (P-1)*(L*U). Again we will multiply both sides by (U-1*L-1*P), which is the inverse of the upper matrix multiplied by the inverse of the lower matrix again multiplied by the permutation matrix.
The right side will be found to be equal to ( I )where ( I ) matrix is the identity matrix.

We can get the final expression of the inverse of Matrix A as (U-1*L-1*P) . Solution of linear systems by LU-partial pivoting-2/2. The inverse of Matrix A.

The different values for the U-1&L-1 and P matrices are shown in the next slide image. The product of (U-1*L-1*P) .

The value of the inverse of Matrix A can be thus estimated.

### Estimation of the X column vector.

We can get the value of the x matrix by multiplying A-1 by (A*X) and equate to the product of (A-1*B), where B is the vector-matrix This product will give the values of the three unknowns as x1 value =5, x2 value=8, and x3=10. Solution of linear systems by LU-partial pivoting-2/2. estimate the values of the X-column matrix.

### Check the three systems of linear equations.

We will make a routine check of the values of x1, x2 and x3 to check that these values are satisfying these three systems of linear equations. the full details are shown in the next slide image. 