Lecture 5 - Solving Equations by Bisection Method
Lecture 5 - Solving Equations by Bisection Method
Outline
• Bisection Method
• Graphical Representation
• Bisection Formula
• Solved Example
• Self-Check Exercise
Bisection Method
• The bisection method (sometimes called the midpoint method for equations) is a
method used to estimate the solution of an equation.
• It is used to find the roots of a polynomial equation.
• It separates the interval and subdivides the interval in which the root of the
equation lies.
• The principle behind this method is the intermediate theorem for continuous
functions. It works by narrowing the gap between the positive and negative
intervals until it closes in on the correct answer.
• This method narrows the gap by taking the average of the positive and negative
intervals. It is a simple method, and it is relatively slow.
Graphical Representation
•• The basis for this method can be easily illustrated by considering the following function: . One
objective is to find an value for which is zero. Using this method, the function can be evaluated at two
values, say and such that .
• The implication is that one of the values is negative and the other is positive. Also, the function must
be continuous for
• These conditions can be easily satisfied by sketching the function as shown in the following figure:
• Looking at the figure, it is clear that the function is negative at f(b) and positive at f(a), and is
continuous.
Bisection Formula
• Therefore,
the root must between f(a) and f(b) and a new approximation to the
root can be calculated as
• The idea for the Bisection Algorithm is to cut the interval [a,b] you are given in
half (bisect it) on each iteration by computing the midpoint xmid. The midpoint will
replace either a or b depending on if the sign of f(xmid) agrees with f(a) or f(b).
Step 1: Compute xmid = (a+b)/2
Step 2: If sign(f(xmid)) = 0 then end algorithm
else If sign(f(xmid)) = sign(f(a)) then a = xmid
else b = xmid
Step 3: Return to step 1
Bisection Error
• The error is usually measured by looking at the width of the current interval you
are considering (i.e. the distance between a and b). The width of the interval at
each iteration can be found by dividing the width of the starting interval by 2 for
each iteration. This is because each iteration cuts the interval in half. If we let the
error we want to achieve err and n be the iterations we get the following:
Example
•Using
graphical methods, the following function was found to have a real root
between and