find the real root of x^3-5x+1 by regula-falsi method.
f(x) = x^2 - 5x + 1
Test for a root
f(0) = 1, f(1) = -3.
There is a change of sign between f(0) and f(1) , so there is a root between x = 0 and x = 1.
The first (smallest) false root is denoted as a, the second (greatest) false root is denoted by b, the interpolated (false) root is denoted by c and c is given by,
c = (a.f(b) - b.f(a)) / (f(b) - f(a))
After c is determined, it will replace either a or b for the next iteration. The sign of f(c) is found, and c will replace a if f(c) has same sign as f(a), otherwise it will replace b.
a |
b |
f(a) |
f(b) |
c=(a.f(b) - b.f(a)) / (f(b) - f(a)) |
sign(f(c)) |
Regula-falsi method
0 |
1 |
1 |
-3 |
0.25 |
-ve |
0 |
0.25 |
1 |
-.234375 |
0.2025668264 |
-ve |
0 |
0.2025668264 |
1 |
-0.4522143e-2 |
0.2016336225 |
+ve |
0.2016336225 |
0.2025668264 |
0.0000295283 |
-0.4522143e-2 |
0.2016396263 |
+ve |
0.2016396263 |
|
2.406*10^(-7) |
|
|
|
When c reaches the value 0.2016396263, f(c) = 2.406*10^(-7), which is small enough to allow c to be taken as a real root of f(x).
Root of f(x) is: c = 0.2016396263