Rootfinding: The Bisection Method
Rootfinding: The Bisection Method
Steps:
Step 1: Define
c = (a + b)
Step 2: If b c , accept c as the root, and then stop.
Step 3: If b c > , then check, compare the sign of f (c) to that
of f (a) and f (b). If sign(f (b)) sign(f (c)) 0 then replace a with
c; and otherwise, replace b with c. Return to Step 1.
Note: Denote the initial interval by [a1, b1], and denote each
successive interval by [aj, bj]. Let cj denote the center of [aj, bj].
Then
- cj bj cj = cj aj = (bj aj)
EXAMPLE: Find the largest root of
f (x) x6 x 1 = 0
accurate to within = 0.001.
SOLN:
It is easy to check that 1 < < 2.
Choose a = 1, b = 2; then f (a) = 1, f (b) = 61. The requirement
f (a) f (b) < 0 is satisfied.
It takes 10 iterations to find the largest root accurate to within
= 0.001 which is 1.1348.
ADVANTAGES AND DISADVANTAGES
Advantages:
1. It always converges.
Disadvantage:
Disadvantage:
3. It needs to know both f (x) and f(x). Contrast this with the bisection
method which requires only f (x).
THE SECANT METHOD:
Using an approximating line based on interpolation.
We assume we have two estimates of the root , say x0 and x1.
Then we produce a linear function
q(x) = a0 + a1x
with
q(x0) = f (x0), q(x1) = f (x1)
This line is sometimes called a secant line. Its equation is given
by
q(x) = [(x1 x) f (x0) + (x x0) f (x1)] / x1 x0
This is linear in x; and by direction evaluation, it satisfies the
interpolation conditions of q(x0) = f (x0), q(x1) = f (x1).
We now solve the equation q(x) = 0, denoting the root by x2.
This yield
x2 = x1 {f (x1) [f (x1) f (x0)] / (x1 x0)}
Repeat the process. Use x1 and x2 to produce another secant
line, and then uses its root to approximate . This yields the
general iteration formula
xn+1 = xn f (xn) [f (xn) f (xn1)] / (xn xn1), n= 1, 2, 3...
This is called the secant method for solving f (x) = 0.
The secant method requires more iterates than the Newton
method. But note that the secant method does not require a
knowledge of f( x), whereas Newtons method requires both f
(x) and f (x).
Note also that the secant method can be considered an
approximation of the Newton method.
By using the approximation
Disadvantages: