You are on page 1of 22

DBM3013 ENGINEERING MATHEMATICS 3 57

2.0 NUMERICAL METHOD

Learning Outcomes :

At the end of this chapter, you should be able to :

 Construct solutions of linear equations :


 Construct solutions of polynomial equation :

2.1
Construct Solutions Of Linear Equations

At the end of this topic, you should be able to :

 Construct solutions of linear equations :


 Use Gaussian Elimination method.
 Apply LU Decomposition using Doolittle method.
 Apply LU Decomposition using Crout method.

Numerical methods are techniques used for solving mathematical problems that cannot be solved or
are difficult to solve analytically. An analytical solution is an exact answer in the form of a
mathematical expression in terms of the variables associated with the problem that is being solved. A
numerical solution is an approximate numerical value for the solution.

2.1.1
Use Gaussian Elimination Method

The fundamental idea is to add multiples of one equation to the others in order to eliminate a variable
and to continue this process until only one variable is left. Once this final variable is determined, its
value is substituted back into the other equations in order to evaluate the remaining unknowns. This
method, characterized by step‐by‐step elimination of the variables, is called Gaussian Elimination.

𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1


𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 58

Step 1 : Convert simultaneous equation to matrix form.

𝑎11 𝑎12 𝑎13 𝑥1 𝑏1


𝑎
( 21 𝑎22 𝑎23 ) (𝑥2 ) = (𝑏2 )
𝑎31 𝑎32 𝑎33 𝑥3 𝑏3

𝑎11 𝑎12 𝑎13 𝑏1


(𝑎21 𝑎22 𝑎23 |𝑏2 )
𝑎31 𝑎32 𝑎33 𝑏3

𝒂𝟐𝟏
Step 2 : Make a21 = 0 by using formula 𝑹𝟐 − ( ) (𝑹𝟏 ) apply to all elements in second row (R2).
𝒂𝟏𝟏

𝑎11 𝑎12 𝑎13 𝑏1


( 0 𝑎22 𝑎23 |𝑏2 )
𝑎31 𝑎32 𝑎33 𝑏3

𝒂𝟑𝟏
Step 3 : Make a31 = 0 by using formula 𝑹𝟑 − ( ) (𝑹𝟏 ) apply to all elements in third row (R3).
𝒂𝟏𝟏

𝑎11 𝑎12 𝑎13 𝑏1


( 0 𝑎22 𝑎23 |𝑏2 )
0 𝑎32 𝑎33 𝑏3

𝒂𝟑𝟐
Step 4 : Make a32 = 0 by using formula 𝑹𝟑 − ( ) (𝑹𝟐 ) apply to all elements in third row (R3).
𝒂𝟐𝟐

𝑎11 𝑎12 𝑎13 𝑏1


( 0 𝑎22 𝑎23 |𝑏2 )
0 0 𝑎33 𝑏3

Step 5 : Solve simultaneous equation.

𝑎33 𝑥3 = 𝑏3
𝑏3
𝑥3 =
𝑎33

𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎22 𝑥2 = 𝑏2 − 𝑎23 𝑥3
𝑏2 − 𝑎23 𝑥3
𝑥2 =
𝑎22

𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1


𝑎11 𝑥1 = 𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3
𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3
𝑥1 =
𝑎11

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 59

Example 1

Solve the following simultaneous equation using Gaussian Elimination Method.

𝑥1 − 3𝑥2 + 2𝑥3 = 8
4𝑥1 − 𝑥2 − 𝑥3 = 9
3𝑥1 + 2𝑥2 + 𝑥3 = 21

Solution

Step 1 : Convert simultaneous equation to matrix form.

1 −3 2 𝑥1 8
(4 −1 𝑥
−1) ( 2 ) = ( 9 )
3 2 1 𝑥3 21

𝑎21
Step 2 : Make a21 = 0 by using formula 𝑅2 − ( ) (𝑅1 ) apply to all elements in second row (R2).
𝑎11

4
𝑎21 = 4 − ( ) (1) = 0
1
4
𝑎22 = −1 − ( ) (−3) = 11
1
4
𝑎23 = −1 − ( ) (2) = −9
1
4
𝑏2 = 9 − ( ) (8) = −23
1

1 −3 2 𝑥1 8
(0 11 𝑥
−9) ( 2 ) = (−23)
3 2 1 𝑥3 21

𝑎31
Step 3 : Make a31 = 0 by using formula 𝑅3 − ( ) (𝑅1 ) apply to all elements in third row (R3).
𝑎11

3
𝑎31 = 3 − ( ) (1) = 0
1
3
𝑎32 = 2 − ( ) (−3) = 11
1
3
𝑎33 = 1 − ( ) (2) = −5
1
3
𝑏3 = 21 − ( ) (8) = −3
1

1 −3 2 𝑥1 8
(0 11 𝑥
−9) ( 2 ) = (−23)
0 11 −5 𝑥3 −3

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 60

𝑎32
Step 4 : Make a32 = 0 by using formula 𝑅3 − ( ) (𝑅2 ) apply to all elements in third row (R3).
𝑎22

11
𝑎31 = 0 − ( ) (0) = 0
11
11
𝑎32 = 11 − ( ) (11) = 0
11
11
𝑎33 = −5 − ( ) (−9) = 4
11
11
𝑏3 = −3 − ( ) (−23) = 20
11

1 −3 2 𝑥1 8
(0 11 𝑥
−9) ( 2 ) = (−23)
0 0 4 𝑥3 20

Step 5 : Solve simultaneous equation.

4𝑥3 = 20
20
𝑥3 =
4
𝑥3 = 5

11𝑥2 − 9𝑥3 = −23


11𝑥2 − (9)(5) = −23
−23 + 45
𝑥2 =
11
𝑥2 = 2

1𝑥1 − 3𝑥2 + 2𝑥3 = 8


1𝑥1 − 3(2) + 2(5) = 8
𝑥1 = 8 − 4
𝑥1 = 4

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 61

Example 2
′ ′ ′
Find the value of 𝑎21 , 𝑎22 , 𝑎23 and 𝑏2′ for the simultaneous linear equation given by using Gaussian
Elimination Method.

𝑥 − 2𝑦 + 𝑧 = 0
2𝑥 + 𝑦 − 3𝑧 = 5
4𝑥 − 7𝑦 + 𝑧 = 1

Solution

Step 1 : Convert simultaneous equation to matrix form.

1 −2 1 𝑥 0
(2 1 −3) (𝑦) = (5)
4 −7 1 𝑧 1

𝑎21
Step 2 : Make a21 = 0 by using formula 𝑅2 − ( ) (𝑅1 ) apply to all elements in second row (R2).
𝑎11


2
𝑎21 = 2 − ( ) (1) = 0
1


2
𝑎22 = 1 − ( ) (−2) = 5
1


2
𝑎23 = −3 − ( ) (1) = −5
1

2
𝑏2′ = 5 − ( ) (0) = 5
1

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 62

2.1.2
Apply LU Decomposition Using Doolittle Method

If A is a square matrix and it can be factored as 𝑨 = 𝑳𝑼 where L is a lower triangular matrix and U is
an upper triangular matrix, then we say that A has an LU-Decomposition of LU.

1 0 0 𝑢11 𝑢12 𝑢13


𝐴 = (𝑙21 1 0) ( 0 𝑢22 𝑢23 )
𝑙31 𝑙32 1 0 0 𝑢33

Example 1

Solve the following simultaneous equation using LU Decomposition With Doolittle Method.

𝑥1 − 3𝑥2 + 2𝑥3 = 8
4𝑥1 − 𝑥2 − 𝑥3 = 9
3𝑥1 + 2𝑥2 + 𝑥3 = 21

Solution

Step 1 : Convert simultaneous equation to matrix form ; 𝑨𝒙 = 𝒃

1 −3 2 𝑥1 8
(4 −1 𝑥
−1) ( 2 ) = ( 9 )
3 2 1 𝑥3 21

Step 2 : In matrix equation A=LU

1 −3 2 1 0 0 𝑢11 𝑢12 𝑢13


(4 −1 −1) = (𝑙21 1 0) ( 0 𝑢22 𝑢23 )
3 2 1 𝑙31 𝑙32 1 0 0 𝑢33

1 −3 2 𝑢11 𝑢12 𝑢13


(4 −1 −1 ) = ( 𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 )
3 2 1 𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑢33

𝑢11 = 1 𝑢12 = −3 𝑢13 = 2

𝑙21 𝑢11 = 4 𝑙21 𝑢12 + 𝑢22 = −1 𝑙21 𝑢13 + 𝑢23 = −1


𝑙21 (1) = 4 (4)(−3) + 𝑢22 = −1 (4)(2) + 𝑢23 = −1
𝑙21 = 4 𝑢22 = −1 + 12 𝑢23 = −1 − 8
𝑢22 = 11 𝑢23 = −9

𝑙31 𝑢11 = 3 𝑙31 𝑢12 + 𝑙32 𝑢22 = 2 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑢33 = 1
𝑙31 (1) = 3 (3)(−3) + 𝑙32 (11) = 2 (3)(2) + (1)(−9) + 𝑢33 = 1
𝑙31 = 3 −9 + 𝑙32 (11) = 2 −3 + 𝑢33 = 1
2+9
𝑙32 = 𝑢33 = 1 + 3
11
𝑙32 = 1 𝑢33 = 4

1 −3 2 1 0 0 1 −3 2
∴ (4 −1 −1) = (4 1 0) ( 0 11 −9)
3 2 1 3 1 1 0 0 4

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 63

Step 3 : From the equation Ly = b

1 0 0 𝑦1 8
(4 1 0) (𝑦2 ) = ( 9 )
3 1 1 𝑦3 21

1𝑦1 = 8 4𝑦1 + 1𝑦2 = 9 3𝑦1 + 1𝑦2 + 1𝑦3 = 21


8
𝑦1 = 4(8) + 1𝑦2 = 9 3(8) + 1(−23) + 1𝑦3 = 21
1
9−32
𝑦1 = 8 𝑦2 = 1+1𝑦3 = 21
1
21−1
𝑦2 = −23 𝑦3 =
1
𝑦3 = 20

Step 4 : From the equation Ux = y

1 −3 2 𝑥1 8
(0 11 −9 ) ( 𝑥2 ) = (−23)
0 0 4 𝑥3 20

4𝑥3 = 20 11𝑥2 − 9𝑥3 = −23 1𝑥1 − 3𝑥2 + 2𝑥3 = 8


20
𝑥3 = 11𝑥2 − (9)(5) = −23 1𝑥1 − 3(2) + 2(5) = 8
4
−23+45
𝑥3 = 5 𝑥2 = 𝑥1 = 8 − 4
11
𝑥2 = 2 𝑥1 = 4

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 64

Example 2

Solve the following simultaneous linear equation by using LU Decomposition With Doolittle Method.

𝑥 + 𝑧 = 4 + 3𝑦
2𝑥 − 8𝑦 + 8𝑧 = −2
3𝑦 − 15𝑧 = 6𝑥 + 9

Solution

Step 1 : Rearrange the simultaneous linear equation.

𝑥 − 3𝑦 + 𝑧 = 4
2𝑥 − 8𝑦 + 8𝑧 = −2
−6𝑥 + 3𝑦 − 15𝑧 = 9

Step 2 : Convert simultaneous equation to matrix form ; 𝐴𝑥 = 𝑏

1 −3 1 𝑥 4
(2 −8 8 ) (𝑦) = (−2)
−6 3 −15 𝑧 9

Step 3 : In matrix equation A=LU

1 −3 1 1 0 0 𝑢11 𝑢12 𝑢13


(2 −8 8 ) = (𝑙21 1 0) ( 0 𝑢22 𝑢23 )
−6 3 −15 𝑙31 𝑙32 1 0 0 𝑢33

1 −3 1 𝑢11 𝑢12 𝑢13


(2 −8 8 ) = (𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 )
−6 3 −15 𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑢33

𝑢11 = 1 𝑢12 = −3 𝑢13 = 1

𝑙21 𝑢11 = 2 𝑙21 𝑢12 + 𝑢22 = −8 𝑙21 𝑢13 + 𝑢23 = 8


𝑙21 (1) = 2 (2)(−3) + 𝑢22 = −8 (2)(1) + 𝑢23 = 8
𝑙21 = 2 𝑢22 = −8 + 6 𝑢23 = 8 − 2
𝑢22 = −2 𝑢23 = 6

𝑙31 𝑢11 = −6 𝑙31 𝑢12 + 𝑙32 𝑢22 = 3 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑢33 = −15
15
𝑙31 (1) = −6 (-6)(−3) + 𝑙32 (−2) = 3 (-6)(1)+( )(6) + 𝑢33 = −15
2
𝑙31 = −6 18 + 𝑙32 (−2) = 3 −6 + 45 + 𝑢33 = −15
3−18
𝑙32 = 𝑢33 = −15 + 6 − 45
−2
15
𝑙32 = 𝑢33 = −54
2

1 −3 1 1 0 0 1 −3 1
∴ (2 −8 8 )=( 2 1
15
0) ( 0 −2 6 )
−6 3 −15 −6 1 0 0 −54
2

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 65

Step 4 : From the equation Ly = b

1 0 0 𝑦1 4
2 1 0
( 15 ) (𝑦2 ) = (−2)
−6 1 𝑦3 9
2

15
1𝑦1 = 4 2𝑦1 + 1𝑦2 = −2 −6𝑦1 + 𝑦 + 1𝑦3 = 9
2 2
4 15
𝑦1 = 2(4) + 1𝑦2 = −2 −6(4) + (−10) + 1𝑦3 = 9
1 2
𝑦1 = 4 8 + 1𝑦2 = −2 −24 − 75 + 1𝑦3 = 9
𝑦2 = −2 − 8 𝑦3 = 9 + 24 + 75
𝑦2 = −10 𝑦3 = 108

Step 5 : From the equation Ux = y

1 −3 1 𝑥 4
(0 −2 6 ) (𝑦) = (−10)
0 0 −54 𝑧 108

−54𝑧 = 108 −2𝑦 + 6𝑧 = −10 1𝑥 − 3𝑦 + 1𝑧 = 4


108
𝑧= −2𝑦 + 6(−2) = −10 1𝑥 − 3(−1) + 1(−2) = 4
−54
𝑧 = −2 −2𝑦 − 12 = −10 1𝑥 + 3 − 2 = 4
−10+12
𝑦= 𝑥 =4−3+2
−2
𝑦 = −1 𝑥=3

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 66

Example 3

Given the matrix form, AX = B :

2.4 3.6 4.8 𝑥1 1.2


(−3.9 1.3 −6.5) (𝑥2 ) = (2.6)
1.7 −11.9 8.5 𝑥3 0

Find the LU factorization of the following matrix above using Doolittle Method.

Solution

Step 1 : In matrix equation A=LU

2.4 3.6 4.8 1 0 0 𝑢11 𝑢12 𝑢13


(−3.9 1.3 −6.5) = (𝑙21 1 0) ( 0 𝑢22 𝑢23 )
1.7 −11.9 8.5 𝑙31 𝑙32 1 0 0 𝑢33

2.4 3.6 4.8 𝑢11 𝑢12 𝑢13


(−3.9 1.3 −6.5) = (𝑙21 𝑢11 𝑙21 𝑢12 + 𝑢22 𝑙21 𝑢13 + 𝑢23 )
1.7 −11.9 8.5 𝑙31 𝑢11 𝑙31 𝑢12 + 𝑙32 𝑢22 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑢33

𝑢11 = 2.4 𝑢12 = 3.6 𝑢13 = 4.8

𝑙21 𝑢11 = −3.9 𝑙21 𝑢12 + 𝑢22 = 1.3 𝑙21 𝑢13 + 𝑢23 = −6.5
𝑙21 (2.4) = −3.9 (−1.625)(3.6) + 𝑢22 = 1.3 (−1.625)(4.8) + 𝑢23 = −6.5
−3.9
𝑙21 = −5.85 + 𝑢22 = 1.3 −7.8 + 𝑢23 = −6.5
2.4
𝑙21 = −1.625 𝑢22 = 1.3 + 5.85 𝑢23 = −6.5 + 7.8
𝑢22 = 7.15 𝑢23 = 1.3

𝑙31 𝑢11 = 1.7 𝑙31 𝑢12 + 𝑙32 𝑢22 = −11.9 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑢33 = 8.5
𝑙31 (2.4) = 1.7 (0.7)(3.6) + 𝑙32 (7.15) = −11.9 (0.7)(4.8) + (−2)(1.3) + 𝑢33 = 8.5
1.7
𝑙31 = 2.52 + 𝑙32 (7.15) = −11.9 3.36 − 2.6 + 𝑢33 = 8.5
2.4
−11.9−2.52
𝑙31 = 0.7 𝑙32 = 𝑢33 = 8.5 − 3.36 + 2.6
7.15
𝑙32 = −2 𝑢33 = 7.74

2.4 3.6 4.8 1 0 0 2.4 3.6 4.8


∴ (−3.9 1.3 −6.5) = (−1.625 1 0) ( 0 7.15 1.3 )
1.7 −11.9 8.5 0.7 −2 1 0 0 7.74

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 67

2.1.3
Apply LU Decomposition Using Crout Method

If A is a square matrix and it can be factored as 𝑨 = 𝑳𝑼 where L is a lower triangular matrix and U is
an upper triangular matrix, then we say that A has an LU-Decomposition of LU.

𝑙11 0 0 1 𝑢12 𝑢13


𝐴 = (𝑙21 𝑙22 0 ) (0 1 𝑢23 )
𝑙31 𝑙32 𝑙33 0 0 1
Example 1

Solve the following simultaneous equation using LU Decomposition With Crout Method.

𝑥1 − 3𝑥2 + 2𝑥3 = 8
4𝑥1 − 𝑥2 − 𝑥3 = 9
3𝑥1 + 2𝑥2 + 𝑥3 = 21

Solution

Step 1 : Convert simultaneous equation to matrix form ; 𝑨𝒙 = 𝒃

1 −3 2 𝑥1 8
(4 −1 −1) (𝑥2 ) = ( 9 )
3 2 1 𝑥3 21

Step 2 : In matrix equation A=LU

1 −3 2 𝑙11 0 0 1 𝑢12 𝑢13


(4 −1 −1) = (𝑙21 𝑙22 0 ) (0 1 𝑢23 )
3 2 1 𝑙31 𝑙32 𝑙33 0 0 1

1 −3 2 𝑙11 𝑙11 𝑢12 𝑙11 𝑢13


(4 −1 −1) = (𝑙21 𝑙21 𝑢12 + 𝑙22 𝑙21 𝑢13 + 𝑙22 𝑢23 )
3 2 1 𝑙31 𝑙31 𝑢12 + 𝑙32 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑙33

𝑙11 = 1 𝑙11 𝑢12 = −3 𝑙11 𝑢13 = 2


(1)𝑢12 = −3 (1)𝑢13 = 2
𝑢12 = −3 𝑢13 = 2

𝑙21 = 4 𝑙21 𝑢12 + 𝑙22 = −1 𝑙21 𝑢13 + 𝑙22 𝑢23 = −1


(4)(-3)+𝑙22 = −1 (4)(2)+(11)𝑢23 = −1
-12+𝑙22 = −1 (11)𝑢23 = −1 − 8
𝑙22 = −1 + 12 (11)𝑢23 = −9
9
𝑙22 = 11 𝑢23 = −
11

𝑙31 = 3 𝑙31 𝑢12 + 𝑙32 = 2 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑙33 = 1


9
(3)(−3) + 𝑙32 = 2 (3)(2) + (11)(− ) + 𝑙33 = 1
11
−9 + 𝑙32 = 2 −3 + 𝑙33 = 1
𝑙32 = 2 + 9 𝑙33 = 1 + 3
𝑙32 = 11 𝑙33 = 4

1 −3 2 1 0 0 1 −3 2
9
∴ (4 −1 −1) = (4 11 0) ( 0 1 − )
11
3 2 1 3 11 4 0 0 1

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 68

Step 3 : From the equation Ly = b

1 0 0 𝑦1 8
(4 11 0) (𝑦2 ) = ( 9 )
3 11 4 𝑦3 21

1𝑦1 = 8 4𝑦1 + 11𝑦2 = 9 3𝑦1 + 11𝑦2 + 4𝑦3 = 21


8 23
𝑦1 = 4(8) + 11𝑦2 = 9 3(8) + 11(− ) + 4𝑦3 = 21
1 11
9−32
𝑦1 = 8 𝑦2 = 1+4𝑦3 = 21
11
23 21−1
𝑦2 = − 𝑦3 =
11 4
𝑦3 = 5

Step 4 : From the equation Ux = y

1 −3 2 𝑥1 8
9 23
(0 1 − ) (𝑥2 ) = (− )
11 𝑥3 11
0 0 1 5
9 23
1𝑥3 = 5 1𝑥2 − 𝑥 =− 1𝑥1 − 3𝑥2 + 2𝑥3 = 8
11 3 11
5 9 23
𝑥3 = 1𝑥2 − (5) = − 1𝑥1 − 3(2) + 2(5) = 8
1 11 11
23 45
𝑥3 = 5 𝑥2 = − + 𝑥1 = 8 − 4
11 11
𝑥2 = 2 𝑥1 = 4

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 69

Example 2

Solve the following simultaneous equation using LU Decomposition With Crout Method.

2𝑥 + 9𝑦 − 3𝑧 = 5
4𝑦 − 2𝑧 = 0
−𝑥 − 5𝑦 + 4𝑧 = 11

Solution

Step 1 : Convert simultaneous equation to matrix form ; 𝐴𝑥 = 𝑏

2 9 −3 𝑥 5
(0 4 −2) (𝑦) = ( 0 )
−1 −5 4 𝑧 11

Step 2 : In matrix equation A=LU

2 9 −3 𝑙11 0 0 1 𝑢12 𝑢13


(0 4 𝑙
−2) = ( 21 𝑙22 0 ) (0 1 𝑢23 )
−1 −5 4 𝑙31 𝑙32 𝑙33 0 0 1

2 9 −3 𝑙11 𝑙11 𝑢12 𝑙11 𝑢13


(0 4 −2) = (𝑙21 𝑙21 𝑢12 + 𝑙22 𝑙21 𝑢13 + 𝑙22 𝑢23 )
−1 −5 4 𝑙31 𝑙31 𝑢12 + 𝑙32 𝑙31 𝑢13 +𝑙32 𝑢23 + 𝑙33

𝑙11 = 2 𝑙11 𝑢12 = 9 𝑙11 𝑢13 = −3


(2)𝑢12 = 9 (2)𝑢13 = −3
9 −3
𝑢12 = 𝑢13 =
2 2

𝑙21 = 0 𝑙21 𝑢12 + 𝑙22 = 4 𝑙21 𝑢13 + 𝑙22 𝑢23 = −2


9 −3
(0)( ) + 𝑙22 = 4 (0)( ) + (4)𝑢23 = −2
2 2
0 + 𝑙22 = 4 0 + (4)𝑢23 = −2
−2
𝑙22 = 4 𝑢23 =
4
−1
𝑢23 =
2

−3 −1 −1
𝑙31 = −1 𝑙31 𝑢12 + 𝑙32 = −5 (−1) ( ) + ( )( ) + 𝑙33 = 4
2 2 2
9 3 1
(−1)( ) + 𝑙32 = −5 ( ) + ( ) + 𝑙33 = 4
2 2 4
−9 3 1
+ 𝑙32 = −5 𝑙33 = 4 − ( ) − ( )
2 2 4
9 9
𝑙32 = −5 + 𝑙33 =
2 4
−1
𝑙32 =
2

9 −3
2 9 −3 2 0 0 1
2 2
∴ (0 4 −2) = ( 0 4
−1
0) (
9 0 1
−1)

−1 −5 4 −1 2
2 4 0 0 1

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 70

Step 3 : From the equation Ly = b

2 0 0 𝑦1 5
0 4 0 𝑦2 ) = ( 0 )
( −1 9 ) (
−1 𝑦3 11
2 4
1 9
2𝑦1 = 5 4𝑦2 = 0 −1𝑦1 − 𝑦2 + 𝑦3 = 11
2 4
5 5 1 9
𝑦1 = 𝑦2 = 0 −1( ) − (0) + 𝑦3 = 11
2 2 2 4
5 9
− − 0 + 𝑦3 = 11
2 4
9 5
𝑦 = 11 +
4 3 2
27
𝑦3 = 2
9
4
𝑦3 = 6

Step 4 : From the equation Ux = y

9 −3
1 5
2 2 𝑥
−1 (𝑦) = (2)
0 1 𝑧 0
2 6
(0 0 1)
1 9 3 5
1𝑧 = 6 1𝑦 − 𝑧 = 0 1𝑥 + 𝑦 − 𝑧 =
2 2 2 2
6 1 9 3 5
𝑧= 1𝑦 − (6) = 0 1𝑥 + (3) − (6) =
1 2 2 2 2
27 5
𝑧=6 1𝑦 − 3 = 0 1𝑥 + −9=
2 2
0+3 5 27
𝑦= 𝑥= − +9
1 2 2
𝑦=3 𝑥 = −2

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 71

Exercise:

Solve the following simultaneous equation by using :


a) Gaussian Elimination Method.
b) LU Decomposition With Doolittle Method
c) LU Decomposition With Crout Method.

1) 𝑥 + 3𝑦 + 3𝑧 = 4
2𝑥 − 3𝑦 − 2𝑧 = 2
3𝑥 + 𝑦 + 2𝑧 = 5 Answer 1: x = 7; y = 14; z = -15

2) 𝑥+𝑦+𝑧=0
𝑥 − 2𝑦 + 2𝑧 = 4
𝑥 + 2𝑦 − 𝑧 = 2 Answer 2: x = 4; y = -2; z = -2

3) 𝑥 + 2𝑦 − 3𝑧 = 3
2𝑥 − 𝑦 − 𝑧 = 11
3𝑥 + 2𝑦 + 𝑧 = −5 Answer 3: x = 2; y = -4; z = -3

4) 𝑥 − 4𝑦 + 3𝑧 = 2
2𝑥 + 3𝑦 + 4𝑧 = 2
5𝑥 + 𝑦 + 𝑧 = −4 Answer 4: x = -1; y = 0; z = 1

5) 𝑥+𝑦+𝑧=8
3𝑥 + 2𝑦 + 𝑧 = 49
5𝑥 − 3𝑦 + 𝑧 = 0 Answer 5: x = 13; y = 15; z = -20

6) 3𝑥 − 2𝑦 + 3𝑧 = 23
𝑥 + 4𝑦 + 𝑧 = 17
2𝑥 + 𝑦 + 3𝑧 = 25 Answer 6: x = 4; y = 2; z = 5

7) 𝑥 − 4𝑦 − 2𝑧 = 21
2𝑥 + 𝑦 + 2𝑧 = 3
3𝑥 + 2𝑦 − 𝑧 = −2 Answer 7: x = 3; y = -5; z = 1

8) 6𝑥1 + 3𝑥2 + 𝑥3 = 13
4𝑥1 − 2𝑥2 − 3𝑥3 = 28
3𝑥1 − 7𝑥2 + 3𝑥3 = 27 Answer 8: x1 = 4; x2 = -3; x3 = -2

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 72

9) −𝑥1 + 2𝑥2 + 𝑥3 = 0
8𝑥2 + 6𝑥3 = 10
−2𝑥1 + 5𝑥3 = −11 Answer 9: x1 = 3; x2 = 2; x3 = -1

10) 4𝑥1 − 𝑥2 + 3𝑥3 = 38


3𝑥1 + 4𝑥2 + 6𝑥3 = 35
𝑥1 − 5𝑥2 + 3𝑥3 = 21 Answer 10: x1 = 7; x2 = -1; x3 = 3

11) 𝑥 + 𝑧 = 4 + 3𝑦
2𝑥 − 8𝑦 + 8𝑧 = −2
3𝑦 − 15𝑧 = 6𝑥 + 9 Answer 11: x = 3; y = -1; z = -2

12) 𝑥1 + 2𝑥2 − 5𝑥3 = −6


4𝑥1 + 4𝑥2 − 3𝑥3 = 7
5𝑥1 + 7𝑥2 − 13𝑥3 = −9 Answer 12: x1 = -1; x2 = 5; x3 = 3

13) 3𝑥 + 𝑦 = 2
𝑥−𝑦−𝑧 = 3
2𝑦 + 2𝑧 = 2 Answer 13: x = 4; y = -10; z = 11

14) 𝑥 − 2𝑦 − 𝑧 = 6
2𝑥 + 2𝑦 − 𝑧 = 1
−𝑥 − 𝑦 + 2𝑧 = 1 Answer 14: x = 3; y = -2; z = 1

15) 3𝑥 + 5𝑦 − 𝑧 = 7
2𝑥 + 2𝑦 + 4𝑧 = 8
6𝑥 − 𝑦 − 3𝑧 = 8 Answer 15: x = 1; y = 1; z = 1

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 73

2.2
Construct Solutions Of Polynomial Equation

At the end of this topic, you should be able to :

 Construct solutions of polynomial equation


 Use the Fixed Point Iteration method.
 Use the Newton-Raphson method.

Polynomial equations also known as nonlinear equation which means that f(x) is not simply of the
form ax + b. These methods are used for tracing the source iteration by using two or one starting
points.

2.2.1
Use The Fixed Point Iteration Method

Example 1

Determine the roots for equation 5𝑥𝑒 𝑥 = 1 correct to 4 decimal places by using Fixed Point Iteration
Method. Given that 𝑥0 = 1.

Solution

Step 1 : Make x as a subject.

5𝑥𝑒 𝑥 = 1
1
𝑥= 𝑥
5𝑒

Step 2 : Build a table.

𝑥𝑛 1
𝑥𝑛+1 =
5𝑒 𝑥
𝑥0 = 1 𝑥1 = 0.0736
𝑥1 = 0.0736 𝑥2 = 0.1858
𝑥2 = 0.1858 𝑥3 = 0.1661
𝑥3 = 0.1661 𝑥4 = 0.1694
𝑥4 = 0.1694 𝑥5 = 0.1688
𝑥5 = 0.1688 𝑥6 = 0.1689
𝑥6 = 0.1689 𝑥7 = 0.1689

∴ The approximate root is 𝑥7 =0.1689.

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 74

Example 2

Determine the roots for equation 𝑥 4 − 𝑥 = 10 correct to 3 decimal places by using Fixed Point
Iteration Method. Given that 𝑥0 = 1.

Solution

Step 1 : Make x as a subject.

𝑥 4 − 𝑥 = 10
𝑥 = 𝑥 4 − 10

Step 2 : Build a table.

𝑥𝑛 𝑥𝑛+1 = 𝑥 4 − 10
𝑥0 = 1.000 𝑥1 = −9.000
𝑥1 = −9.000 𝑥2 = 6551.000 Impossible answer
𝑥2 = 6551.000 𝑥3 = 1.841 x 1015

∴ Repeat step 1.

Step 1 : Rewrite the equation in the x form.

𝑥 4 − 𝑥 = 10
𝑥 4 = 10 + 𝑥
4
𝑥 = √10 + 𝑥

Step 2 : Build a table.

4
𝑥𝑛 𝑥𝑛+1 = √10 + 𝑥
𝑥0 = 1.000 𝑥1 = 1.821
𝑥1 = 1.821 𝑥2 = 1.854
𝑥2 = 1.854 𝑥3 = 1.855
𝑥3 = 1.855 𝑥3 = 1.855

∴ The approximate root is 𝑥3 = 1.855

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 75

Exercise:

1. Determine the root for equation 𝑥 − 𝑒 −𝑥 = 0 correct to 3 decimal places by using Fixed Point
Iteration Method. Given that 𝑥0 = 3.

Answer 1: x = 0.567

2. Solve the following equation by using Fixed Point Iteration Method correct to 3 decimal places.
Given that 𝑥0 = 1.
i) 𝑒 𝑥 − 3𝑥 2 = 0 Answer 2i: x = 0.910
ii) 𝑥 2 + 5𝑥 − 3 = 0 Answer 2ii: x = 0.541

3. Find the root for equation 𝑥 3 − 5𝑥 − 16 = 0 correct to 4 decimal places with an initial assumption
of 𝑥0 = 3.5 by using Fixed Point Iteration Method.

Answer 3: x = 3.1698

4. Obtain the root for equation 4𝑥𝑒 𝑥 = 1 by using Fixed Point Iteration Method. Give your answer
in 4 decimal places with an initial assumption of 𝑥0 = 1.

Answer 4: x = 0.2039

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 76

2.2.2
Example 1 Use The Newton-Raphson Method

Solve the equation 𝑓(𝑥) = 3𝑥 3 + 2𝑥 − 4 correct to 3 decimal places by using The Newton-Raphson
Method. Given that 𝑥 = 0 and 𝑥 = 1.

Solution

𝟏 𝒙𝟏 𝒚𝟏
Step 1 : Calculate 𝒙𝟎 = |𝒙 𝒚𝟐 |
𝒚𝟐 −𝒚𝟏 𝟐

When 𝑥1 = 0
𝑦1 = 3𝑥 3 + 2𝑥 − 4
𝑦1 = 3(0)3 + 2(0) − 4
𝑦1 = −4

When 𝑥2 = 1
𝑦2 = 3𝑥 3 + 2𝑥 − 4
𝑦2 = 3(1)3 + 2(1) − 4
𝑦2 = 1

1 𝑥1 𝑦1
𝑥0 = |𝑥 𝑦 |
𝑦2 − 𝑦1 2 2
1 0 −4
𝑥0 = | |
1 − (−4) 1 1
1
𝑥0 = |0 − (−4)|
5
4
𝑥0 =
5
𝑥0 = 0.8

Step 2 : Build a table.

𝑓(𝑥)
𝑥𝑛 𝑓(𝑥) = 3𝑥 3 + 2𝑥 − 4 𝑓 ′ (𝑥) = 9𝑥 2 + 2 𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥)
𝑥0 = 0.800 -0.864 7.760 𝑥1 = 0.911

𝑥1 = 0.911 0.090 9.469 𝑥2 = 0.901

𝑥2 = 0.901 -0.003 9.306 𝑥3 = 0.901

∴ The approximate real root is 𝑥3 =0.901.

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 77

Example 2

The critical speed of oscillation,  of a loaded beam is given by the equation :

𝜆3 − 3.250𝜆2 + 𝜆 − 0.063 = 0

Determine the value of  which is approximately equal to 3.0 by Newton Raphson Method correct to
4 decimal places.

Step 1 : Build a table.

𝑓(𝑥)
𝑥𝑛 𝑓(𝑥) = 𝜆3 − 3.250𝜆2 + 𝜆 − 0.063 𝑓 ′ (𝑥) = 3𝜆2 − 6.5 + 1 𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥)
𝑥0 = 3.0000 0.6870 8.5000 𝑥1 = 2.9191

𝑥1 = 2.9191 0.0364 7.5892 𝑥2 = 2.9143

𝑥2 = 2.9143 0.0001 7.5364 𝑥3 = 2.9142

𝑥3 = 2.9142 -0.0006 7.5353 𝑥4 = 2.9142

∴ The approximate real root is 𝑥4 =2.9142.

Chapter 2 : Numerical Method


DBM3013 ENGINEERING MATHEMATICS 3 78

Test :

1. Determine the roots for equation y = cos 𝑥 − 𝑥 2 correct to 4 decimal places by using Fixed Point
Iteration Method. Given that 𝑥0 = 0.7114. Give your answer correct to 3 decimal places.

Answer 1: x = 0.824

2. Solve the equation 𝑒 −𝑥 − 𝑥 = 0 correct to 3 decimal places by using The Newton-Raphson


Method. Given that 𝑥 = 0 and 𝑥 = 1. Give your answer correct to 3 decimal places.

Answer 2: x = 0.567

3. By using the Newton Raphson Method, solve the following equation 𝑥 2 + 5𝑥 − 3 = 0. Given that
𝑥 = 0 and 𝑥 = 1. Give your answer correct to 3 decimal places.

Answer 3: x = 0.541

4. Solve the equation of 𝑥 3 + 3𝑥 2 − 2 = 0 by using Newton Raphson Method. State your answer to
3 decimal places with an initial guess of 𝑥0 = 1.

Answer 4: x = 0.732

Chapter 2 : Numerical Method

You might also like