Last Updated on October 21, 2026 by Maged kamel
- How to solve for x-y by L-U Decomposition?
- Illustration of the Gauss elimination method for forming the U Matrix.
- Can we use an elementary Matrix to get the L and U matrices?
- Write the Expression (L*C)=b as the first step in developing an Expression to solve for x and y for the two equations, L-U.
- Find the Inverse of the L Matrix as the second step to solve for x-y by L-U decomposition.
- Use C as the third step to develop an Expression to solve for x-y using L-U decomposition.
- Get the Value of X as the fourth step to solve for x-y by L-U decomposition.
- A quicker way to find X and Y.
How to solve for x-y by L-U Decomposition?
I have prepared a video that illustrates the Post’s content
The video timestamps are shown.
- 00:00 Introduction and a summary of the content of the video.
- 01:20 Reminder of the procedure for finding L and U matrices for a 2×2 Matrix.
- 03:30 Verify that the Product of L and U yields an A Matrix.
- 04:27 Use Elementary matrices to get L and U values.
- 06:05 Verify that E1*A is the upper Matrix.
- 08:50 Find the lower Matrix L from Matrix E1.
- 10:08 Solve Two Linear equations using LU decomposition.
- 12:50 What is the Value of the C Matrix?
- 14:00 The final values of X and Y.
- 15:15 Verify that the X and Y values are correct.
- 16:06 Use a quicker way to find X and Y values. 19:26 – Find the values of x and y.
The next slide shows the content of Post 3- Numeric Linear.

Illustration of the Gauss elimination method for forming the U Matrix.
We have a 2×2 Matrix A given by (2, 3, 3, 4). How do we develop the upper Matrix U for Matrix A?
We use Gaussian elimination with elementary Row operations to convert the Matrix A into an upper-triangular Matrix, and then use back substitution to solve for the unknowns.
For Matrix A, a 2×2 Matrix, which is given as (2 3 3 4). To convert this Matrix into an upper triangular Matrix, we want the diagonal to be nonzero and set a21 to zero.
Using a11 as a pivot, divide a21/a11 by the minus sign, multiply by R1, and add the result to Row R2. The second Row, R2, will be changed.
The new second Row will be (0 – ½). As we have noticed, there was no operation in the first Row of Matrix A, which is the same as in the upper Matrix. Element U22, second Row /2nd column is equal to (a22-(a12/a11).
What about the Lower Matrix? By definition, L11 = L22 = 1 and L12 = 0. For L21, it equals (a21/a11), given that a11 is a pivot. By placing the result in a new second Row, we can obtain a zero Value for U21, the first element in the second Row and first column.

If we want to check whether L*U multiplication yields (2 3 3 4), we can use row-column multiplication. (1*2+0*0)=2, and (1*3+(0*-1/2)=3. (3/2*2+1*0) =3+0=3 which we will lead us to 3 and (3/2 * 3+1*(-1/2)=4.50-0.50=4. We have a valid L*U through a valid multiplication. We will use the same Matrix A to solve for the values of two unknowns, x and y.
Now, the A Matrix, as the Product of L*U, is shown using Matrix symbols.

Can we use an elementary Matrix to get the L and U matrices?
We can find the L and U matrices for the given Matrix A, but first we get U by multiplying A by (-3/2 times the first Row) and adding it to the second Row, and we do the same for the identity Matrix. The elementary Matrix will be (1 0, -1.5 1). Please refer to the following slide.

We can prove that the elementary Matrix is the Inverse of the lower Matrix L.

We obtain the Inverse of the elementary Matrix; according to Doolittle’s method, L is (1 0, 1.5 1).

Write the Expression (L*C)=b as the first step in developing an Expression to solve for x and y for the two equations, L-U.
Consider the two simultaneous linear equations. The two equations can be expressed in Matrix form as A*X = b, where A is a 2×2 Matrix in our example. Matrix X is a (2×1) Matrix containing the unknown variables (x, y), while Matrix b is a (2×1) Matrix of values (13, 18).
We use Matrix C as an intermediate stage to solve for x and y by L-U Decomposition.
Since we expressed A as a Product of (L*U), we can rewrite the equation as (L*U)*X = b.
The values of L& U, and b, are known; the only unknown is the column vector x.
A new Expression is (U*x)=C; C is an unknown. Finally, A*x = b can be expressed as (L)*C = b. To solve for C, we present the Inverse Matrix L-1 and multiply it by both sides of the equation. This process gives us a Value for Matrix C. The modified Expression is shown in the next slide image.

Find the Inverse of the L Matrix as the second step to solve for x-y by L-U decomposition.
In the lower Matrix L, the elements are (1, 0) and (3/2, 1); the Inverse of the lower Matrix is L-1. We can estimate the determinant of L as 1-0=1.

We divide the adjoint Matrix by the determinant. We swap the diagonal elements and change the sign of (3/2) to (-3/2), leaving 0 unchanged. The final Value of L-1 can be expressed as a 2×2 Matrix: (1 0 -3/2 1).
Use C as the third step to develop an Expression to solve for x-y using L-U decomposition.
Find C in the third step to develop an Expression to solve for x-y using L-U decomposition. The Matrix C is the Product of (L-1)*(B).
Since both values are known, we can find C. Multiplying two (2×2) matrices by a (2×1) Matrix yields a new (2×1) matrix with a Value of (13 – 1.5). The estimation details are shown on the next slide.

Get the Value of X as the fourth step to solve for x-y by L-U decomposition.
Get the Value of X as the fourth step to solve for x-y f by L-U decomposition. Remember that we have the Expression U*x = C; get the Inverse Matrix of U, which is a new 2×2 Matrix. X = (U^-1)*X; then the final Value of X is 2, 3). The Mrix (X,, Y) is a (2×1) Matrix. The values are x = 2 and y = 3.

Substitute the values of x and y to check whether the x and y values are correct.
After checking the two given equations, we find that the estimated values of x and y satisfy both equations. We have x = 2 & y = 3. In the last step, we check whether our solution is correct. 2x + 3x + 4y = 18.
We set x = 2 and y = 3, so (2*2 + 3*3) = 13, which matches the right-hand side.
Meanwhile, 3*2 + 4*3 = 6 + 12 = 18, which equals the right-hand side of the second equation.

A quicker way to find X and Y.
We can express X as the Product of the Inverse of L, the Inverse of U, and Matrix B. See the next slide for more details. This method is quick if you have the inverses of L and U on hand.

We use the elementary Matrix E1 to obtain the upper Matrix U, which equals E1 times Matrix A. We can obtain the Inverse Matrix of U, as shown in the next slide. The elementary Matrix is the Inverse of L.

The following slide shows the final Value of X and Y.

You can view or download the PDF for the Post by clicking the button below.
The following Post provides a step-by-step guide to deriving expressions for L-U values for a 3×3 Matrix.
HELM-Helping Engineers Learn Mathematics.
This is the Omni calculator for estimating various items in linear algebra: LU Decomposition Calculator.
This is a Link to anca calculatormatrices.