1
Chapter 5
Bracketing Method
2
• Easy
• But, not easy
• How about these?
a
acbbxcbxax
2
40
22
? 02345 xfexdxcxbxax
Roots of Equations
? 0)3sin()10cos(
? 0sin
xxx
xxx
Graphical Approach
• Make a plot of the
function f(x) and
observe where it
crosses the x-axis,
i.e. f(x) = 0
• Not very practical
but can be used to
obtain rough
estimates for roots
• These estimates can
be used as initial
guesses for numerical
methods that we’ll
study here.
Using MATLAB, plot f(x)=sin(10x)+cos(3x)
4
Why Called Bracketing Methods?
They require two initial guesses which “bracket”
either side of the root.
5
Example1: the parachutist problem
Given m = 68.1 kg, v = 40 m/s, t = 10 s, g = 9.8 m/s2, find the corresponding c
Graphical Methods
40138667
40116889
1 146843010168 )(
.)(
).(.)()(
.)./()/( cctmc ec
ec
vec
gmcf
)()/( tmce
c
gmv 1
Make a plot of the function and observe where it crosses the x axis
Solution:
c f(c)
4 34.115
8 17.653
12 6.067
16 -2.269
20 -8.401
Root is between 12 and 16
6
Estimate Properties of Roots By Graphical Methods
From (a) and (c):
if both f(xl) and f(xu) have the same sign, there must be 0 or even number of roots
From (b) and (d):
if f(xl) and f(xu) have different signs, there must be 1 or odd number of roots
Exceptions:
multiple roots
f(x) = (x-2)2(x-4)
discontinuous f(x)
7
Find x such that f(x) = 0:
Step 1: Choose lower xl and upper xu such that f(xl)f(xu) < 0
Step 2: an estimate of the root
Step 3: Make the evaluations to determine in which interval the root lies:
(a) if f(xl)f(xr) < 0, the root lies in the lower interval; set xu = xr and
return to Step 2.
(b) if f(xl)f(xr) > 0, the root lies in the upper interval; set xl = xr and
return to Step 2.
(c) if f(xl)f(xr) = 0, the root = xr, stop.
Bisection Method
2
ulr
xxx
8
s
t
rt
tx
xx
%100
||
||
snewr
oldr
newr
ax
xx
%
||
||100
Error Estimates
But, we don’t know xt !
As an alternative, use:
true relative error εt, approximate relative error εa,
and acceptable error εs
9
Example 1
10
11
Example 2
12
f(x) = sin x – x3
13
14
Conservative Overestimate by a
a is always larger than t !
a
t
15
Bisection Method
Pros
• Easy
• Always finds a root
• Number of iterations
required to attain an
absolute error.
Cons
• Slow
• Need to find initial
guesses for xl and xu
• No account is taken
of the fact that if f(xl)
is closer to zero, it is
likely that root is
closer to xl .
16
17
Incremental Search and Determining Initial Guesses
• For every interval xi – xi+1, apply bisection or false-
position method to find the roots in the interval
• Only roots in x4-x5 will be found