Sei sulla pagina 1di 11

Part 2 APPROXIMATION METHODS

MAT 295

Chapter 10

Bisection
Method
At the end of this chapter, students should be able to:

Define the location at which a non-linear function equals zero

Derive and apply Bisection method

10.1 Introduction
Chapter 10 shall discuss one of the most basic problems in numerical
analysis: finding values of a variable x that satisfy the equation f ( x ) 0 . A
solution to this problem is called a zero of f (x ) or a root of f (x ) . In this
chapter, the focus of our discussion will be on solving non-linear equations.
Before further discussion, lets take a look at some classes of functions:
(a)

linear functions:
f ( x ) ax b

(b)

polynomials (non-linear):
f ( x ) an x n an 1x n 1 an 2 x n 2 ... a2 x 2 a1x a0 ,

(c)

transcendental functions (non-linear):


f ( x ) tan x x

f ( x ) e x 3 ln 2x

135

n 1

Part 2 APPROXIMATION METHODS

MAT 295

10.2 Root Finding


In any algebra books we learn that the real roots of a quadratic function can
be found either by factorizing or by using standard formula i.e. quadratic
formula. Even if the roots are irrational, they can always be found.
The roots of a polynomial of higher degree can also be found by using the
factor theorem (only when the roots are integers or simple rational fractions).
There are many equations whose roots cannot be evaluated exactly by any
methods. The approximate value of the roots of such equations can be found
either by a graphical approach or by one of a number of methods using
successive numerical approximations or by a combination of these processes.
Basically when we are discussing about finding roots, we want to find out
where
(i)

the function f (x ) crosses the x-axis or

(ii)

two equations intersect each other (Figure 10.1).

y=f(x)

y=f(x)

x
r

0
root

root

x
y=g(x)

(a) f(x) crosses x-axis

(b) two equations intersect


each other

Figure 10.1

Definition
Given an equation f ( x ) 0 , the function f (x ) is non-linear if it is not of the
form ax b .

Definition
If a function f (x ) is continuous on the interval (a, b) and if f (a) and f (b )
have different signs (one positive and one negative) or f (a) f (b) 0 , then
there exists at least one real root on the interval (a, b) .

136

Part 2 APPROXIMATION METHODS

MAT 295

Take a note that the definition demands that the function f (x ) be continuous
on the given interval. Figure 10.2 shows two cases that may occur
if f (a) f (b) 0 .
y

f(b)

f(b)

0
a

0
f(a)

f(a)

(a) f(x) is continuous

(b) f(x) is not continuous

Figure 10.2

Steps : Root finding


Identify the interval (a, b)
Identify the function f (x ) and compute f (a ) and f (b)
Determine if f (a) f (b) 0 then r [a, b]

Example 1
Show that f ( x ) x 3 has a root in the interval [-1, 2].

Solution

Identify the interval


[-1, 2]

a = -1 and

b=2

Identify the function and compute f (a) and f (b)


f (x) x3
f ( 1) 1

or

x3 0
f (2) 8

Determine if f (a) f (b) 0


f (2) f (1) (1)(8) 8 0

Since f (2) f (1) 0 it can be concluded that there exists a root in [-1, 2].

137

Part 2 APPROXIMATION METHODS

MAT 295

Example 2
Given x 3 x 1 0 , show that one of the solutions of the equation lies
between -2 and 1.

Solution

Identify the interval

[-2, 1]

a = -2 and

b=1

Identify the function and compute at a and b

x3 x 1 0

or

h(2) 5

h(1) 1

h( x ) x 3 x 1

Determine if h(a) h(b) 0


h(2) h(1) (5)(1) 5 0

Hence, there exists a root in the interval [-2, 1].

Example 3
Let e x x 2 0 . Determine the interval of the root of the function of
interest.

Solution

Identify the function :


ex x 2 0

f (x) ex x 2

In order to determine the interval of the root, lets plot the graph. There
are two options to do this.
(i)

Plot f ( x ) e x x 2 or

(ii)

Break f ( x ) e x x 2 to two simpler functions, i.e.


ex x 2 0
ex 2 x
h( x ) g ( x )

138

Part 2 APPROXIMATION METHODS

(a) f ( x ) e x x 2

MAT 295

(b) h( x ) e x and g( x ) 2 x
Figure 10.3

Based on Figure 10.3 it can be shown that there exists a root in [0, 1].
Example 1 3 showed the existence of a root between given intervals. The
examples did not provide the procedure to determine the root. There are a
number of procedures that can be used to locate the desired root.

Warm up exercise

Determine the existence of a root for the following functions in a given


interval.
(i)

f ( x ) x 3 6 x 16

(ii) f ( x ) cos x cos 3x

(iii)

[1, 2]


2 , 2

1 x
ln
0
1 x 2

The procedure of solving a non-linear equation numerically is different from


the procedure of solving the equation analytically. Analytical method of root
finding attempted to find exact solution to the equation. Not all equations can
be solved analytically. In many instances in real applications, it is impossible
or cumbersome to find the root analytically, thus the equation is solved

139

Part 2 APPROXIMATION METHODS

MAT 295

numerically. Numerical method of solving non-linear equation begins with a


rough estimate of the root. The information is used to produce a better
estimate. The process is repeated until a desired accuracy is achieved. The
repetition process is also known as iterative method of root finding. In this
chapter, we are going to discuss two numerical methods of root finding
namely
(i) Bisection method
(ii) Newtons method

10.3 Bisection Method


The simplest numerical technique that shall first be discussed here is the
Bisection method or sometimes called the method of halving of intervals. The
method is based on the Intermediate Value theorem and attempts to locate a
solution to the equation f ( x ) 0 in a sequence of intervals of decreasing
size.
y

r1

r2

r3

f(b)
0

f(a)

Figure 10.4

In order to apply the Bisection method, we have to assume the function f (x )


is continuous on the interval (a, b) such that f (a) f (b) 0 . Hence, there
exists at least one value r in the interval (a, b) in which f (r ) 0 (r is the root).
The interval is then halved or divided into two subintervals by the midpoint of
a and b. Checking is done to locate in which of the two smaller subintervals
the root lie. The process is repeated until a desired accuracy is achieved
(Figure 10.4).

140

Part 2 APPROXIMATION METHODS

MAT 295

Steps : Bisection Method


Identify the equation and determine f (x )
Identify the existence of a root : f (a) f (b) 0
ab
Compute c
and f (c )
2
Determine if

f (a) f (c ) 0 then r (a, c )

f (b) f (c ) 0 then r (c, b)


Repeat until desired iteration/accuracy

Example 4
The solution of the equation x 3 0 is known to exist between the values 1 and 2. Apply the Bisection method with 3 iterations to reduce the interval
of the root.

Solution

Identify the equation and determine f (x )

x3 0

f (x) x3

or

Identify the existence of a root


[-1, 2]

f (x) x3

a = -1 and
f ( 1) 1

b=2
f (2) 8

f ( 1) f (2) ( 1)(8)
8 0

Compute c

and

ab
2

1 2
0.5
2
f (0.5) 0.125

Determine

f (1) f (0.5) (1)(0.125) 0

f (0.5) f (2) (0.125)(8) 0

Since f (1) f (0.5) 0 then r (1, 0.5)


141

Part 2 APPROXIMATION METHODS

MAT 295

Repeat until desired iterations/accuracy

f (x) x3

Root in

Bisection

-1

-1.000

8.000

[-1, 2]

0.5

0.125

[-1, 0.5]

-0.25

-0.25

-0.016

[-0.25, 0.5]

0.125

0.5

Hence, after 3 iterations, the estimated root is 0.125.

Example 5
Given h( x ) x 3 x 1 , justify that one of the roots of this function lies
between -2 and 1. Hence, use the Bisection method to calculate the
approximation to 2 significant digits.

Solution

Identify the equation

x3 x 1 0

or

h( x ) x 3 x 1

Identify the existence of a root


[-2, 1]

a = -2 and

b=1

h( x ) x 3 x 1

h( 2) 5

h(1) 1

h( 2) h(1) ( 5)(1)
5 0

Compute c

ab
2

2 1
0.5 and
2

h(0.5) 1.375

Determine

h(2) h(0.5) (5)(1.375) 0

h(0.5) h(1) (1.375)(1) 0

Then r (2, 0.5) .

142

Part 2 APPROXIMATION METHODS

MAT 295

Repeat until desired iteration/accuracy

h( x ) x 3 x 1

root in

Bisection
-0.5

-2

-5.000

1.000

[-2, 1]

-0.5

1.375

[-2, -0.5]

-1.250

-1.250

0.297

[-2, -1.25]

-1.625

-1.625

-1.666

[-1.625, -1.25]

-1.438

-1.438

-0.536

[-1.438, -1.25]

-1.344

-1.344

-0.084

[-1.344, -1.25]

-1.297

The root of h( x ) x 3 x 1 approximated to 2 significant digits is r 1.3 .

Example 6
The equation e x 2 x has one solution. Estimate the solution to 2
decimal places.

Solution

Identify the equation and determine f (x )


ex 2 x

ex x 2 0

or

Identify the existence of a root


There exists a root in [0, 1].

Compute c
c

f (x) ex x 2

(Refer Example 3)

ab
and f(c)
2

0 1
0.5
2

and

f(0.5) = 0.149

Determine
f (0) f (0.5) 0
f (0.5) f (1) 0

Then r (0, 0.5)

143

Part 2 APPROXIMATION METHODS

MAT 295

Repeat until desired iteration/accuracy


i

f (x) ex x 2

0.500

0.250

0.375

0.438

0.469

0.454

0.446

0.442

-1
1.718
0.149
-0.466
-0.17
-0.012
0.067
0.029
0.008
-0.002

Root in

Bisection

[0, 1]

0.500

[0, 0.500]

0.250

[0.250, 0.500]

0.375

[0.375, 0.500]

0.438

[0.438, 0.500]

0.469

[0.438, 0.469]

0.454

[0.438, 0.454]

0.446

[0.438, 0.446]

0.442

[0.442, 0.446]

0.444

The estimated root correct to 2 decimal places is r = 0.44.

Warm up exercise
Let f ( x ) x 3 x 1 in [1, 2].
(i)

Identify the existence of a root.

(ii)

Compute c

(iii)

Compute

ab
and f(c).
2

a)

f(1).f(c)

b)

f(2).f(c)

(iv)

Determine where the root lies.

(v)

Find the root accurate to 2 significant digits.

Exercise 10
1.

Given x 3 6x 16 0 .
a) show that there exists one real root in the interval (1, 2)
b) plot the graph and hence show and estimate the root.

2.

Apply the Bisection method to the equation sin x 0.75 0 in the interval
[0.8, 0.9] and try to determine the actual root correct to three decimal places.

144

Part 2 APPROXIMATION METHODS

3.

Determine the first four approximations of the actual root of the equation
x3

4.

MAT 295

1
0 in the interval [0,1] by the Bisection method.
2

By the method of Bisection determine the first three approximations of the


following equations

5.

(a) sin x x 3 1 0 ;

[-2, 0]

(b) x ln x 3 0 ;

[4, 5]

(c) f ( x ) cos x cos 3x ;


2 , 2

(d) 2x tan x ;

[0, 3]

Show that x 3 x 2 0 has a root between 1 and 2. Use the Bisection


method to approximate the root accurate to two decimal places.

6.

Using the Bisection method, solve x ln x 3 , given that the root is close to
the value 2. Obtain the root correct to two decimal places.

7.

Use the Bisection method to approximate the zero of f ( x ) 1 x x 2 in [0,


1]. Give your answers accurate to 2 significant digits.

8.

Solve 2 cos x e x accurate to one decimal place using the Bisection method.

145

Potrebbero piacerti anche