![]()
![]()
Lab for the Bisection Method
![]()
Bisection Method. To find a root of the equation f(x) = 0 in the interval [a,b]. Proceed with the method only if f(x) is continuous and f(a) and f(b) have opposite signs.
Example. Find
the solution to the equation
in the interval [0,3].
Use the bisection method to compute a solution with an accuracy of
.
Solution. Since
we will use 21 iterations.
![]()
![[Graphics:bi.txtgr7.gif]](bi.txtgr7.gif)
Bisection[0.0, 3.0, 21]![]()
Report to be handed in.
Computer Exercises
![]()
Exercise 1. Find solutions to the equation
on the intervals [0,1], [1.5, 2.5] and [3,4].
Use the bisection method to compute a solution with an accuracy of
.
Determine the number of iterations to use. Include a printout of
iterations in your report.
Solution. Since
you should use 23 iterations.
![]()
![[Graphics:bi.txtgr13.gif]](bi.txtgr13.gif)
Bisection[0.0, 1.0, 23];![]()
![]()
![]()
![]()
Exercise 2. Consider f(x) = tan(x) on the interval (0,3). Use the 20 iterations of the bisection method and see what happens. Explain the results that you obtained.
f[x_] = Tan[x]
Bisection[0.0, 3.0, 20];
The function 0 = tan(x) does not have a solution in the interval
(0,3). However, it does have a vertical asymptote at x=
.
Since tan(x) has opposite signs on each side of x=
,
the bisection method converges to
.
![]()
![[Graphics:bi.txtgr24.gif]](bi.txtgr24.gif)
![]()
![]()
(c) John H. Mathews, 1998