10 y 1010 plot fx x 44 y 1010 plot

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of axes ranges, and then narrow the view by choosing a smaller and smaller x-range. [> plot( f(x), x=-10..10, y = -10..10); [> plot( f(x), x=-4..4, y = -10..10); [> plot( f(x), x=-1..1, y = -10..10); iii Copyrighted by B.A. Forrest (bforrest@sympatico.ca) Newton’s Method in Maple The plots indicate that f (x) crosses the x-axis in the interval [0, 1]. This will be our starting interval for the Bisection Method. You could also confirm that f (x) changes sign over this interval by checking: [> f(0); [> f(1); Note that Maple tells us that f (0) = −1 < 0 and f (1) = 1 > 0. This calculation confirms that the root c lies somewhere between 0 and 1. So, using the notation of the Bisection Method from before, let a = 0 and b = 1 (i.e., the endpoints of the interval). To assign values to a variable in Maple, we use the assignment operator :=. In Maple, enter the following to assign values to “a” and ”b”: [> a := 0; [> b := 1.0; The midpoint d is found by calculating a+b 2. In Maple, this is: [> d := (a+b)/2; Maple tells us that the midpoint of the interval [0, 1] is d = 0.5. We must next find f (0.5) or equivalently, f (d) to continue with the algorithm and to find the side of the interval on which the midpoint c is located. [> f(d); Maple tells us f (d) = f (0.5) = −0.46875. Since f (a) = f (0) < 0 from above, the Bisection Method tells us to replace a by d. This means we must assign a the current value of d. [> a := d; Our current state in the Bisection Method is a = 0.5 and b = 1.0. We now know that c is located somewhere in the interval [0.5, 1.0]. To make sure we have not made any errors, let’s try plotting f (x) in the interval [0.5, 1.0]. [> plot( f(x), x=0.5..1.0); (Indeed, we can see from the plot that c lies somewhere between 0.7 and 0.8.) To refine the search for c even further, we repeat this process with the new interval [0.5, 1.0]. The new midpoint is [> d := (a+b)/2; iv Copyrighted by B.A. Forrest (bforrest@sympatico.ca) Newton’s Method in Maple Maple tells us that the new value of the midpoint d is 0.75. We again find f (d). [> f(d); Maple tells us f (d) = f (0.75) = −0.0126953125. Since, from before, we have f (a) = f (0.5) = −0.46875 < 0, the Bisection Method tells us again to replace a by d. T...
View Full Document

Ask a homework question - tutors are online