{VERSION 5 0 "IBM INTEL NT" "5.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 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 2 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 2 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 2 0 0 0 0 0 0 0 0 1 }{CSTYLE "" 18 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output " -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PST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if it is not possible to find an an tiderivative of a given function in terms of elementary functions, it \+ usually is possible to approximate values of definite integrals by the fact that definite integrals correspond to area of certain regions. \+ These area can be approximated by covering them with a large number of small rectangles, for instance. This is, in fact, what is being done in numerical integration. Provided that the function to be integrate d is not too bad, this simple observation can give good results. " }}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 19 "Left approximations" }}{PARA 0 " " 0 "" {TEXT -1 89 "We need rountines that are containedi n the studen t -package. So we start by loading it." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "Consider the integral \+ " }{XPPEDIT 18 0 "Int(sin(sin(x))/x,x = 0 .. 1);" "6#-%$IntG6$*&-%$sin G6#-F(6#%\"xG\"\"\"F,!\"\"/F,;\"\"!F-" }{TEXT -1 98 ". This integral \+ cannot be expressed in terms of elementary functions. Let us try to \+ compute it:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "f:=unapply(s in(sin(x))/x,x):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "Int(f(x ),x=1..2): % = value(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Thew graph of the function in question is" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "plot(f(x),x =1..2,y=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "and the value of the integral is t he area below the graph and above the interval [0,1]." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 440 "Following the idea gi ven above, we divide the interval [0,1] into 4 subintervals [0,1/4], [ 1/4,2/4], [2/4,3/4], [3/4,1], and we approximate the area of the domai n in question by the sum of the areas of the rectangles having the int evals [j/4,(j+1)/4], j= 0 .. 4, as their base, and having the height c orresponding to the value of the function in the left end point of eac h interval. This approximation of the above domain looks as follows: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "leftbox(f(x),x=1..2,4); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 280 "The areas of the rectangles in the picture are easy to compute, andt his gives already a rather good estimate of the area of the domain bounded by the graph of the original function. This ca n be improved by taking more division points. For 20 points we get th e following picture" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "left box(f(x),x=1..2,20);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "This way of approximating the are corresponding to a given definite integral is called " }{TEXT 256 18 "left approximation" }{TEXT -1 235 ". Clearly, when increasing the nu mber of division points, the approximation gets better. The sum of th e values of the areas of the corresponding rectangles is an approximat ion of the integral. It can readily be computed by Maple: " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "leftsum(f(x),x=1..2,4);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 102 "That is the exact formula. To get a floating point appr oximation, you must evaluate the above by the " }{MPLTEXT 1 0 6 "evalf " }{TEXT -1 10 "command. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "evalf(leftsum(f(x),x=1..2,4));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 131 "To get an idea of the accuracy of our computations, we may com pue leftsums for several values of the number of the division points: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "for j from 4 to 20 do e valf(leftsum(f(x),x=1..2,j)); od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 147 "You observe \+ that, as the number of the division points increase, the approximation s get smaller. Also the approximation is not really very good. " } {TEXT 257 148 "What is the reason for this phenomena, i.e., why do the values of the approximation always get smaller as the number of divis ion points increases? " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 8 "Problems" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 177 "P lot left approximations for the following integrals. Discuss the accu racy of the approximation. What happens to the approximations as the \+ number of division points increases?" }}{PARA 4 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 257 "" 0 "" {XPPEDIT 18 0 "Int(exp(x^2),x=0..1)" "6#-% $IntG6$-%$expG6#*$%\"xG\"\"#/F*;\"\"!\"\"\"" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {SECT 1 {PARA 258 "" 0 "" {XPPEDIT 18 0 "Int(exp(-x^2),x=0..1)" "6#-%$ IntG6$-%$expG6#,$*$%\"xG\"\"#!\"\"/F+;\"\"!\"\"\"" }{TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 259 "" 0 "" {XPPEDIT 18 0 "Int(sin(x^3),x=0..2);" "6#-%$IntG6$-%$sinG6 #*$%\"xG\"\"$/F*;\"\"!\"\"#" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 91 "Give \+ an example of a function f for which the left-point approximations o f the integral " }{XPPEDIT 18 0 "Int(f(x),x=0..1)" "6#-%$IntG6$-%\"fG 6#%\"xG/F);\"\"!\"\"\"" }{TEXT -1 6 " give " }}{SECT 1 {PARA 265 "" 0 "" {TEXT -1 22 "always the exact value" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 266 "" 0 "" {TEXT -1 68 "always a value that is smaller than the actual value of the integral" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 267 "" 0 "" {TEXT -1 67 " always a value that is larger than the actual value of the integral" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 20 "Right a pproximations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 232 "We can replace the left-end point by the right end-point in the aboe left approximations to get right approximations of the do main and the value of the inregral. Look at our original example: ap proximate the value of the integral " }{XPPEDIT 18 0 "int(sin(sin(x))/ x,x=1..2)" "6#-%$intG6$*&-%$sinG6#-F(6#%\"xG\"\"\"F,!\"\"/F,;F-\"\"#" }{TEXT -1 46 ". The right approximaitons look as follows" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "rightbox(f(x),x=1..2,4);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 105 "Here you can increase the number of division points by c hanging the last argument of the above command. " }{TEXT 258 100 "Wha t happens to the value of the right approximation as the number of div ision points increases? " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "The values of the approximations can again be c omputed by the command" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "r ightsum(sin(sin(x))/x,x=1..2,10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 16 "Evaluation gi ves" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "evalf(rightsum(sin(s in(x))/x,x=1..2,10));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "Inreasing the number of division points we get" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "for j fro m 10 to 20 do evalf(rightsum(sin(sin(x))/x,x=1..2,j));od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "Problems" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 54 "Give examples and plot pictures of functions for whi ch" }}{SECT 1 {PARA 260 "" 0 "" {TEXT -1 106 "the right sum gives alwa ys an approximation of the integral that is smaller than the actual va lue integral" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 261 "" 0 "" {TEXT -1 112 "the right sum gives always an approximation of the integral that is larger than the actua l value of the integral" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 4 "" 0 " " {TEXT -1 66 "Give examples of functions for which the left approxima tion always" }}{SECT 1 {PARA 262 "" 0 "" {TEXT -1 38 "is larger than t he right approximation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 263 "" 0 "" {TEXT -1 39 "is smaller than the right approximation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 264 "" 0 "" {TEXT -1 35 "is equal to the right approximation" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 106 "How many division poin ts one must take so that the error of the left point approximation of \+ the integral " }{XPPEDIT 18 0 "int(exp(-x^2),x=0..1)" "6#-%$intG6$-%$ expG6#,$*$%\"xG\"\"#!\"\"/F+;\"\"!\"\"\"" }{TEXT -1 92 " is at most 0. 01?\nExplain you reasoning and illustrate the situation with appropria te plots." }}{PARA 4 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 4 "" 0 "" {TEXT -1 2 " " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 22 "Middle approximations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 223 "Instead of considering the end points of the subintervals in question, one can take the value of the \+ function at the midpoints as the height of the approximating rectangle . One usually gets better approximations that way. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 22 "Consider the integral \+ " }{XPPEDIT 18 0 "int(exp(-x^2),x=0..1)" "6#-%$intG6$-%$expG6#,$*$%\"x G\"\"#!\"\"/F+;\"\"!\"\"\"" }{TEXT -1 159 ". In the problem above on e finds out that to ensure 0.01 accuracy for the approximation (using left or right sums) one has to take over 60 dividion points. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 44 "The mid p oint approximation looks as follows" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "g:=unapp ly(exp(-x^2),x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "middleb ox(g(x),x=0..1,4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "Just by looking at the correspond ing pictures of the left and right approximations, one sees immediatel y that the mid approximation gives clearly better results in this case ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 154 "We \+ may verify this by numerical computations. The following line comput es floating point values for the left- , middle- and the rightsum resp ectively. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 259 9 "Problem. " }{TEXT -1 203 " By c hanging the number of division points in the left- and rightsums, esti mate how many points you must choose to get the same accuracy as what \+ you get with the middle sum using just 10 division points." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "L eftsum=evalf(leftsum(g(x),x=0..1,10)); Middlesum=evalf(middlesum(g(x), x=0..1,10));Rightsum=evalf(rightsum(g(x),x=0..1,10));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "Problems" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 116 "Give an exa mple of a function for which the left sum gives a better approximation of the integral as the middle sum." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 117 "Give an example of a function for which the right sum gives a bet ter approximation of the integral as the middle sum." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 24 "Trapezo id approximations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 258 "In the above we have considered three different ways to \+ approximate a definite integral. They all are based on the various wa ys to approximate a domain by rectangles. The three different ways we re the following. Here we apply the method to the function " } {XPPEDIT 18 0 "f(x) = exp(x^2);" "6#/-%\"fG6#%\"xG-%$expG6#*$F'\"\"#" }{TEXT -1 313 " in the interval [1,2], and cover that interval with o ne box only. The purpose of this example is to illustrate the error s involved in the numerical approximation. In the numerical approxima tion, we approximate the area under the red curve by the area of the r ectangles indicated in the respective pictures. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{GLPLOT2D 177 154 154 {PLOTDATA 2 "6'-%)POLYGONSG6$7&7$$\"\"\"\"\"!F*7$F($\"+G=G=F!\"*7$$\" \"#F*F,7$F0F*-%&COLORG6&%$RGBG$\"\"(!\"\"$\"\"*F9F7-%'CURVESG6&7S7$F($ \"1X!f%G=G=F!#:7$$\"1nm;arz@5FC$\"1KTucPvSGFC7$$\"1L$e9ui2/\"FC$\"1n%p LYz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%3Ti\"FC$\"1&zGDmS\")R\"F[u7$$\"1++v.[hY;FC$\"1\\Ex$HV\\]\"F[u7$$\"1 LLLQx$om\"FC$\"1M;x/:C4;F[u7$$\"1++]P+V)o\"FC$\"1lonC[:IF[u7$$\"1L$e9S 8&\\\"Gn#F[u7$$\"1nmm'*RRL= FC$\"1pM(G#3w#)GF[u7$$\"1nmTvJga=FC$\"1K8))y=IFC$\"1* H,vR$=YRF[u7$$\"1nmmw(Gp$>FC$\"19r@#[8$fUF[u7$$\"1+]7oK0e>FC$\"1n?AE!* eCYF[u7$$\"1+](=5s#y>FC$\"1&Qn4V$p2]F[u7$F0$\"1CWJ.]\")faF[u-%'COLOURG 6&F6$\"*++++\"!\")F*F*-%&STYLEG6#%%LINEG-%*THICKNESSG6#F1-%+AXESLABELS G6$Q\"x6\"%!G-%&TITLEG6#%*MiddleboxG-%%VIEWG6$;F(F0%(DEFAULTG" 1 2 0 1 10 0 2 9 1 4 2 1.000000 47.000000 43.000000 0 0 "Curve 1" "Curve 2" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 191 "We conclude that the left approximation is pro bably worst of all the three approximations. But in this case, all th e approximations give rather bad results. That can be checked as fol lows." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 106 "Next set n to be the number of intervals into which the original interval of integr ation is to be divided." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "n :=1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"nG\"\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "D efine the function to be integrated numerically:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "f:=unapply(exp(x^2),x):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 159 "Next let Maple compute a numerical approximation of the integral Int(exp(x ^2),x) and compare that to the results of the left, right and middle \+ approximations." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 176 "Int(f(x),x=1..2): % = evalf (value(%)); `Left sum` = evalf(leftsum(f(x),x=1..2,n));`Right sum` = e valf(rightsum(f(x),x=1..2,n)); `Middle sum` = evalf(middlesum(f(x),x=1 ..2,n)); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%$IntG6$-%$expG6#*$)%\" xG\"\"#\"\"\"/F,;F.F-$\"+,w**)\\\"!\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%)Left~sumG$\"+G=G=F!\"*" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%* Right~sumG$\"+.]\")fa!\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%+Middle ~sumG$\"+Oet([*!\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 253 "Clearly the errors are rather lar ge as was to be expected. That can be improved if we use, instead of \+ a rectangular approximation, a \"trapezoidal\" approximation. In this method we approximate the domain in question by the polygon of the pi cture below." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{GLPLOT2D 155 142 142 {PLOTDATA 2 "6'-%'CURVESG6$7S7$$\"\"\" \"\"!$\"1X!f%G=G=F!#:7$$\"1nm;arz@5F-$\"1KTucPvSGF-7$$\"1L$e9ui2/\"F-$ \"1n%p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 0 1 10 0 2 9 1 4 2 1.000000 45.000000 46.000000 0 0 "" "" }}}{PARA 0 "" 0 "" {TEXT -1 170 "It is clear that, in this case, the area of the polygon is lar ger than the area under the red curve, but the approxiation is better \+ than the right or left approximations." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 21 "It is immediate that " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 268 "" 0 "" {TEXT 260 69 "Trapzoid approxim ation = (left approximation + right approximation)/2" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 40 "Let us compare the above approximations: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "n:=10;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"nG\"#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 223 "Int(f(x),x=1..2): % = evalf(value(%)); `Left sum` = evalf(lefts um(f(x),x=1..2,n));`Right sum` = evalf(rightsum(f(x),x=1..2,n)); `Midd le sum` = evalf(middlesum(f(x),x=1..2,n)); Trapezoidal = evalf(trapez oid(f(x),x=1..2,n));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%$IntG6$-%$e xpG6#*$)%\"xG\"\"#\"\"\"/F,;F.F-$\"+,w**)\\\"!\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%)Left~sumG$\"+u!zsD\"!\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%*Right~sumG$\"+cx2w " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 202 "Left an d right sums gave miserable approximations while the middle sum and th e trapezoidal approximations were much better. All the above methods \+ yield better results, when one increases the value of " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 150 " but in order to get, by the left and t he right sums, results comparable to the middle sum or to the trapezo idal approximation, one has to increase " }{XPPEDIT 18 0 "n" "6#%\"nG " }{TEXT -1 6 " to " }{XPPEDIT 18 0 "10*n" "6#*&\"#5\"\"\"%\"nGF%" } {TEXT -1 62 " as one can check by performing the computations in the a bove." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "The trapezoid approximation picture in the abov e was produced by the following procedure:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "trapezoidgraph := proc(f::symbol, a::numeric, b::numeric, n::posint)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "local Polygon,PLOT1, PLOT2, i;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 28 "Polygon := [[a,0],[a,f(a)]];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "for i to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "P olygon := [op(Polygon),[a+i*(b-a)/n,f(a+i*(b-a)/n)]]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "Polygon := [op(Polygon),[b,0]]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(pl ots):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "PLOT1 := polygonplot(Polyg on):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "PLOT2 := plot(f(x),x=a..b): " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "display(\{PLOT1,PLOT2\},title= \"Trapezoid approximation\");" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "trapezoidgraph(f,1,2,1 );" }}{PARA 13 "" 1 "" {GLPLOT2D 187 155 155 {PLOTDATA 2 "6'-%'CURVESG 6$7S7$$\"\"\"\"\"!$\"1X!f%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TI TLEG6#Q8Trapezoid~approximationFb\\l-%%VIEWG6$;F(Fez%(DEFAULTG" 1 2 0 1 10 0 2 9 1 4 2 1.000000 45.000000 46.000000 0 0 "" "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "Problems" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "C onsider " }{XPPEDIT 18 0 "Int(exp(x^2),x=1..2)" "6#-%$IntG6$-%$expG6# *$%\"xG\"\"#/F*;\"\"\"F+" }{TEXT -1 210 ". Explain why the trapezoid \+ approximation for this integral always gives upper estimates for the v alue of the integral while the middle approximation always gives lower estimates (lower than the actual value)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Estimate " }{XPPEDIT 18 0 "Int(1/(1+x^2),x=0..1)" "6#-%$IntG6$*& \"\"\"F',&F'F'*$%\"xG\"\"#F'!\"\"/F*;\"\"!F'" }{TEXT -1 179 " using th e left, right, middle and trapezoid approximations with varying number of intervals into which the interval [0,1] is to be divided. The exa ct value of this integral is " }{XPPEDIT 18 0 "Pi/4" "6#*&%#PiG\"\"\" \"\"%!\"\"" }{TEXT -1 93 ". Hence by the above approximations one get s an approximation for the value of the constant " }{XPPEDIT 18 0 "Pi " "6#%#PiG" }{TEXT -1 34 ". Is the value thus obtained for " } {XPPEDIT 18 0 "Pi" "6#%#PiG" }{TEXT -1 79 " by the left approximation \+ too large or too small? Explain your reasoning. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 144 "Give examples of func tions f such that when approximating the integral Int(f(x),x=0..1) \+ by dividing the interval [0,1] into two subintervals " }}{SECT 1 {PARA 5 "" 0 "" {TEXT 261 66 "the left approximation is better than th e trapezoid approximation " }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT 262 66 "the right approximation is better than the trapezoid app roximation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 5 "" 0 " " {TEXT 263 68 "the trapezoid approximation is better than the middle \+ approximation " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 269 " " 0 "" {TEXT -1 67 "the middle approximation is better than the trapez oid approximation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 14 "Simpson's rule" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 15 "Simpson's rule:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 264 0 "Simpso n*approximation = (2*`Middle approximation`+Trapezoid*approximation)/3 ;" "6#/*&%(SimpsonG\"\"\"%.approximationGF&*&,&*&\"\"#F&%5Middle~appro ximationGF&F&*&%*TrapezoidGF&F'F&F&F&\"\"$!\"\"" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 71 "usually gives better approximations than the above described me thods. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 128 "Let us experiment with these approximations, and compare errors. \+ We perform the same computations as in the text (on page 353)." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student ):" }}{PARA 7 "" 1 "" {TEXT -1 29 "Warning, new definition for D" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "f:=unapply(1/x,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"fG*&\"\"\"F&f*6#%\"xG6\"6$%)operatorG%&a rrowGF*9$F*F*F*!\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "n:= 2;Digits:=10;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"nG\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "`Maple's value`:=evalf(int(1/x,x=1..2)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 100 "for j from 1 to 3 do `Trapezoid error`||j:=`Maple's \+ value` - evalf(trapezoid(f(x),x=1..2,j*50)): od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 105 "for j from 1 to 2 do `Ratio of trapezoid err ors`||j := `Trapezoid error`||(j+1)/`Trapezoid error`||j; od;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%;Ratio~of~trapezoid~errors1G$\"+/+3+ D!#5" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%;Ratio~of~trapezoid~errors2G $\"+.6\"RW%!#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "`Maple's \+ value`;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"_qvo=k*pKjeg:Zpp>i$R$\\4 +o?TDb-OM,]v!ol " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "0 0 0" 7 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }