{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 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {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 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }{PSTYLE "M aple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 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 256 "" 0 "" {TEXT 256 20 "Integration in Maple" } {TEXT -1 27 "\nLast revision: Spring 2008" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT 268 15 "Antiderivatives" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "The key command for integration is " }{TEXT 257 3 "int" }{TEXT -1 99 ". Let us start by looking at inde finite integrals. Suppose we want to find an anti-derivative of " } {XPPEDIT 18 0 "f(x) = x*exp(-x);" "6#/-%\"fG6#%\"xG*&F'\"\"\"-%$expG6# ,$F'!\"\"F)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "We can do this eas ily, just enter" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "int(x*exp(-x),x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "The syntax of the " }{TEXT 258 4 "int " }{TEXT -1 12 "command i s " }{TEXT 259 28 " int(expression, variable). " }{TEXT -1 48 " When \+ written with an upper case I, the command " }{TEXT 260 3 "Int" }{TEXT -1 25 " is the inert version of " }{TEXT 261 4 "int," }{TEXT -1 72 " m eaning that it displays the integral, but does not compute anything: \+ " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "Int(x*exp(-x),x);" }}} {EXCHG {PARA 257 "" 0 "" {TEXT 262 6 "It is " }{TEXT -1 11 "recommende d" }{TEXT 272 8 " to use " }{TEXT -1 3 "Int" }{TEXT 264 12 " along wit h " }{TEXT -1 5 "value" }{TEXT 265 1 "." }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "Int(x*exp(-x),x); value(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT 263 4 "Int " }{TEXT -1 35 "displays the i ntegral question and " }{TEXT 266 8 "value(%)" }{TEXT -1 23 " produces the solution." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "Maple can't find every integral; if it gets too hard, maple will \+ just repeat the question." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "Int(ex p(-x)*sin(sqrt(1+x^2)),x); value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "This is maple's way to say \"I don't know\"." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 23 "Constant \+ of Integration" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 273 41 "Maple omits the constant of integration C" }{TEXT -1 98 ". This may occasionally lead to seemingly contradictory results. \+ Let's say we want to integrate " }{XPPEDIT 18 0 "y = (x-1)^2;" "6#/% \"yG*$,&%\"xG\"\"\"F(!\"\"\"\"#" }{TEXT -1 31 " . Direct computation yields " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "y := (x-1)^2; I nt(y,x); Y := value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "But wh en we expand y first, we obtain a different answer." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "z := expand(y); Int(z,x); Z := value(%);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "Z-Y;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "We see that the two answers differ by the constant 1/3. This \+ confirms that anti-derivatives differ by a constant, and it also teach es us to be attentive in the use of maple." }{MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 28 " The Variable of Integration" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }{TEXT -1 36 "Suppose that we want to intergate " }{XPPEDIT 18 0 "a^x;" "6#)%\"aG%\"xG" }{TEXT -1 80 " . When x is the variable, we \+ have an exponential function with anti-derivative" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 21 "Int(a^x,x); value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "If on the other hand a is the variable, we have a po wer function with anti-derivative " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Int(a^x,a); value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "If the variable of integration is different from a and x, say it is t, then the expression " }{XPPEDIT 18 0 "a^x;" "6#)%\"aG%\" xG" }{TEXT -1 40 " is a constant and the integral becomes" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Int(a^x,t); value(%);" }}}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$IntG6$)%\"aG%\"xG%\"tG" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 0 "" }{TEXT 269 18 "Definite Integrals" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 117 "For defini te integrals we just include the limits of integration in the range of the variable. Example: Integrate " }{XPPEDIT 18 0 "x*exp(-x);" "6# *&%\"xG\"\"\"-%$expG6#,$F$!\"\"F%" }{TEXT -1 14 " from 0 to 4." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "int(x*exp(-x),x=0..4);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "We just get the result. Again, it is preferable to use the Int & value combination:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 32 "Int(x*exp(-x),x=0..4); value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "For numerical results use " }{TEXT 267 6 "evalf :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "Int(x*exp(-x),x=0..4); evalf(% );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 163 "Maple can't solve every in tegral; if it gets too hard, maple will just repeat the question, as \+ we saw above. But we can always ask for a numerical approximation." } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "Int(exp(-x)*sin(sqrt(1+x^2)),x=0.. 3); value(%);\nevalf(Int(exp(-x)*sin(sqrt(1+x^2)),x=0..3));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 30 "Variable Limits of Integration" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 67 "We may also define functions with variable limits of inte gration. " }}{PARA 0 "" 0 "" {TEXT 274 8 "Example:" }{TEXT -1 2 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "S := x -> int(sin(Pi*t^2/ 2),t=0..x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 94 "This function is k nown in the literature as the Fresnel Sine function. Maple recognizes that:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "S(x);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 46 "Let's take the derivative to check the answer." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "D(S)(x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 275 9 "Example: " }{TEXT -1 102 " (This is problem 81, page 259) . Define a function F(x) by an integral, and then take the derivative ." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "F := x -> int( sqrt(t), t = 0. .sin(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "The derivative is" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "D(F)(x);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 72 "We can also first compute F(x) explicitly, and then tak e the derivative:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "F(x);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "dF := diff(%,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "We see that the results are identical." } }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 0 "" }{TEXT 270 21 "Nume rical Integration" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 412 "Numerical in tegration is the approximate calculation of the value of a definite in tegral. This is useful when the integrand is a complicated function w ithout a simple anti-derivative. Leftsums, rightsums, middlesums (Sec tion 5.1) are examples of numerical integration; further techniques, s uch as the trapezoidal rule and Simpson's rule are outlined in Section 5.9. All of these are built-in functions in the " }{TEXT 271 15 "stu dent package" }{TEXT -1 59 ". We illustrate all of these methods for \+ the integral of " }{XPPEDIT 18 0 "x^4-7*x^2+8*x+1;" "6#,**$%\"xG\"\"% \"\"\"*&\"\"(F'*$F%\"\"#F'!\"\"*&\"\")F'F%F'F'F'F'" }{TEXT -1 131 " o n the interval from 0 to 2 with 10 subintervals, and we compare the nu merical approximations to the exact value of the integral." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "restart;\nwith(student);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "y := x^4 - 7*x^2 + 8*x +1; \+ # abbreviation" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "Int(y,x=0 ..2); Itrue := evalf(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "middlebox(y,x=0..2,10); middlesum(y,x=0..2,10); M := evalf(%); M-Itru e; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "leftbox(y,x=0..2,10) ; leftsum(y,x=0..2,10); L := evalf(%); L-Itrue; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "rightbox(y,x=0..2,10); rightsum(y,x=0..2,10); R := evalf(%); R-Itrue; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 143 "The approximations with rightsums and leftsums are not as good as the res ult from the middlesum, however their average is in the same ballpark: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "ave := (L+R)/2; ave-Itrue;" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "The trapezoidal rule yields" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "trapezoid(y,x=0..2,10); T := evalf( %); T - Itrue;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 117 "Note that the \+ trapezoidal rule is the average of leftsums and rightsums.\nSimpson's \+ rule applied to our problem yields" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "simpson(y,x=0..2,10); S := evalf(%); S - Itrue;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "Simpson's rule is superior and yields the best \+ result in this example." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}} {MARK "0 0 1" 27 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }