Lesson 2 pt.2
Lesson 2 pt.2
METHODS OF ROOT-FINDING
NUMERICAL METHODS AND ANALYSIS
LESSON 2
PRESENTED BY: ENGR. ROMULO C. CRUZ JR.
ITERATIVE OPEN
METHODS
LESSON 2
ITERATIVE OPEN METHODS
➢ Newton-Raphson method
➢ Secant method
The equation f(x) = 0 can be transformed into x = g(x), and choosing an initial
guess x0, successive approximations can be obtained:
x1 = g(x0)
x2 = g(x1)
⋮
xn+1 = g(xn)
SOLUTION:
The equation can be written as
8
𝑥 = 𝑥 3 +2 𝑔(𝑥)
If 𝑥0 = 1, then
8 8
𝑥1 = 𝑥 3 +2
= 13+2 = 2.667
0
EXAMPLE PROBLEM 5
8 8
𝑥2 = 𝑥 3 +2 = 2.6673 +2 = 0.382
1
8 8
𝑥3 = 𝑥 3 +2 = 0.3823 +2 = 3.892
2
8 8
𝑥4 = 𝑥 3 = 3.8923 +2 = 0.131
3 +2
8 8
𝑥5 = 𝑥 3 +2 = 0.1313 +2 = 3.995
4
8 8
𝑥6 = = = 0.122
𝑥5 3 +2 3.9953 +2
8 8
𝑥7 = = = 3.996
𝑥6 3 +2 0.1223 +2
If 𝑥0 =1, then
1Τ
𝑥1 = 8 − 2(1) 4 = 1.565
1Τ
𝑥2 = 8 − 2(1.565) 4 = 1.486
1Τ
𝑥3 = 8 − 2(1.486) 4 = 1.497
1Τ
𝑥4 = 8 − 2(1.497) 4 = 1.496
1Τ
𝑥5 = 8 − 2(1.496) 4 = 1.496
This converges to 1.496. For other values of x0, refer to the Table below:
n 0 1 2 3 4 5 6
𝑥𝑛 1 1.565 1.486 1.498 1.496 1.496
𝑥𝑛 2 1.414 1.508 1.494 1.496 1.496
𝑥𝑛 3 1.189 1.540 1.489 1.497 1.496 1.496
Find a negative root of the equation x3 + 2x2 – x – 1 = 0. Round off to 3 decimal digits.
SOLUTION:
1Τ
Re-write as 𝑥 = 1 + 𝑥 − 2𝑥 2 3
1Τ
By fixed point iteration: 𝑥𝑛+1 = 1 + 𝑥𝑛 − 2𝑥𝑛 2 3
If 𝑥0 = 1, then
1Τ
𝑥1 = 1 + 1 − 2(1)2 3 =0
1Τ
𝑥2 = 1 + 0 − 2(0)2 3 =1
1Τ
𝑥3 = 1 + 1 − 2(1)2 3 = 0 ==> Diverging!
EXAMPLE PROBLEM 6
If 𝑥0 = 2, then
1Τ
𝑥1 = 1 + 2 − 2(2)2 3 = −1.710
1Τ
𝑥2 = 1 − 1.710 − 2(−1710)2 3 = −1.872
1Τ
𝑥3 = 1 − 1.872 − 2(−1.872)2 3 = −1.990
1Τ
𝑥4 = 1 − 1.990 − 2(−1.990)2 3 = −2.073
1Τ
𝑥5 = 1 − 2.073 − 2(−2.073)2 3 = −2.130
n 0 1 2 3 4 5 6 7 8 9 10
xn 1 0 1 0
xn 2 -1.710 -1.872 -1.990 -2.073 -2.130 -2.169 -2.195 -2.213 -2.225 -2.232
n 11 12 13 14 15 16 17
xn
xn -2.237 -2.240 -2.242 -2.244 -2.245 -2.246 -2.246
In a similar manner,
𝑓 𝑥1
𝑥2 = 𝑥1 −
𝑓′ 𝑥1
If 𝑥0 = 1, then
𝑓 𝑥0 = 14 + 2 1 − 8 = −5
𝑓 ′ 𝑥0 = 4 1 3 +2=6
𝑓 𝑥0 −5
𝑥1 = 𝑥0 − 𝑓′ = 1− = 1.833
𝑥0 6
𝑓 𝑥1 6.955
𝑥2 = 𝑥1 − 𝑓′ = 1.833 − = 1.572
𝑥1 26.635
𝑓 𝑥2 1.251
𝑥3 = 𝑥2 − 𝑓′ = 1.572 − = 1.501
𝑥2 17.539
𝑓 𝑥3 0.078
𝑥4 = 𝑥3 − 𝑓′ 𝑥3
= 1.501 − 15.527
= 1.496
𝑓 𝑥4 7.16x10−4
𝑥5 = 𝑥4 − = 1.496 − = 1.496
𝑓′ 𝑥4 15.392
The slope of the secant line at points (xn+1, f(xn+1)) and (xn, f(xn)) is equal to the
slope at points (xn, f(xn)) and (xn-1,f(xn-1)):
as this may lead to loss of significant digits (if 𝑥𝑛 and 𝑥𝑛−1 are almost equal)
Using Secant method, find a positive root of the equation x4 + 2x – 8 = 0. Round off to 3 decimal
digits.
where: 𝑓 𝑥 = 𝑥 4 + 2𝑥 − 8
Let 𝑥0 = 1, 𝑥1 = 2
𝑓(𝑥1 ) 𝑥1 −𝑥0 12 2−1
𝑥2 = 𝑥1 − =2− = 1.294
𝑓 𝑥1 −𝑓(𝑥0 ) 12− −5
Therefore, as in the Newton-Raphson and fixed-point iteration methods, the root is 1.496.
The Table shows the summary of the calculated values.
Using Secant method, find a positive root of the equation x sinx + cosx = 0.
Round off to 3 decimal digits.
SOLUTION:
Iteration n xn xn-1 f(xn) f(xn-1) xn+1
1 1 3 2 - 0.567 1.402 2.712
Let 𝑥0 = 2 , 𝑥1 = 3
2 2 2.712 3 0.220 - 0.567 2.793
𝑓 𝑥 = 𝑥 sin 𝑥 + cos 𝑥
𝑓 𝑥𝑛 (𝑥𝑛 −𝑥𝑛−1 ) 3 3 2.793 2.712 0.014 0.220 2.799
𝑥𝑛+1 = 𝑥𝑛 − 𝑓 𝑥𝑛 −𝑓(𝑥𝑛−1 )
4 4 2.799 2.793 - 0.002 0.014 2.798
by: (i) fixed point iteration, (ii) Newton-Raphson method, and (iii)
secant method. Round off your answer to three decimal places.