JSFH Math 151-007 Lab 11/15/06 Michael Pelsmajer and Oscar Ortega Three demonstrations Run the following. The resulting list is a bunch of special commands, including NewtonsMethod, AntiderivativeTutor, and more. with(Student[Calculus1]); After running that, all those commands are available to be used. 1. Using Maple to get intuition about antiderivatives. 1.a Run this: AntiderivativePlot(x^2,-10..10); 1.a Which one is the antiderivative of which one? (Descibe without referring to colors if you use a black-&-white printer.) Of course, that's just one of the antiderivative. You can get others by specifying a point you want it to contain. Try it: AntiderivativePlot(x^2,-10..10, value=[-5,100]); You can also do it on the fly, and you can even use this to learn about how to write Maple commands 1.b Run the following, and experiment with the "Show class of antiderivatives" button (use "Display" to see the effect). Watch the text at the bottom to see how you can do it using "AntidervativePlot". AntiderivativeTutor(x^2); 1.c Produce the same effect here, using "AntidervativePlot", for a function of your choice, with the domain specified. (For example, you could do it for LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEkc2luRicvJSdpdGFsaWNHUSZmYWxzZUYnLyUsbWF0aHZhcmlhbnRHUSdub3JtYWxGJy1JKG1mZW5jZWRHRiQ2JC1GIzYkLUklbXN1cEdGJDYlLUYsNiVRInhGJy9GMFEldHJ1ZUYnL0YzUSdpdGFsaWNGJy1GIzYkLUkjbW5HRiQ2JFEiMkYnRjJGMi8lMXN1cGVyc2NyaXB0c2hpZnRHUSIwRidGMkYyRjI= over LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkobWZlbmNlZEdGJDYmLUYjNiktSSNtb0dGJDYtUSomdW1pbnVzMDtGJy8lLG1hdGh2YXJpYW50R1Enbm9ybWFsRicvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRjkvJSlzdHJldGNoeUdGOS8lKnN5bW1ldHJpY0dGOS8lKGxhcmdlb3BHRjkvJS5tb3ZhYmxlbGltaXRzR0Y5LyUnYWNjZW50R0Y5LyUnbHNwYWNlR1EsMC4yMjIyMjIyZW1GJy8lJ3JzcGFjZUdGSC1JI21pR0YkNiVRI1BpRicvJSdpdGFsaWNHRjlGNC1GMTYtUSIsRidGNEY3L0Y7USV0cnVlRidGPEY+RkBGQkZEL0ZHUSYwLjBlbUYnL0ZKUSwwLjMzMzMzMzNlbUYnLUYxNi1RIn5GJ0Y0RjdGOkY8Rj5GQEZCRkRGVi9GSkZXLUZMNiVRJXNxcnRGJ0ZPRjQtRiw2JC1GIzYkRktGNEY0RjRGNC8lJW9wZW5HUSJbRicvJSZjbG9zZUdRIl1GJy1GTDYjUSFGJ0Y0 , if you can't think of anything else.) 1.d What are we looking at, anyway? (Take a little care with your explanation; be precise.) 2 Using Maple to get intuition about approximating area by rectangles (Riemann Sums) Another one of the special commands is RiemannSum. RiemannSum(x^2,-5..6, method=right, partition=4, output=plot); 2.a What is the total area of the rectangles? (It's written there.) Also, what are LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYkLUkjbWlHRiQ2JVEiYUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy9GM1Enbm9ybWFsRic=, LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEiYkYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21vR0YkNi1RIixGJy9GM1Enbm9ybWFsRicvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRjEvJSlzdHJldGNoeUdGPS8lKnN5bW1ldHJpY0dGPS8lKGxhcmdlb3BHRj0vJS5tb3ZhYmxlbGltaXRzR0Y9LyUnYWNjZW50R0Y9LyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdRLDAuMzMzMzMzM2VtRidGOQ==LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUkjbWlHRiQ2JVEmRGVsdGFGJy8lJ2l0YWxpY0dRJmZhbHNlRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEifkYnRjIvJSZmZW5jZUdGMS8lKnNlcGFyYXRvckdGMS8lKXN0cmV0Y2h5R0YxLyUqc3ltbWV0cmljR0YxLyUobGFyZ2VvcEdGMS8lLm1vdmFibGVsaW1pdHNHRjEvJSdhY2NlbnRHRjEvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZJLUYsNiVRInhGJy9GMFEldHJ1ZUYnL0YzUSdpdGFsaWNGJ0Yy, LUkjbWlHNiMvSSttb2R1bGVuYW1lRzYiSSxUeXBlc2V0dGluZ0dJKF9zeXNsaWJHRic2JVE1b3V0cHV0fnJlZGlyZWN0ZWQuLi5GJy8lJ2l0YWxpY0dRJXRydWVGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRic= 2.b. Do the same Maple command, but with righthand approximations. What is the total area of the rectangles? 2.c Do it now choosing points at "random". Run this one several times, and each time, note the total area of the rectangles. Write down data as a list (of the various total areas you found). 2.d Looking at the plots, describe precisely what is the effect of "random" (as opposed to "left" or "right"). 3. Redo the previous problem with a function of your choice, with a domain of your choice. The only restrictions is that the function must be non-negative (i.e., it can never go below the x-axis). Also, this time, make it so the rectangles are very thin. 4. In the previous two problems, you approximate area under a curve with rectangles, where the heights of rectangles are calculated using various points on the curve. The particular choice of points on the curve (left vs. right vs. random) affects the total area of rectangles, and hence the accuracy of our approximation. Compare the effect of left-vs-right-etc on the approximations in problems 3 and 4, and discuss why this happens. 5. Using Maple to gain intuition about Newton's Method Try this: func1 := x-> x^3-x; NewtonsMethod(func1(x), x=2, iterations = 5, output=plot); NewtonsMethod(func1(x), x=2, iterations = 5, output=sequence); JSFH Ignore for the moment the fact that Newton's Method sometimes fails (depending on concavity, etc)... More iterations gives better accuracy. But how many iterations do you need to become "accurate enough". I never really answered that during class. How fast do the approximations in Newton's Method approach the root? In short, the answer is "Very Fast!". It'a quadratic rate of convergence, whatever that means. Wikipedia claims that intuitively, the number of digits accuracy doubles every iteration (at least - it could be better). While the theory justifying that is beyond the scope of this course, we can see this in action, experimentally. 5.a. What is the root that is being approached above? 5.b. Modify it so that we see 10 iterations. List the errors of the successive approximations. (error = | (approximate root) - (actual root) | ). Discuss whether Wikipedia is (more or less) correct. 6. Repeat the previous problem for a function of your choice, and a carefully-chosen initial value of your choice. 7. Try Newton's method with the following function, using three different initial points, LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYkLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy9GM1Enbm9ybWFsRic= = 3, LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUkjbWlHRiQ2I1EhRictRiM2Ji1GLDYlUSJ4RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUkjbW9HRiQ2LVEiPUYnL0Y4USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQi8lKXN0cmV0Y2h5R0ZCLyUqc3ltbWV0cmljR0ZCLyUobGFyZ2VvcEdGQi8lLm1vdmFibGVsaW1pdHNHRkIvJSdhY2NlbnRHRkIvJSdsc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLyUncnNwYWNlR0ZRLUkjbW5HRiQ2JFEkMy4xRidGPkY+RitGPg==, and LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUkjbWlHRiQ2I1EhRictRiM2Ji1GLDYlUSJ4RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUkjbW9HRiQ2LVEiPUYnL0Y4USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQi8lKXN0cmV0Y2h5R0ZCLyUqc3ltbWV0cmljR0ZCLyUobGFyZ2VvcEdGQi8lLm1vdmFibGVsaW1pdHNHRkIvJSdhY2NlbnRHRkIvJSdsc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLyUncnNwYWNlR0ZRLUkjbW5HRiQ2JFEkMy4yRidGPkY+RitGPg== . Discuss the outcome: say something intelligent and specific (specific enough that the discussion wouldn't make sense if we changed the function or the initial points). func2 := x -> x^3/30 + x^2/10 - 2*x + 1; plot(func2); JSFH