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1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 3 " " }{TEXT 264 0 "" } {TEXT 265 39 "MA1023 Calculus III PLC -- MAPLE Lab #4" }}{PARA 257 "" 0 "" {TEXT 266 26 "Friday, September 24, 2004" }}{PARA 258 "" 0 "" {TEXT -1 34 "Due: Wednesday, September 29, 2004" }{MPLTEXT 1 0 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Load the basic MAPLE commands for a calculus course." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student);" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 10 "Backgr ound" }}{PARA 0 "" 0 "" {TEXT -1 119 "Our goal in this lab is to look \+ at definite integrals with some very strange functions. We will compar e various methods" }}{PARA 0 "" 0 "" {TEXT -1 95 "for estimating the i ntegrals in question. This comparison will involve both accuracy and s peed." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 " " }{TEXT 267 13 "Example 1: " }{TEXT -1 111 "An out-of-control sine curve. Even with 20,000 \+ data points, the connect-the-dots picture is not so informative." } {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "f := 1-sin(314* x)^50;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "plot(f,x=0..2,numpoints=2 0000);" }}{PARA 0 "" 0 "" {TEXT -1 87 "This looks like a mess to integ rate. Let's compare the methods using 20 sub-intervals." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "a := 0; b := 2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "N := 20;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "evalf( leftsum ( f , x=a..b , N ) );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "evalf( rightsum ( f , x=a..b , N ) );" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 37 "evalf( middlesum( f , x=a..b , N ) );" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "evalf( trapezoid( f , x=a..b , N ) \+ );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "evalf( simpson ( f , x=a..b \+ , N ) );" }}{PARA 0 "" 0 "" {TEXT -1 55 "Now let's get MAPLE's best es timate of the real answer." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "int( f, x=a..b);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}}{EXCHG {PARA 259 "" 0 "" {TEXT -1 11 "Example 2: " } {TEXT 268 78 " A very widely used function for which the fundamental t heorem does not apply." }}{PARA 260 "> " 0 "" {MPLTEXT 1 0 14 "f := ex p(x^2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "plot(f,x=0..2);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 97 "This time aroumd, we will find out how much CPU time MAPLE requires to compute the approximation." } {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "st := time();" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "P := convert( taylor(f,x=1.5,10) \+ , polynom );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "int(P,x=1..2);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "Now let us see how long it took to perform the computation:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "totalt ime := time()-st;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "Does polynom ial P accurately represent f on a larger interval?" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 14 "int(P,x=0..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "This is bad news since f > 0 while the answer is negative. Let's s ee what's going on?" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "plot(\{f,P\} , x=0..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "Now back to the int erval [1,2]. Let's see how big the error is." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "int(P,x=1..2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "int(f,x=1..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "Since \+ the fundamental theorem doesn't give an elementary antiderivative, MAP LE (and mathematicians make up a name" }}{PARA 0 "" 0 "" {TEXT -1 98 " for the antideriviatve (actually a slight variation on it), and call i t the Error Function erf(x)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "eval f(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 105 "The error in this appro ximation is bounded by the integral of the remainder function which we now obtain." }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " R := subs( x=2, diff(f,x$11) )*(x-1.5)^11/11!;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "plot(R,x=1..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 "This is clearly symmetric about x=1.5. So to integrate its absolu te value, we can double the following:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "int(R,x=1.5..2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}}{MARK "1 0 0" 52 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }