Chapter III Solving the Linear System of Equations Ax b
Chapter III Solving the Linear System of Equations Ax b
equations Ax = b
Numerical Analysis I
1
Contents
1 Introduction 3
Ax = b,
where
a a12 · · · a1n x1 b1
11
a21 a22 · · · a2n x2 b2
A= . .. .. , x= .. , b= .. .
.. . ··· . . .
am1 am2 · · · amn xn bm
where d11 , d22 , d33 , . . . , dnn are the elements of the main diagonal.
2. Identity matrix: The identity matrix of order n, In = [δij ], is a diagonal matrix whose
diagonal entries are all 1s. When the size of In is clear, this matrix is generally written
simply as I.
Definition 2 (Triangular matrix) is a square matrix that has all zero entries except those
either on and above or on and below the main diagonal.
1. Upper-triangular matrix: is a square matrix in which all the entries below the main
diagonal are zero,
A = [aij ], where aij = 0, for all i > j.
3. Lower-triangular matrix: is a square matrix in which all the entries above the main
diagonal are zero,
A = [aij ], where aij = 0, for all i < j.
a11 0 0
A=
a21 a22 0 .
a31 a32 a33
1 0 0
A = a21 1 0
.
a31 a32 1
Example 6 Let !
1 2 3
A= .
4 5 6
Then, the transpose of matrix A is given by:
1 4
At =
2 5 .
3 6
Theorem 1 The following operations involving the transpose of a matrix hold whenever the
operation is possible:
2. (A + B)T = AT + B T .
!
1 2
∆2 (B) = det = −3.
4 5
1 2 3
∆3 (B) = det
4 5 6 = det(B) = 0.
7 8 9
−3
4 2 3
0 5 6 9
C=
.
0 0 −2 1
0 0 0 7
∆1 (C) = c11 = 4.
!
4 2
∆2 (C) = det = 20.
0 5
4 2 3
∆3 (C) =
0 5 6 = −40.
0 0 −2
4 2 −3 3
0 5 6 9
∆4 (C) = det
= det(C) = −280.
0 0 −2 1
0 0 0 7
Remark 2 Suppose A is n × n matrix:
4. det(AT ) = det(A).
LU factorization method
Given a system of linear equations Ax = b, where A is a square matrix of order
n × n.
1. LU factorization of A: To perform LU factorization of a matrix A, we ex-
press it as the product of a lower-triangular matrix L and an upper-triangular
matrix U , such that:
A = LU,
This approach breaks the problem into two simpler triangular systems. First,
solve the system Ly = b for y, and then solve the system U x = y for x.
Remark 3 Doolittle’s reduction method and Crout’s reduction method are both techniques
used for LU factorization of matrices, which is essential for solving systems of linear equa-
tions. Below is a comparison of the two methods.
Example 8 Consider the following linear system of equations to solve with Doolittle’s re-
duction method:
2x1 + x2 + 2x3 = 10
6x1 + 4x2 = 26
8x + 5x + x = 35
1 2 3
Therefore,
u11 = 2
u11 = 2
u12 = 1
u12 = 1
u13 = 2
u13 = 2
l21 u11 = 6 l21 = 3
l21 u12 + u22 = 4 ⇒ u22 = 1
u23 = −6
l21 u13 + u23 = 0
l31 u11 = 8
l31 = 4
l31 u12 + l32 u22 = 5 l32 = 1
l31 u13 + l32 u23 + u33 = 1 u33 = −1
y1 = 10 y1 = 10
⇒ 3y1 + y2 = 26 ⇒ y2 = −4
4y + y + y = 35 y = −1
1 2 3 3
10
Thus, the solution to the system Ly = b is y =
−4 .
−1
(b) Solve the upper-triangular system U x = y
2 1 2 x1 10
Ux = y ⇔
0 1 −6 x2 = −4 .
0 0 −1 x3 −1
2x1 + x2 + 2x3 = 10 x3 = 1
⇒ x2 − 6x3 = −4 ⇒ x2 = 2
− x3 = −1
x =3
1
3
The solution to the system is: x =
2 .
1
Example 9 Consider the previous example of a linear system of equations that we will solve
using Crout’s reduction method.
Therefore,
l11 = 2
l11 = 2
l21 = 6
l21 = 6
l31 = 8
l31 = 8
1
l11 u12 = 1 u12 =
2
(1) l21 u12 + l22 = 4 ⇒ l22 = 1
l31 u12 + l32 = 5
l32 = 1
l11 u13 = 2
u13 = 1
l21 u13 + l22 u23 = 0 u23 = −6
l31 u13 + l32 u23 + l33 = 1 l33 = −1
2y1 = 10 y1 = 5
⇒ 6y1 + y2 = 26 ⇒ y2 = −4
8y + y − y = 35
y =1
1 2 3 3
5
Thus, the solution to the system Ly = b is y =
−4 .
1
(b) Solve the upper-triangular system U x = y
1
1 2
1 x1 5
Ux = y ⇔
0 1 −6 x2 = −4 .
0 0 1 x3 1
1
x1 + 2 x2 + x3 = 5 x3 = 1
⇒ x2 − 6x3 = −4 ⇒ x2 = 2
x3 = 1 x =3
1
3
2 .
The solution to the system is: x =
1
2.3 Review 2
Definition 6 (Eigenvalues of a square matrix) Let A be a square matrix of order n.
The eigenvalues of A are the roots of the characteristic polynomial associated with A.
The characteristic polynomial P (λ) is defined as:
P (λ) = λ2 − 7λ + 10.
The eigenvalues of A are the roots of this polynomial. For the equation:
λ2 − 7λ + 10 = 0.
∆ = (−7)2 − 4 × 1 × 10 = 9 > 0.
We have ∆ > 0, thus the equation λ2 − 7λ + 10 = 0 has two distinct real roots
√ √
−(−7) + ∆ 7+ 9 7+3
λ1 = = = ,
2×1 2 2
√ √
−(−7) − ∆ 7− 9 7−3
λ1 = = = .
2×1 2 2
The solutions are:
λ1 = 5 and λ2 = 2
∆1 (A) = 1 > 0,
!
1 2
∆2 (A) = det = −3 < 0,
2 1
∆3 (A) = det(A) = 14 > 0.
Since the first and third leading principal minors are strictly positive, but the second is not
strictly positive, the matrix A is not positive definite matrix.
Since this quadratic form is strictly positive for any non-zero vector x, the matrix A is
positive definite.
2. Leading principal minors: Calculate the leading principal minors and check if they
are all strictly positive.
∆1 (A) = 2 > 0.
∆2 (A) = det(A) = 3 > 0.
Since both leading principal minors are strictly positive, the matrix A is positive definite.
A = LLT ,
This breaks the problem into two simpler triangular systems. First, solve
the system Ly = b for y, and then solve the system LT x = y for x.
Theorem 3 If A ∈ Mn (R) is a symmetric positive definite matrix, then there exists at least
one lower-triangular matrix L such that
A = LLT .
Moreover, if the diagonal elements lii of L are strictly positive, the decomposition is unique.
Example 13 Consider the following linear system of equations to solve using the Cholesky
factorization method:
2x1 + x2 + 2x3 = 1
x1 + 3x2 + x3 = 1
2x + x + 3x = 1
1 2 3
• A is a positive definite matrix since all its leading principal minors are strictly positive.
∆1 (A) = a11 = 2 > 0,
!
2 1
∆2 (A) = det = 5 > 0,
1 3
2 1 2
∆3 (A) = det
1 3 1 = 5 > 0.
2 1 3
A = LLT ,
where L is a lower-triangular matrix with strictly positive entries on the diagonal, and
LT is the transpose of L.
The matrix L is defined by
l11 0 0
L=
l21 l22 0 , with l11 , l22 , l33 > 0.
l31 l32 l33
Now, we want to find the elements of L, and then
2 1 2 l11 0 0 l11 l21 l31
A = LLT ⇔
1 3 1 = l21 l22 0 0 l22 l32
2 1 3 l31 l32 l33 0 0 l33
l2 l11 l21 l11 l31
11
= l21 l11 2 2 .
l21 + l22 l21 l31 + l22 l32
2 2 2
l31 l11 l31 l21 + l32 l22 l31 + l32 + l33
Therefore,
2
l11 =2
√
l21 l11 = 1
l11 = 2
l31 l11 = 2
√
l21 = 2/2
l11
l21= 1 √
l
2 2 31 = 2
l21 + l22 =3 ⇒ p .
l22 = 5/2
l31 l21 + l32 l22 = 1
l32 =0
l l
11 31
= 2
l33 =1
(((
l l + l l = 1
( (
21 31 22 32
( ( (
(
2 2 2
l31 + l32 + l33 =3
Thus, we get
√ √ √ √
2
2 0 0 2 2
√ q q2
L= 2
2 5
2 ,
0 LT =
0
5
2
0 .
√
2 0 1 0 0 1
√
√1
2y1 =1 y1 =
√ q 2
2 5 √1
⇒ 2
y1 + y
2 2
=1 ⇒ y2 = 10
√
y =0
2y1 + y3 = 1 3
√1
2
Thus, the solution to the system Ly = b is y = √1 .
10
0
(b) Solve the upper-triangular system LT x = y
√ √ √
2
2 2 x1 √1
q2 2
LT x = y ⇔
0
5
2
0 x2 = √1
10
.
0 0 1 x3 0
√ √ √
2 √1
2x + x2 + 2x3 =
1
x3 = 0
2
q 2
⇒ 5 1 ⇒ 1
x
2 2
= √
10
x2 = 5
x = 2
x3 = 0
1 5
2
5
The solution to the system is: x = 1 .
5
0