{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "MAT1505 04S Quiz 4" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "f:=x->x*exp(-x/2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "plot([f(x),(D@@2)(f)(x)],x=0 ..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "factor((D@@2)(f)(x ));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "Notice the maximum absolut e value of the second derivative occurs at the origin with value " } {XPPEDIT 18 0 "K = 1;" "6#/%\"KG\"\"\"" }{TEXT -1 0 "" }{TEXT -1 1 ". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "int(x*exp(-x/2),x=0..4) ;\nII:=evalf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 "Now trapezoid :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "T4_byhand:=1*(1/2*f(0) +f(1)+f(2)+f(3)+1/2*f(4));\nevalf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "We could also use the student package to get trapezoid:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "T4:=evalf(trapezoid(f(x),x=0 ..4,4));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "II-T4;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "Now for the trapezoid error bound \+ for " }{XPPEDIT 18 0 "n = 4;" "6#/%\"nG\"\"%" }{TEXT -1 1 ":" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "K*(b-a)^3/12/n^2;\nevalf(sub s(n=4,b=4,a=0,%));\nsubs(K=1,%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "K*(b-a)^3/12/n^2;\nevalf(subs(K=1,b=4,a=0,%));\nsolve (%=1/2*10^(-4),n);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "NOT REQUI RED:\nTo compare with Simpson we need the fourth derivative max, also \+ at the origin:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "plot((D@@ 4)(f)(x),x=0..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "K*(b-a )^5/180/n^4;\nevalf(subs(K=1/2,b=4,a=0,%));\nsolve(%=1/2*10^(-4),n);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "S16:=evalf(simpson(f(x),x =0..4,16));\nII-S16;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "One can a lso get the approximation from the Student Calculus 1 package:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "with(Student[Calculus1]);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "ApproximateIntTutor(f(x)); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 18 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }