You are on page 1of 5

Secant method

Example:
Find one of the roots of the following equation using the Secant method

𝑓 𝑥 = 𝑥 4 +3𝑥 3 − 2𝑥 2 − 4𝑥 − 4 = 0 𝜀 = 0,01
1. choose any two initial values ( 𝑥1 𝑎𝑛𝑑 𝑥2 ) 1. choose any two initial values ( 𝑥1 𝑎𝑛𝑑 𝑥2 )

Example 𝑥1 = 1 dan 𝑥2 = 2 Example 𝑥1 = 2 dan 𝑥2 =3

2. substitute the value of 𝑥1 𝑎𝑛𝑑 𝑥2 into the 2. substitute the value of 𝑥1 𝑎𝑛𝑑 𝑥2 into the
equation 𝑓 𝑥𝑛 equation 𝑓 𝑥𝑛

𝑓 𝑥1 = 14 + 3 . 13 − 2 .12 − 4 .1 − 4 = −6 𝑓 𝑥1 = 24 + 3 . 23 − 2 .22 − 4 .2 − 4 = 20

𝑓 𝑥2 = 24 + 3 . 23 − 2 .22 − 4 .2 − 4 = 20 𝑓 𝑥2 = 34 + 3 . 33 − 2 .32 − 4 .3 − 4 = 128

𝑓 𝑥2 𝑥2 −𝑥1 𝑓 𝑥2 𝑥2 −𝑥1
3. 𝑥3 = 𝑥2 −
𝑓 𝑥2 −𝑓 𝑥1
3. 𝑥3 = 𝑥2 −
𝑓 𝑥2 −𝑓 𝑥1

20 . 2−1 128 . 3−2


𝑥3 = 2 − = 1,231 𝑥3 = 3 − = 1,815
20− −6 128−20
4. Substitute the value of 𝑥3 into the equation 4. Substitute the value of 𝑥3 into the equation
𝑓 𝑥𝑛 𝑓 𝑥𝑛

𝑓 𝑥3 = 1,2314 + 3 . 1,2313 − 2 .1,2312 𝑓 𝑥3 = 1,8154 + 3 . 1,8153 − 2 .1,8152

− 4 .1.231 − 4 = −4,062 − 4 .1.815 − 4 = 10,933


5. 𝑓 𝑥3 ≤𝜀 5. 𝑓 𝑥3 ≤𝜀
• If yes, 𝑥3 is one of the roots of the equation • If yes, 𝑥3 is one of the roots of the equation
• If No, continue iteration • If No, continue iteration

𝟒, 𝟎𝟔𝟐 > 𝟎, 𝟎𝟏 then the iteration is continued 𝟏𝟎, 𝟗𝟑𝟑 > 𝟎, 𝟎𝟏 then the iteration is continued

6. Next iteration 𝑥3 is changed to be 𝑥2 and 6. Next iteration 𝑥3 is changed to be 𝑥2 and


𝑥2 is changed to be 𝑥1 and 𝑥2 is changed to be 𝑥1 and

𝑥1 =2 dan 𝑥2 = 1,231 𝑥1 = 3 dan 𝑥2 = 1,815

7. substitute the value of 𝑥1 𝑎𝑛𝑑 𝑥2 into the 7. substitute the value of 𝑥1 𝑎𝑛𝑑 𝑥2 into the
equation 𝑓 𝑥𝑛 equation 𝑓 𝑥𝑛

𝑓 𝑥1 = 24 + 3 . 23 − 2 .22 − 4 .2 − 4 = 20 𝑓 𝑥1 = 34 + 3 . 33 − 2 .32 − 4 .3 − 4 = 20
𝑓 𝑥2 = 1,2314 + 3 .1,231 − 2 .1,2312 𝑓 𝑥2 = 1,2314 + 3 .1,231 − 2 .1,2312
− 4 .1,231 − 4 − 4 .1,231 − 4
= −4,062 = −4,062
𝑓 𝑥2 𝑥2 −𝑥1 𝑓 𝑥2 𝑥2 −𝑥1
8. 𝑥3 = 𝑥2 − 8. 𝑥3 = 𝑥2 −
𝑓 𝑥2 −𝑓 𝑥1 𝑓 𝑥2 −𝑓 𝑥1

(−4,062) . 1,231−2 10.933 . 1,815−3


𝑥3 = 1,231 − = 1,361 𝑥3 = 1,815 − = 1,704
(−4,602)− 20 10,933−128

9. Substitute the value of 𝑥3 into the equation 9. Substitute the value of 𝑥3 into the equation
𝑓 𝑥𝑛 𝑓 𝑥𝑛

𝑓 𝑥3 = 1,3614 + 3 . 1,3613 − 2 .1,3612 𝑓 𝑥3 = 1,7044 + 3 . 1,7043 − 2 .1,7042

− 4 .1.361 − 4 − 4 .1.704 − 4

𝑓 𝑥3 = −2,159 𝑓 𝑥3 = 6,656

10. 𝑓 𝑥3 ≤𝜀 10. 𝑓 𝑥3 ≤𝜀
• If yes, 𝑥3 is one of the roots of the equation • If yes, 𝑥3 is one of the roots of the equation
• If No, continue iteration • If No, continue iteration

𝟐, 𝟏𝟓𝟗 > 𝟎, 𝟎𝟏 then the iteration is continued 𝟔, 𝟔𝟓𝟔 > 𝟎, 𝟎𝟏 then the iteration is continued
iterasi X1 X2 X3 F(X1) F(X2) F(X3)
1 1.000 2.000 1.231 -6.000 20.000 -4.0650
2 2.000 1.231 1.361 20.000 -4.065 -2.1596
3 1.231 1.361 1.508 -4.065 -2.160 0.8786
4 1.361 1.508 1.465 -2.160 0.879 -0.1049
5 1.508 1.465 1.470 0.879 -0.105 -0.0042

iterasi X1 X2 X3 F(X1) F(X2) F(X3)


1 2.000 3.000 1.815 20.000 128.000 10.9327
2 3.000 1.815 1.704 128.000 10.933 6.6557
3 1.815 1.704 1.532 10.933 6.656 1.4707
4 1.704 1.532 1.483 6.656 1.471 0.2918
5 1.532 1.483 1.471 1.471 0.292 0.0183
6 1.483 1.471 1.470 0.292 0.018 0.0003
Exercises

Find one of the roots of the following equation using the Secant
method

𝑓 𝑥 = 𝑥 3 + 2𝑥 2 − 4𝑥 − 1 = 0 𝜀 = 0,01

You might also like