Professional Documents
Culture Documents
Learning Outcomes :
2.1
Construct Solutions Of Linear Equations
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.
𝒂𝟐𝟏
Step 2 : Make a21 = 0 by using formula 𝑹𝟐 − ( ) (𝑹𝟏 ) apply to all elements in second row (R2).
𝒂𝟏𝟏
𝒂𝟑𝟏
Step 3 : Make a31 = 0 by using formula 𝑹𝟑 − ( ) (𝑹𝟏 ) apply to all elements in third row (R3).
𝒂𝟏𝟏
𝒂𝟑𝟐
Step 4 : Make a32 = 0 by using formula 𝑹𝟑 − ( ) (𝑹𝟐 ) apply to all elements in third row (R3).
𝒂𝟐𝟐
𝑎33 𝑥3 = 𝑏3
𝑏3
𝑥3 =
𝑎33
𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎22 𝑥2 = 𝑏2 − 𝑎23 𝑥3
𝑏2 − 𝑎23 𝑥3
𝑥2 =
𝑎22
Example 1
𝑥1 − 3𝑥2 + 2𝑥3 = 8
4𝑥1 − 𝑥2 − 𝑥3 = 9
3𝑥1 + 2𝑥2 + 𝑥3 = 21
Solution
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
𝑎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
4𝑥3 = 20
20
𝑥3 =
4
𝑥3 = 5
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
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
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.
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
1 −3 2 𝑥1 8
(4 −1 𝑥
−1) ( 2 ) = ( 9 )
3 2 1 𝑥3 21
𝑙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
1 0 0 𝑦1 8
(4 1 0) (𝑦2 ) = ( 9 )
3 1 1 𝑦3 21
1 −3 2 𝑥1 8
(0 11 −9 ) ( 𝑥2 ) = (−23)
0 0 4 𝑥3 20
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
𝑥 − 3𝑦 + 𝑧 = 4
2𝑥 − 8𝑦 + 8𝑧 = −2
−6𝑥 + 3𝑦 − 15𝑧 = 9
1 −3 1 𝑥 4
(2 −8 8 ) (𝑦) = (−2)
−6 3 −15 𝑧 9
𝑙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
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
1 −3 1 𝑥 4
(0 −2 6 ) (𝑦) = (−10)
0 0 −54 𝑧 108
Example 3
Find the LU factorization of the following matrix above using Doolittle Method.
Solution
𝑙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.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.
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
1 −3 2 𝑥1 8
(4 −1 −1) (𝑥2 ) = ( 9 )
3 2 1 𝑥3 21
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
1 0 0 𝑦1 8
(4 11 0) (𝑦2 ) = ( 9 )
3 11 4 𝑦3 21
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
Example 2
Solve the following simultaneous equation using LU Decomposition With Crout Method.
2𝑥 + 9𝑦 − 3𝑧 = 5
4𝑦 − 2𝑧 = 0
−𝑥 − 5𝑦 + 4𝑧 = 11
Solution
2 9 −3 𝑥 5
(0 4 −2) (𝑦) = ( 0 )
−1 −5 4 𝑧 11
−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
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
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
Exercise:
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
9) −𝑥1 + 2𝑥2 + 𝑥3 = 0
8𝑥2 + 6𝑥3 = 10
−2𝑥1 + 5𝑥3 = −11 Answer 9: x1 = 3; x2 = 2; x3 = -1
11) 𝑥 + 𝑧 = 4 + 3𝑦
2𝑥 − 8𝑦 + 8𝑧 = −2
3𝑦 − 15𝑧 = 6𝑥 + 9 Answer 11: x = 3; y = -1; z = -2
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
2.2
Construct Solutions Of Polynomial Equation
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
5𝑥𝑒 𝑥 = 1
1
𝑥= 𝑥
5𝑒
𝑥𝑛 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
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
𝑥 4 − 𝑥 = 10
𝑥 = 𝑥 4 − 10
𝑥𝑛 𝑥𝑛+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.
𝑥 4 − 𝑥 = 10
𝑥 4 = 10 + 𝑥
4
𝑥 = √10 + 𝑥
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
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
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
𝑓(𝑥)
𝑥𝑛 𝑓(𝑥) = 3𝑥 3 + 2𝑥 − 4 𝑓 ′ (𝑥) = 9𝑥 2 + 2 𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥)
𝑥0 = 0.800 -0.864 7.760 𝑥1 = 0.911
Example 2
𝜆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.
𝑓(𝑥)
𝑥𝑛 𝑓(𝑥) = 𝜆3 − 3.250𝜆2 + 𝜆 − 0.063 𝑓 ′ (𝑥) = 3𝜆2 − 6.5 + 1 𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥)
𝑥0 = 3.0000 0.6870 8.5000 𝑥1 = 2.9191
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
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