Skip to main content

LU factorization: x-3y+10z=3

Short answer

Decompose A into L and U using Doolittle’s method. Forward substitution on L·y = b gives y, then back substitution on U·x = y yields x = -4.0000, y = 3.1739, z = 1.6522.

Solve the following set of linear equations using LU factorization method. x - 3y + 10z = 3 -x + 4y + 2z = 20 5x + 2y + z = -12

LU factorization (Doolittle): write A = L·U, where L is lower triangular with 1s on the diagonal and U is upper triangular. Then solve L·y = b by forward substitution and U·x = y by back substitution.

Step 1: System

x - 3y + 10z = 3
-x + 4y + 2z = 20
5x + 2y + z = -12

A = [1 -3 10; -1 4 2; 5 2 1], b = [3, 20, -12]ᵀ

Step 2: Find L and U

From A = L·U (compare row by row):

Row 1 of U: u11 = 1.0000, u12 = -3.0000, u13 = 10.0000
Column 1 of L: l21 = a21/u11 = -1.0000/1.0000 = -1.0000, l31 = a31/u11 = 5.0000/1.0000 = 5.0000
Row 2 of U: u22 = a22 − l21·u12 = 4.0000 − (-1.0000)(-3.0000) = 1.0000; u23 = a23 − l21·u13 = 2.0000 − (-1.0000)(10.0000) = 12.0000
l32 = (a32 − l31·u12)/u22 = (2.0000 − (5.0000)(-3.0000))/1.0000 = 17.0000
u33 = a33 − l31·u13 − l32·u23 = 1.0000 − (5.0000)(10.0000) − (17.0000)(12.0000) = -253.0000

Result:

L =

 1.0000   0.0000   0.0000
-1.0000   1.0000   0.0000
 5.0000  17.0000   1.0000

U =

   1.0000    -3.0000    10.0000
   0.0000     1.0000    12.0000
   0.0000     0.0000  -253.0000

(Check: L·U reproduces A.)

Step 3: Solve L·y = b (forward substitution)

y1 = 3.0000
y2 = 20.0000 − (-1.0000)(3.0000) = 23.0000
y3 = -12.0000 − (5.0000)(3.0000) − (17.0000)(23.0000) = -418.0000

Step 4: Solve U·x = y (back substitution)

z = (-418.0000) / -253.0000 = 1.6522
y = (23.0000 − (12.0000)(1.6522)) / 1.0000 = 3.1739
x = (3.0000 − (-3.0000)(3.1739) − (10.0000)(1.6522)) / 1.0000 = -4.0000

Answer: x = -4.0000, y = 3.1739, z = 1.6522

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 3 questions →