{VERSION 2 3 "DEC ALPHA UNIX" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 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 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT -1 39 "Getting started with Taylor poly nomials" }}{PARA 19 "" 0 "" {TEXT -1 10 "Bill Farr " }}{PARA 19 "" 0 " " {TEXT -1 12 "January 2000" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 42 "Ge tting started - don't skip this section!" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 112 "To use the Taylor and TayPlot commands, you need to load the CalcP package. This is done with the command below." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(CalcP);" }}{PARA 0 "" 0 "" {TEXT -1 232 "The first time you run this command, you will probably get an error, \+ saying that the CalcP package is undefined. This is because you have t o tell Maple where to look for it. To do so, run the following command in a terminal window. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "cp ~bfarr/.mapleinit ~" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 36 "Then, run the restart com mand below." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 159 "Now, run with(CalcP) again. The o utput should be a list of the commands in the CalcP package. If you do n't get this, ask for assistance during your lab period." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 "You will only have to go through this process of copying the .mapleinit file once. " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(CalcP);" }}}}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 18 "Exercise 1, part a" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 95 "Here is the Taylor polynomial of order 3. You might want \+ to experiment with changing the order." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Taylor(exp(2*x),x=0,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "This command plots " }{XPPEDIT 18 0 "exp(2*x)" "-%$expG6#*&\"\"#\" \"\"%\"xGF'" }{TEXT -1 44 " and the Taylor polynomials with base point " }{XPPEDIT 18 0 "x=0" "/%\"xG\"\"!" }{TEXT -1 117 " of orders 2, 3, \+ and 4 on the same plot. The order 4 polynomial might be accurate enoug h, but we'll check that below." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "T ayPlot(exp(2*x),x=0,\{2,3,4\},x=-1..1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 "This plots the absolute error for the third order Taylor polynomial. It clearly is not accurate enough." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "plot(abs(exp(2*x)-Taylor(exp(2*x),x=0,3)),x=-1..1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "This next command plots the abs olute error for the fourth order Taylor polynomial. " }}{PARA 0 "" 0 " " {TEXT -1 199 "There are a couple of added features that you should t ake note of. First, the range has been limited to slightly larger than the tolerance. Second, along with the absolute error, the horizontal \+ line " }{XPPEDIT 18 0 "y=0.5" "/%\"yG$\"\"&!\"\"" }{TEXT -1 315 " is p lotted. This lets you easily determine graphically whether the condit ion on the tolerance is satisfied. If the absolute error intersects th is horizontal line, the condition on the tolerance is not satisfied. I f the absolute error stays below this horizontal line, the condition o n the tolerance is satisfied. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 175 "The plot below shows that the Taylor pol ynomial of order 4 satisfies the tolerance condition. You should try i t with order 3 to check whether the minimum order required is 4. " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "plot([0.5,abs(exp(2*x)-Taylor(exp(2 *x),x=0,4))],x=-1..1, y=0..0.55);" }}}{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 10 "Exercise 3" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "Try in creasing the order of the Taylor polynomials in the command below. Do \+ you ever get a good approximation at " }{XPPEDIT 18 0 "x=2" "/%\"xG\" \"#" }{TEXT -1 1 "?" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "TayPlot(x/(1 -x),x=0,\{3,4\},x=-2.5..0.5,y=-1..3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 10 "Exercise 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "This command can be used to generate the Taylor poly nomial for " }{XPPEDIT 18 0 "1/(1+x)^2" "*&\"\"\"\"\"\"*$,&\"\"\"F$%\" xGF$\"\"#!\"\"" }{TEXT -1 2 ". " }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Taylor(1/(1+x)^2,x=0,4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "This command provides the derivative of the Taylor polyno mial for " }{XPPEDIT 18 0 "x/(1+x)" "*&%\"xG\"\"\",&\"\"\"F$F#F$!\"\" " }{TEXT -1 1 "." }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " diff(Taylor(x/(1+x),x=0,5),x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 10 "Exercise 6" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Here we calculate the Taylor polynomial of order 3 for " }{XPPEDIT 18 0 "exp(-t^2)" "-%$expG6#,$*$%\"tG\"\"#!\"\"" }{TEXT -1 65 ". Note that since this is an even function, only even powers of \+ " }{XPPEDIT 18 0 "t" "I\"tG6\"" }{TEXT -1 9 " appear. " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "pv := Taylor(exp(-t^2),t=0,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "This command computes an approximation to " }{XPPEDIT 18 0 "erf(2)" "-%$erfG6#\"\"#" }{TEXT -1 119 ". It isn't \+ very good, but you can go back to the previous command, increase the o rder, and then run this command again." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "evalf(2/sqrt(Pi)*int(pv, t=0..2));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "This is a decimal approximation to " }{XPPEDIT 18 0 "erf( 2)" "-%$erfG6#\"\"#" }{TEXT -1 42 " for you to compare your approximat ion to." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(erf(2));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}}{MARK "11" 0 }{VIEWOPTS 1 1 0 1 1 1803 }