Use the bisection method to find a root of the function

f(x) = cos(x) - x.

Using MPP:

Since f(0) > 0 and f(1) < 0, we use the bisection method on the closed interval [0,1].

  1. At the main menu, use the arrow keys to move to 2. Root (Root finding by Newton, bisection or secant) and press .
  2. At the prompt for method, type in b for the bisection method.
  3. At the prompt for function, type:
    cos(x) - x
  4. Enter the bounds:
    Xmin = 0 Xmax = 1 .
    One advantage of this program is that at this point the function evaluated at Xmin and Xmax need not have opposite signs.
  5. Press .
  6. At the prompt, Number of digits accuracy, type 6
  7. and press to draw the graph.
  8. At this point, you will see the graph and you will be prompted to enter the left hand endpoint of the subinterval to use; type 0 and, at the prompt for the right hand endpoint, type 1 .
  9. You will now see the program subdivide the interval and pick the appropriate subinterval. This process continues until the subinterval is too small to visualize and the program then rescales the coordinates. The endpoints of the subintervals together with the midpoint are shown at the left of the screen. A copy of one of the screens is

  10. Press to return to the screen at which you entered the endpoints of the first subinterval. You could try to find another root of the function at this time. Press to return to the screen at which you entered the function. If you press and Y you will return to the main menu.