{VERSION 4 0 "IBM INTEL NT" "4.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 Input" 2 19 "" 0 1 255 0 0 1 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 16 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 271 "" 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PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 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 "M aple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT 256 21 "Introduction to Maple" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 37 "We introd uce Maple in three sections:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 21 "1) Basic calculations" }}{PARA 0 "" 0 "" {TEXT -1 11 "2) Calculus" }}{PARA 0 "" 0 "" {TEXT -1 18 "3) Linear algebra. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 159 "It i s meant as a crash course, and not to replace the usual texts. There i s also an intro.mws file in the tutorial section to Maple which one ca lls by issuing " }{TEXT 19 6 "?intro" }{TEXT -1 105 " at the command l ine. We expect the reader to have taken introductory courses in mathem atics and physics." }}{PARA 0 "" 0 "" {TEXT -1 89 "Standard references are the two books by Michael B. Monagan et al. published by Springer: " }}{PARA 0 "" 0 "" {TEXT -1 3 "1) " }{TEXT 257 22 "Maple V Learning G uide" }}{PARA 0 "" 0 "" {TEXT -1 3 "2) " }{TEXT 258 25 "Maple V Progra mming Guide" }}{PARA 0 "" 0 "" {TEXT -1 151 "Of course, some of the to pics covered in those texts are dealt with in our worksheets in the ph ysics context, which makes for more interesting reading." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 259 29 "Basic calculations and graphs" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "Maple as a Calculator:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 114 "Maple is case sensitive, distinguish car efully upper-case from lower-case typing.We begin by manipulating numb ers:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "1+17;" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#\"#=" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "answer:=%;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'answerG\"#=" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "answer;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#=" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Note that \+ " }{TEXT 19 2 ":=" }{TEXT -1 192 " acts as an assignment operator. The equal sign has a different meaning. A common beginner's mistake is to use the equal sign instead of the assignment operator and to get thor oughly confused." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "answ=10; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%%answG\"#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "answ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%%ans wG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 "The statement " }{TEXT 19 7 "answ=10" }{TEXT -1 74 " is an equation, which was entered above, bu t is not usable. The variable " }{TEXT 19 4 "answ" }{TEXT -1 20 " rema ins unassigned." }}{PARA 0 "" 0 "" {TEXT -1 15 "We could assign" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "ans:=3/4;" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%$ansG#\"\"$\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(ans);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+++ ++v!#5" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 129 "The Digits variable co ntrols how many digits are carried in floating-point calculations. It \+ can be changed to any integer number." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "Digits;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#5" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Digits:=20;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"#?" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "We can evaluate Pi now to 20 digits:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "evalf(Pi);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"5 &QKz*e`EfTJ!#>" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "The symbols for Greek letters are obtained by typing their English names." }}{PARA 0 "" 0 "" {TEXT -1 143 "An awkward matter is that lower-case pi is just \+ a symbol, and not the mathematical pi (that is given as Pi). But as sy mbols they look the same:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "Pi,pi;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%#PiG%#piG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$$\"5&QKz*e`EfTJ!#>%#piG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "Exponentiation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "ans:=3^4;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$ansG\"#\")" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "What happens when we combine symbo ls into a formula?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "a:=Pi; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"aG%#PiG" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 7 "b:=r^2;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\" bG*$)%\"rG\"\"#\"\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "A:= a*b;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG*&%#PiG\"\"\")%\"rG\"\"# F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(A,5);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*$)%\"rG\"\"#\"\"\"$\"&;9$!\"%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "What if we need the answer for a specific value of " }{TEXT 260 1 "r" }{TEXT -1 34 "? Several approaches are po ssible:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "eval(A,r=5);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#,$%#PiG\"#D" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "evalf(eval(A,r=5),4);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"%by!\"#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "evalf(subs(r=5,A));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"5j4$[uRj \")R&y!#=" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 112 "But the following c annot work, as the second argument in evalf is reserved for the precis ion (number of digits):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " evalf(A,r=5);" }}{PARA 8 "" 1 "" {TEXT -1 61 "Error, wrong number (or \+ type) of parameters in function evalf" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "If we don't match brackets, we get some help, but it take s some practice to understand it." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "evalf(subs(r=5,A,4);" }}{PARA 8 "" 1 "" {TEXT -1 14 " `;` unexpected" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 218 "We are physici sts, and often we wish to use units. One way to use them in Maple expl icitly is to enter them as variables, and to set them apart from the a ctual variables by a distinctive naming convention. For example:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "area:=evalf(subs(r=5*_cm,A), 4);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%areaG,$*$)%$_cmG\"\"#\"\"\"$ \"%by!\"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "It is possible to as sign variables:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "r:=5*_cm; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"rG,$%$_cmG\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(A,3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*$)%$_cmG\"\"#\"\"\"$\"$&y!\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*&%#Pi G\"\"\")%$_cmG\"\"#F&\"#D" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "and \+ then to unassign them:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "r: ='r':" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&%#PiG\"\"\")%\"rG\"\"#F%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 "The best practice for work is to keep variables una ssigned (or general) until required, and to use the " }{TEXT 19 4 "sub s" }{TEXT -1 4 " or " }{TEXT 19 4 "eval" }{TEXT -1 78 " command to eva luate for specific numbers (which is needed for plotting). The " } {TEXT 19 4 "subs" }{TEXT -1 212 " command is used more often when seve ral variables are to be substituted; note that they will be substitute d in a certain order. This ordering becomes important when one substit uted variable depends on the other." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "subs(_cm=1,Pi=3.14,r=4*_cm,A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*$)%$_cmG\"\"#\"\"\"$\"%C]!\"#" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "subs(Pi=3.14,r=4*_cm,_cm=1,A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"%C]!\"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 148 "As a final step in this initial session we point out the dangers \+ in assigning/unassigning variables before the final steps of forming a n expression:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 71 "We look at the volume of a cone, and begin with the area \+ of the circle." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#*&%#PiG\"\"\")%\"rG\"\"#F%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "Suppose we played around with particular \+ values:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "r:=sqrt(7);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"rG*$-%%sqrtG6#\"\"(\"\"\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$%#PiG\"\"(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "No w we define the volume:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 " V:=1/3*A*h;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"VG,$*&%#PiG\"\"\"% \"hGF(#\"\"(\"\"$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 16 "Now we unass ign " }{TEXT 261 1 "r" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "r:='r':" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&%#PiG\"\"\")%\"rG\"\"#F%" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "This looks as before. However:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "V;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*&%#PiG\"\"\"%\"hGF&#\"\"(\"\"$" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 19 "The expression for " }{TEXT 265 1 "V" }{TEXT -1 17 " was formed when " }{TEXT 272 1 "r" }{TEXT -1 73 " was assigned a \+ specific value. This value was used in the definition of " }{TEXT 267 1 "V" }{TEXT -1 47 ", or more precisely, the actual expression for " } {TEXT 266 1 "A" }{TEXT -1 22 " was substituted when " }{TEXT 264 1 "V " }{TEXT -1 24 " was defined, and thus, " }{TEXT 263 1 "V" }{TEXT -1 24 " has no connection with " }{TEXT 271 1 "r" }{TEXT -1 22 " anymore. Unassigning " }{TEXT 269 1 "r" }{TEXT -1 8 " return " }{TEXT 268 1 "A " }{TEXT -1 48 " to the general expression (it was defined when " } {TEXT 270 1 "r" }{TEXT -1 52 " was unassigned, but cannot turn back th e wheel for " }{TEXT 262 1 "V" }{TEXT -1 1 "!" }}{PARA 0 "" 0 "" {TEXT -1 46 "We need to assign the volume again, and since " }{TEXT 273 1 "A" }{TEXT -1 71 " has been turned back to the original general \+ expression, it works now:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "V:=1/3*A*h;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"VG,$*(%#PiG\"\" \")%\"rG\"\"#F(%\"hGF(#F(\"\"$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 140 "Now we know how to use Maple as a smart calculator. We can perfor m graphs of expressions, i.e., we have a graphing calculator at this p oint:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "plot(A,r=0..4);" } }{PARA 13 "" 1 "" {GLPLOT2D 686 211 211 {PLOTDATA 2 "6%-%'CURVESG6$7S7 $\"\"!F(7$$\"5mmmmmm;')=()!#@$\"5'[ZJ(GVJ>)Q#F,7$$\"5LLLLLe'40j\"!#?$ \"5#=Ot\"4]!=@N)F,7$$\"5nmmmm;6m$[#F2$\"5d)G7Z#=U\"z$>F27$$\"5nmmmm;yY ULF2$\"5nuBD@Mf\")4NF27$$\"5LLLLLeF>(>%F2$\"5<K'*)\\F2$\"5lI1b\"H(RW@yF27$$\"5+++++Dt:5eF2$\"5]un'*[!fO01\"!#>7$$ \"5mmmmm\"fX(emF2$\"5))y'G,1SZHR\"FN7$$\"5+++++DCh/vF2$\"5V&Qbv+4?$p! 3DEFN7$$\"5+++++I,Q+5FN$\"5-/LqxM:)R9$FN7$$\"5+++++]*3q3\"FN$\"5__E=F< 'p?r$FN7$$\"5+++++q=\\q6FN$\"5'eAZ\"oSG9/VFN7$$\"5nmmm;fBIY7FN$\"5#*eH bhr-uz[FN7$$\"5LLLLLj$[kL\"FN$\"5BxGE&[]!=6cFN7$$\"5LLLLL`Q\"GT\"FN$\" 5&Hou>`(RvqiFN7$$\"5++++]s]k,:FN$\"5K!z_'f:k4%3(FN7$$\"5LLLLL`dF!e\"FN $\"5*o[&**)>m4a%yFN7$$\"5++++]sgam;FN$\"55-j%*\\YMQD()FN7$$\"5++++]FN$\"54B5+djc$)\\6Fdr7$$\"5nmmmmTc-)*>FN$\"5QtYI?Ms:a7Fdr7$$\"5n mmm;f`@'3#FN$\"5=_rUa]OJn8Fdr7$$\"5++++]nZ)H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XESLABELSG6$Q\"h6\"%!G-%%VIEWG6$; F($\"\"\"F(%(DEFAULTG" 1 2 0 1 10 0 2 9 1 4 2 1.000000 45.000000 45.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "For a \+ 3-dimensional graph we use " }{TEXT 19 6 "plot3d" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "plot3d(V,r=0..4,h=0..1,axes=boxed,style=patch contour,shading=zhue);" }}{PARA 13 "" 1 "" {GLPLOT3D 400 300 300 {PLOTDATA 3 "6'-%%GRIDG6%;\"\"!$\"\"%F';F'$\"\"\"F'X,%)anythingG6\"F/] [[[[]\\q\\bm\":\":0000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 000000000000003F53DBA3D0CD923F3F63DBA3D0CD923F3F6DC975B9345B5F3F73DBA3 D0CD923F3F78D28CC500F6CF3F7DC975B9345B5F3F81602F56B3DFF73F83DBA3D0CD92 3F3F8657184AE744873F88D28CC500F6CF3F8B4E013F1AA9173F8DC975B9345B5F3F90 227519A706D43F91602F56B3DFF73F929DE993C0B91B3F93DBA3D0CD923F3F95195E0D DA6B633F9657184AE744873F9794D287F41DAB3F98D28CC500F6CF3F9A1047020DCFF3 3F9B4E013F1AA9173F9C8BBB7C27823B3F9DC975B9345B5F00000000000000003F73DB A3D0CD923F3F83DBA3D0CD923F3F8DC975B9345B5F3F93DBA3D0CD923F3F98D28CC500 F6CF3F9DC975B9345B5F3FA1602F56B3DFF73FA3DBA3D0CD923F3FA657184AE744873F A8D28CC500F6CF3FAB4E013F1AA9173FADC975B9345B5F3FB0227519A706D43FB1602F 56B3DFF83FB29DE993C0B91B3FB3DBA3D0CD923F3FB5195E0DDA6B633FB657184AE744 873FB794D287F41DAB3FB8D28CC500F6CF3FBA1047020DCFF33FBB4E013F1AA9173FBC 8BBB7C27823B3FBDC975B9345B5F00000000000000003F8657184AE744873F9657184A E744873FA0C152382D73663FA657184AE744873FABECDE5DA115A93FB0C152382D7366 3FB38C35418A5BF63FB657184AE744873FB921FB54442D183FBBECDE5DA115A93FBEB7 C166FDFE3A3FC0C152382D73663FC226C3BCDBE7AE3FC38C35418A5BF63FC4F1A6C638 D03F3FC657184AE744873FC7BC89CF95B8D03FC921FB54442D183FCA876CD8F2A1613F CBECDE5DA115A93FCD524FE24F89F23FCEB7C166FDFE3A3FD00E9975D639413FD0C152 382D736600000000000000003F93DBA3D0CD923F3FA3DBA3D0CD923F3FADC975B9345B 5F3FB3DBA3D0CD923F3FB8D28CC500F6CF3FBDC975B9345B5F3FC1602F56B3DFF73FC3 DBA3D0CD923F3FC657184AE744873FC8D28CC500F6CF3FCB4E013F1AA9173FCDC975B9 345B5F3FD0227519A706D43FD1602F56B3DFF73FD29DE993C0B91B3FD3DBA3D0CD923F 3FD5195E0DDA6B633FD657184AE744873FD794D287F41DAB3FD8D28CC500F6CF3FDA10 47020DCFF33FDB4E013F1AA9173FDC8BBB7C27823B3FDDC975B9345B5F000000000000 00003F9F072FF64134833FAF072FF64134833FB74563F8B0E7623FBF072FF64134833F C3647DF9E8C0D23FC74563F8B0E7623FCB2649F7790DF33FCF072FF64134833FD1740A FA84AD8A3FD3647DF9E8C0D23FD554F0F94CD41A3FD74563F8B0E7623FD935D6F814FA AB3FDB2649F7790DF33FDD16BCF6DD213B3FDF072FF64134833FE07BD17AD2A3E63FE1 740AFA84AD8A3FE26C447A36B72E3FE3647DF9E8C0D23FE45CB7799ACA763FE554F0F9 4CD41A3FE64D2A78FEDDBE3FE74563F8B0E76200000000000000003FA657184AE74487 3FB657184AE744873FC0C152382D73663FC657184AE744873FCBECDE5DA115A93FD0C1 52382D73663FD38C35418A5BF63FD657184AE744873FD921FB54442D183FDBECDE5DA1 15A93FDEB7C166FDFE3A3FE0C152382D73663FE226C3BCDBE7AE3FE38C35418A5BF63F E4F1A6C638D03F3FE657184AE744873FE7BC89CF95B8D03FE921FB54442D183FEA876C D8F2A1613FEBECDE5DA115A93FED524FE24F89F23FEEB7C166FDFE3A3FF00E9975D639 413FF0C152382D736600000000000000003FAE6852D7BAC7F13FBE6852D7BAC7F13FC6 CE3E21CC15F53FCE6852D7BAC7F13FD30133C6D4BCF73FD6CE3E21CC15F53FDA9B487C C36EF33FDE6852D7BAC7F13FE11AAE995910783FE30133C6D4BCF73FE4E7B8F4506976 3FE6CE3E21CC15F53FE8B4C34F47C2743FEA9B487CC36EF33FEC81CDAA3F1B723FEE68 52D7BAC7F13FF0276C029B3A383FF11AAE995910783FF20DF13016E6B73FF30133C6D4 BCF73FF3F4765D9293363FF4E7B8F45069763FF5DAFB8B0E3FB53FF6CE3E21CC15F500 000000000000003FB3DBA3D0CD923F3FC3DBA3D0CD923F3FCDC975B9345B5F3FD3DBA3 D0CD923F3FD8D28CC500F6CF3FDDC975B9345B5F3FE1602F56B3DFF83FE3DBA3D0CD92 3F3FE657184AE744873FE8D28CC500F6CF3FEB4E013F1AA9173FEDC975B9345B5F3FF0 227519A706D43FF1602F56B3DFF83FF29DE993C0B91B3FF3DBA3D0CD923F3FF5195E0D DA6B633FF657184AE744873FF794D287F41DAB3FF8D28CC500F6CF3FFA1047020DCFF3 3FFB4E013F1AA9173FFC8BBB7C27823B3FFDC975B9345B5F00000000000000003FB921 FB54442D183FC921FB54442D183FD2D97C7F3321D23FD921FB54442D183FDF6A7A2955 385E3FE2D97C7F3321D23FE5FDBBE9BBA7753FE921FB54442D183FEC463ABECCB2BB3F EF6A7A2955385E3FF1475CC9EEDF013FF2D97C7F3321D23FF46B9C347764A43FF5FDBB E9BBA7753FF78FDB9EFFEA473FF921FB54442D183FFAB41B09886FEA3FFC463ABECCB2 BB3FFDD85A7410F58D3FFF6A7A2955385E40007E4CEF4CBD984001475CC9EEDF014002 106CA49100694002D97C7F3321D200000000000000003FBF072FF64134833FCF072FF6 4134833FD74563F8B0E7623FDF072FF64134833FE3647DF9E8C0D23FE74563F8B0E762 3FEB2649F7790DF33FEF072FF64134833FF1740AFA84AD8A3FF3647DF9E8C0D23FF554 F0F94CD41A3FF74563F8B0E7623FF935D6F814FAAB3FFB2649F7790DF33FFD16BCF6DD 213B3FFF072FF641348340007BD17AD2A3E64001740AFA84AD8A40026C447A36B72E40 03647DF9E8C0D240045CB7799ACA76400554F0F94CD41A40064D2A78FEDDBE40074563 F8B0E76200000000000000003FC2C5A0DB6254403FD2C5A0DB6254403FDC287149137E 603FE2C5A0DB6254403FE77709123AE9503FEC287149137E603FF06CECBFF609B83FF2 C5A0DB6254403FF51E54F6CE9EC83FF77709123AE9503FF9CFBD2DA733D83FFC287149 137E603FFE8125647FC8E840006CECBFF609B840019946CDAC2EFC4002C5A0DB625440 4003F1FAE918798440051E54F6CE9EC840064AAF0484C40C40077709123AE9504008A3 631FF10E944009CFBD2DA733D8400AFC173B5D591C400C287149137E60000000000000 00003FC657184AE744873FD657184AE744873FE0C152382D73663FE657184AE744873F EBECDE5DA115A93FF0C152382D73663FF38C35418A5BF63FF657184AE744873FF921FB 54442D183FFBECDE5DA115A93FFEB7C166FDFE3A4000C152382D7366400226C3BCDBE7 AE40038C35418A5BF64004F1A6C638D03F400657184AE744874007BC89CF95B8D04009 21FB54442D18400A876CD8F2A161400BECDE5DA115A9400D524FE24F89F2400EB7C166 FDFE3A40100E9975D639414010C152382D736600000000000000003FCA37FE49AF6B18 3FDA37FE49AF6B183FE3A9FEB74390523FEA37FE49AF6B183FF062FEEE0DA2EF3FF3A9 FEB74390523FF6F0FE80797DB53FFA37FE49AF6B183FFD7EFE12E5587B400062FEEE0D A2EF4002067ED2A899A04003A9FEB743905240054D7E9BDE87034006F0FE80797DB540 08947E65147466400A37FE49AF6B18400BDB7E2E4A61C9400D7EFE12E5587B400F227D F7804F2C401062FEEE0DA2EF401134BEE05B1E484012067ED2A899A04012D83EC4F614 F94013A9FEB743905200000000000000003FCE6852D7BAC7F13FDE6852D7BAC7F13FE6 CE3E21CC15F53FEE6852D7BAC7F13FF30133C6D4BCF73FF6CE3E21CC15F53FFA9B487C C36EF33FFE6852D7BAC7F140011AAE9959107840030133C6D4BCF74004E7B8F4506976 4006CE3E21CC15F54008B4C34F47C274400A9B487CC36EF3400C81CDAA3F1B72400E68 52D7BAC7F14010276C029B3A3840111AAE9959107840120DF13016E6B740130133C6D4 BCF74013F4765D9293364014E7B8F45069764015DAFB8B0E3FB54016CE3E21CC15F500 000000000000003FD1740AFA84AD8A3FE1740AFA84AD8A3FEA2E1077C7044F3FF1740A FA84AD8A3FF5D10DB925D8EC3FFA2E1077C7044F3FFE8B1336682FB14001740AFA84AD 8A4003A28C59D5433B4005D10DB925D8EC4007FF8F18766E9D400A2E1077C7044F400C 5C91D7179A00400E8B1336682FB140105CCA4ADC62B14011740AFA84AD8A40128B4BAA 2CF8624013A28C59D5433B4014B9CD097D8E144015D10DB925D8EC4016E84E68CE23C5 4017FF8F18766E9D401916CFC81EB976401A2E1077C7044F00000000000000003FD3DB A3D0CD923F3FE3DBA3D0CD923F3FEDC975B9345B5F3FF3DBA3D0CD923F3FF8D28CC500 F6CF3FFDC975B9345B5F4001602F56B3DFF84003DBA3D0CD923F400657184AE7448740 08D28CC500F6CF400B4E013F1AA917400DC975B9345B5F4010227519A706D44011602F 56B3DFF840129DE993C0B91B4013DBA3D0CD923F4015195E0DDA6B63401657184AE744 87401794D287F41DAB4018D28CC500F6CF401A1047020DCFF3401B4E013F1AA917401C 8BBB7C27823B401DC975B9345B5F00000000000000003FD66AF3EEB8121A3FE66AF3EE B8121A3FF0D036F30A0D933FF66AF3EEB8121A3FFC05B0EA6616A04000D036F30A0D93 40039D9570E10FD640066AF3EEB8121A400938526C8F145D400C05B0EA6616A0400ED3 0F683D18E34010D036F30A0D93401236E631F58EB540139D9570E10FD640150444AFCC 90F840166AF3EEB8121A4017D1A32DA3933B401938526C8F145D401A9F01AB7A957E40 1C05B0EA6616A0401D6C60295197C2401ED30F683D18E340201CDF53944D024020D036 F30A0D9300000000000000003FD921FB54442D183FE921FB54442D183FF2D97C7F3321 D23FF921FB54442D183FFF6A7A2955385E4002D97C7F3321D24005FDBBE9BBA7754009 21FB54442D18400C463ABECCB2BB400F6A7A2955385E4011475CC9EEDF014012D97C7F 3321D240146B9C347764A44015FDBBE9BBA77540178FDB9EFFEA47401921FB54442D18 401AB41B09886FEA401C463ABECCB2BB401DD85A7410F58D401F6A7A2955385E40207E 4CEF4CBD984021475CC9EEDF014022106CA49100694022D97C7F3321D2000000000000 00003FDC00BA0171E33B3FEC00BA0171E33B3FF5008B81156A6D3FFC00BA0171E33B40 01807440E72E054005008B81156A6D400880A2C143A6D4400C00BA0171E33B400F80D1 41A01FA34011807440E72E054013407FE0FE4C394015008B81156A6D4016C097212C88 A0401880A2C143A6D4401A40AE615AC508401C00BA0171E33B401DC0C5A189016F401F 80D141A01FA34020A06E70DB9EEB4021807440E72E054022607A10F2BD1F4023407FE0 FE4C3940242085B109DB534025008B81156A6D00000000000000003FDF072FF6413483 3FEF072FF64134833FF74563F8B0E7623FFF072FF64134834003647DF9E8C0D2400745 63F8B0E762400B2649F7790DF3400F072FF64134834011740AFA84AD8A4013647DF9E8 C0D2401554F0F94CD41A40174563F8B0E762401935D6F814FAAB401B2649F7790DF340 1D16BCF6DD213B401F072FF641348340207BD17AD2A3E64021740AFA84AD8A40226C44 7A36B72E4023647DF9E8C0D240245CB7799ACA76402554F0F94CD41A40264D2A78FEDD BE40274563F8B0E76200000000000000003FE11AAE995910783FF11AAE995910783FF9 A805E60598B340011AAE995910784005615A3FAF54964009A805E60598B3400DEEB18C 5BDCD140111AAE9959107840133E046C8432874015615A3FAF5496401784B012DA76A4 4019A805E60598B3401BCB5BB930BAC2401DEEB18C5BDCD140200903AFC37F7040211A AE9959107840222C5982EEA17F40233E046C84328740244FAF5619C38E4025615A3FAF 5496402673052944E59D402784B012DA76A44028965AFC7007AC4029A805E60598B300 000000000000003FE2C5A0DB6254403FF2C5A0DB6254403FFC287149137E604002C5A0 DB62544040077709123AE950400C287149137E6040106CECBFF609B84012C5A0DB6254 4040151E54F6CE9EC840177709123AE9504019CFBD2DA733D8401C287149137E60401E 8125647FC8E840206CECBFF609B840219946CDAC2EFC4022C5A0DB6254404023F1FAE9 18798440251E54F6CE9EC840264AAF0484C40C40277709123AE9504028A3631FF10E94 4029CFBD2DA733D8402AFC173B5D591C402C287149137E6000000000000000003FE484 6EC13C659B3FF4846EC13C659B3FFEC6A621DA98684004846EC13C659B4009A58A718B 7F01400EC6A621DA98684011F3E0E914D8E74014846EC13C659B401714FC9963F24E40 19A58A718B7F01401C361849B30BB4401EC6A621DA98684020AB99FD01128E4021F3E0 E914D8E740233C27D5289F414024846EC13C659B4025CCB5AD502BF4402714FC9963F2 4E40285D438577B8A84029A58A718B7F01402AEDD15D9F455B402C361849B30BB4402D 7E5F35C6D20E402EC6A621DA986800000000000000003FE657184AE744873FF657184A E744874000C152382D7366400657184AE74487400BECDE5DA115A94010C152382D7366 40138C35418A5BF6401657184AE74487401921FB54442D18401BECDE5DA115A9401EB7 C166FDFE3A4020C152382D7366402226C3BCDBE7AE40238C35418A5BF64024F1A6C638 D03F402657184AE744874027BC89CF95B8D0402921FB54442D18402A876CD8F2A16140 2BECDE5DA115A9402D524FE24F89F2402EB7C166FDFE3A40300E9975D639414030C152 382D7366-%'COLOURG6#%%ZHUEG-%&STYLEG6#%-PATCHCONTOURG-%+AXESLABELSG6%% \"rG%\"hG%!G-%*AXESSTYLEG6#%$BOXG" 1 4 0 1 10 0 2 4 1 2 2 1.000000 41.000000 -113.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {SECT 0 {PARA 3 "" 0 "" {TEXT 275 20 "Maple knows Calculus" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 158 "We begin by resetting Maple. This comes \+ close to quitting the program and restarting it (we lose all variables , but we do not recover all the memory used up)." }}{PARA 0 "" 0 "" {TEXT -1 189 "Many worksheets have this command at their beginning, as you may either want to clear memory from a previous calculation withi n a different worksheet, or re-run the worksheet independently." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 12 "y:=exp(3*x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"yG-%$expG6#,$%\"xG\"\"$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Note that " }{TEXT 276 1 "y" }{TEXT -1 85 " is an expression in Ma ple. We will learn how to use mappings in Maple further below." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "yp:=diff(y,x);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%#ypG,$-%$expG6#,$%\"xG\"\"$F+" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "The anti-derivative (indefinite integral) is calculated by" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "Y:=int (y,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"YG,$-%$expG6#,$%\"xG\"\" $#\"\"\"F+" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "A definite integral between constant boundaries results in a number:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 14 "int(y,x=0..2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&-%$expG6#\"\"'#\"\"\"\"\"$#!\"\"F*F)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(%,4);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$ \"%U8!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Euler's number is p rinted as a non-italicized letter e." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "exp(1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#\" \"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "This is not to be confuse d with" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "e;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"eG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "whic h is the unassigned variable " }{TEXT 277 1 "e" }{TEXT -1 85 ". This s ounds a bit like Pi and pi, except that one enters Euler's number via \+ exp(1)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "E;" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%\"EG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 "No te that the " }{TEXT 19 4 "subs" }{TEXT -1 54 " command introduced ear lier does not force evaluation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "subs(x=0,y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#\"\"! " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Maple knows something about limits." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "limit(y,x=infinity);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%)infinityG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "limit(y,x =-infinity);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "Let us see why we need " }{TEXT 19 8 "sim plify" }{TEXT -1 13 " quite often." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "s1:=sin(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#s1G -%$sinG6#%\"xG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "s2:=cos(x );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#s2G-%$cosG6#%\"xG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "s3:=s1^2+s2^2;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#s3G,&*$)-%$sinG6#%\"xG\"\"#\"\"\"F-*$)-%$cosGF*F,F-F -" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "s3;" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#,&*$)-%$sinG6#%\"xG\"\"#\"\"\"F+*$)-%$cosGF(F*F+F+" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "simplify(s3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "Keep in mind that the latter command did not change the content of th e variable s3. For that purpose an assignment is required." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "s3;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&*$)-%$sinG6#%\"xG\"\"#\"\"\"F+*$)-%$cosGF(F*F+F+" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "s3:=simplify(s3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#s3G\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "The above simplification can actually be obtained in another way." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "s3:=s1^2+s2^2;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#s3G,&*$)-%$sinG6#%\"xG\"\"#\"\"\"F-*$)-%$cos GF*F,F-F-" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "combine(s3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "or more specifically" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "combine(s3,trig);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# \"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 19 7 "combi ne" }{TEXT -1 89 " command is useful in other contexts where we wish t o control the display of expressions." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "y:=exp(s)*exp(t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >%\"yG*&-%$expG6#%\"sG\"\"\"-F'6#%\"tGF*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$ex pG6#,&%\"sG\"\"\"%\"tGF(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "combine(y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#,&%\"sG\"\"\" %\"tGF(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "expand(%);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#*&-%$expG6#%\"sG\"\"\"-F%6#%\"tGF(" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 19 8 "combine " } {TEXT 2 3 "and" }{TEXT 19 7 " expand" }{TEXT 2 45 " commands allow us \+ to switch hence and forth." }}{PARA 0 "" 0 "" {TEXT -1 133 "Often it i s necessary to pull out parts of expressions. While this is tedious at times, and one tries to avoid it, here is the trick." }}{PARA 0 "" 0 "" {TEXT -1 47 "An expression has a certain number of operands:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "nops(y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "One can p ull out the operands one-by-one:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "op(1,y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#% \"sG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "op(2,y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#%\"tG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "Suppose we want the argument of the exp function in the s econd operand:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "nops(op(2 ,y));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 14 "op(1,op(2,y));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"tG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 147 "There is no harm \+ in practicing this a bit on complicated expressions. It shows how Mapl e assembles expressions in a tree-like hierarchical fashion." }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 285 "Now we introduce mappings. They a re not strictly required for simple function assignments, as we could \+ do everything using expressions. Nevertheless they allow more flexibil ity in substituting arguments, and provide an easy first step towards \+ subroutines (called procedures in Maple). " }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 14 "g:=t->exp(-t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#> %\"gGR6#%\"tG6\"6$%)operatorG%&arrowGF(-%$expG6#,$9$!\"\"F(F(F(" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "g;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"gG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(x) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#,$%\"xG!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "In the latter step we used the mapping " }{TEXT 279 1 "g" }{TEXT -1 30 " to produce the expression in " }{TEXT 278 1 "x" }{TEXT -1 151 ". We can plot expressions (as before), and ma ppings as well, but the latter work differently. Be careful to observe what works, and what doesn't below:" }}}{E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 0 2 9 1 4 2 1.000000 45.000000 47.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "plot(g(x), -1..5);" }}{PARA 8 "" 1 "" {TEXT -1 26 "Plotting error, empty plot" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 133 "Many beginners get very confused by the above. There is always a logical reason when an empty plot is \+ produced, or when a plot fails!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 176 "It is safer to work with expressions in \+ Maple. Often we manipulate them, and then want to use them as mappings in the end. There is a command to turn expressions into mappings:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "y:=exp(-2*x)*sin(x)+exp(x)* cos(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"yG,&*&-%$expG6#,$%\"xG! \"#\"\"\"-%$sinG6#F+F-F-*&-F(F0F--%$cosGF0F-F-" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 17 "ym:=unapply(y,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#ymGR6#%\"xG6\"6$%)operatorG%&arrowGF(,&*&-%$expG6#,$ 9$!\"#\"\"\"-%$sinG6#F2F4F4*&-F/F7F4-%$cosGF7F4F4F(F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "evalf(subs(x=3,y));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$!+/\"=%))>!\")" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "evalf(ym(3));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$!+/ \"=%))>!\")" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 161 "Mappings can be d ifferentiated directly using the D differential operator. We do not ne ed to specify the independent variable, as it is just a dummy placehol der." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "ypm:=D(ym);" }} {PARA 11 "" 1 "" {XPPM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F_p7$F`q$\"10`U&)*=MV\"F_p7$Feq$\"1\\$G#f@\"F_p7$F_r$\"1m:\"e#[W96F_p7$Fdr$\"1&*e:C2[65F_p7$Fir$\"1^N_*48(f \"*F*7$F^s$\"1r5$z&>6w\")F*7$Fcs$\"1CxwAuNtsF*7$Fhs$\"1YA!)4Ul)G'F*7$F ]t$\"1@sQ<,lT_F*7$Fbt$\"1oW:=$f1I%F*7$Fgt$\"1U7GQ*RSC$F*7$F\\u$\"1L(\\ _K$y)4#F*7$Fau$\"1!)4H&HCB;*FK7$Ffu$!1o%eyqr![HFK7$F[v$!1$p_)G1'es\"F* 7$F`v$!1p\")z=A@(4$F*7$Fev$!1p1aPS$)eYF*7$Fjv$!1in+xONnhF*7$F_w$!1$*=j !y*>DzF*7$Fdw$!1bgqY$)**)o*F*7$Fiw$!1WonMFFl6F_p7$F^x$!1D^8oZqp8F_p7$F cx$!1$\\[j-*\\(f\"F_p7$Fhx$!1XDIrruI=F_p7$F]y$!1jt()4:&Q3#F_p7$Fby$!1( fg%*f())\\BF_p7$Fgy$!1([je89zg#F_p7$F\\z$!1l\\@,o-?HF_p7$Faz$!13\"*HQ= L9KF_p7$Ffz$!1'4\"*QZyTa$F_p7$F[[l$!1nOZ\\AkvQF_p7$F`[l$!1&p$*)RJC\\UF _p-Fe[l6&Fg[lFh[lFi[lFh[l-%+AXESLABELSG6$%!GFgel-%*AXESSTYLEG6#%$BOXG- %%VIEWG6$;$!\"&!\"\"$\"#:Fbfl%(DEFAULTG" 1 2 0 1 10 0 2 9 1 2 2 1.000000 45.000000 45.000000 0 0 "Curve 1" "Curve 2" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "Note how the function " }{TEXT 280 1 "y" } {TEXT -1 47 " (blue) has an extremum point (maximum) around " }{TEXT 281 1 "x" }{TEXT -1 112 "=0.75, and the derivative (green) vanishes th ere. Make other observations about the function and its derivative." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 124 "Note th at the display of differentiated mapping may appear confusing, as mapp ings are referred to by just the function name:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 7 "D(sin);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%$co sG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 34 "Mappings can be combined in Maple." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "g1:=t->exp(-t); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g1GR6#%\"tG6\"6$%)operatorG%&ar rowGF(-%$expG6#,$9$!\"\"F(F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "g2:=s->sin(2*s);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g2GR6#% \"sG6\"6$%)operatorG%&arrowGF(-%$sinG6#,$9$\"\"#F(F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "g3:=g1@g2;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g3G-%\"@G6$%#g1G%#g2G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "g3(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$expG6#,$- %$sinG6#,$%\"xG\"\"#!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 206 "Of \+ course, the order is important as we are nesting functions (mappings) \+ here. Also note that we need brackets if we want to evaluate directly \+ the combined mapping at some value of the independent variable." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "(g2@g1)(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$sinG6#,$-%$expG6#,$%\"xG!\"\"\"\"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "We can test out our knowledge of function s and their inverses:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "(l n@exp)(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%#lnG6#-%$expG6#%\"xG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%#lnG6#-%$expG6#%\"xG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "combine(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#- %#lnG6#-%$expG6#%\"xG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "ex pand(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%#lnG6#-%$expG6#%\"xG" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 212 "Now, Maple can be very fussy, wh ich can drive physicists up some trees... In those cases use carefully the following (which simply assumes nice things about the variables, \+ which might be true - or sometimes not!)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "simplify(%,symbolic);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"xG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "We will have to le arn about the " }{TEXT 19 6 "assume" }{TEXT -1 77 " system, which allo ws to make assumptions about variable in a controlled way." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "assume(x,real);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "ln(exp(x));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%#x|irG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "ln(exp(s)) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%#lnG6#-%$expG6#%\"sG" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "If we wish to drop the assumption \+ on " }{TEXT 282 1 "x" }{TEXT -1 17 ", we unassign it." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "x:='x':" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 11 "exp(ln(x));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"x G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "ln(exp(x));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%#lnG6#-%$expG6#%\"xG" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 30 "Mappings can also be iterated." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "y:=sin@@3;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"yG-%#@@G6$%$sinG\"\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "y(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#--%#@@G6$%$sinG\"\"$6#% \"xG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "y(1);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#--%#@@G6$%$sinG\"\"$6#\"\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #$\"+uZI%y'!#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "evalf(sin (sin(sin(1))));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+uZI%y'!#5" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "Note that Maple reserves the notat ion sin^" }{TEXT 283 1 "n" }{TEXT -1 105 " for the case of the repeate d application of the sine function. It will never display sine raised \+ to the " }{TEXT 284 1 "n" }{TEXT -1 84 "th power as is usually done in Math texts, as this leaves room for ambiguity. sin^2(" }{TEXT 287 1 " x" }{TEXT -1 25 ") in Maple means sin(sin(" }{TEXT 286 1 "x" }{TEXT -1 13 ")), not (sin(" }{TEXT 285 1 "x" }{TEXT -1 5 "))^2." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "The system of assumptions is important in integral evaluations. Suppose we wish to obtain:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 33 "int(exp(-alpha*r),r=0..infinity);" }}{PARA 6 "" 1 "" {TEXT -1 68 "Definite integration: Can't determine if the in tegral is convergent." }}{PARA 6 "" 1 "" {TEXT -1 34 "Need to know the sign of --> alpha" }}{PARA 6 "" 1 "" {TEXT -1 57 "Will now try indefi nite integration and then take limits." }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%&limitG6$,$*&,&-%$expG6#,$*&%&alphaG\"\"\"%\"rGF/!\"\"F/F1F/F/ F.F1F1/F0%)infinityG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "ass ume(alpha>0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "int(exp(-a lpha*r),r=0..infinity);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&\"\"\"F$% 'alpha|irG!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 279 "Maple has sma rtened up compared to previous versions, and tells us that assumptions are needed to obtain the result. It normally displays variables with \+ assumptions on them by a tilde attached to the variable, but this feat ure can be turned off [easiest through the menu, or via " }{TEXT 19 24 "interface(showassumed)=0" }{TEXT -1 53 "]. However, we can always \+ find out about assumptions:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "about(alpha);" }}{PARA 6 "" 1 "" {TEXT -1 33 "Originally alpha, re named alpha~:" }}{PARA 6 "" 1 "" {TEXT -1 47 " is assumed to be: Real Range(Open(0),infinity)" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 149 "We finish this section by a real-life ph ysics example. We solve the Newton equation for free fall at the surfa ce of a planet (constant acceleration)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "NE:=m*diff(v(t),t)=m*g;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#NEG/*&% \"mG\"\"\"-%%diffG6$-%\"vG6#%\"tGF/F(*&F'F(%\"gGF(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 2 77 "We begin by writing the integrals in unevaluated f orm (upper-case version of " }{TEXT 19 3 "int" }{TEXT 2 156 "). We hav e to introduce a new dummy variable s for time, in order not to confus e the integration boundary with the integration variable. We make use \+ of the " }{TEXT 19 3 "lhs" }{TEXT 2 5 " and " }{TEXT 19 3 "rhs" } {TEXT 2 48 " functions to pull out the sides of the equation" }{TEXT -1 11 ". The mass " }{TEXT 288 1 "m" }{TEXT -1 32 " is divided out of \+ the equation." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "NE1:=Int(l hs(NE/m),t=0..s)=Int(rhs(NE/m),t=0..s);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$NE1G/-%$IntG6$-%%diffG6$-%\"vG6#%\"tGF//F/;\"\"!%\"sG-F'6$%\" gGF0" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "We can carry out the inte gration using the " }{TEXT 19 5 "value" }{TEXT -1 9 " command." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "NE1:=value(NE1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$NE1G/,&-%\"vG6#%\"sG\"\"\"-F(6#\"\"!!\"\" *&%\"gGF+F*F+" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "Now we introduce the relationship between velocity and position (keeping " }{TEXT 289 1 "s" }{TEXT -1 22 " as the time variable)" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 34 "NE2:=diff(x(s),s)=solve(NE1,v(s));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$NE2G/-%%diffG6$-%\"xG6#%\"sGF,,&-%\"vG6#\"\"!\" \"\"*&%\"gGF2F,F2F2" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "NE2: =Int(lhs(NE2),s=0..t)=Int(rhs(NE2),s=0..t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$NE2G/-%$IntG6$-%%diffG6$-%\"xG6#%\"sGF//F/;\"\"!%\"t G-F'6$,&-%\"vG6#F2\"\"\"*&%\"gGF:F/F:F:F0" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 16 "sol:=value(NE2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #>%$solG/,&-%\"xG6#%\"tG\"\"\"-F(6#\"\"!!\"\",&*&-%\"vGF-F+F*F+F+*&%\" gGF+)F*\"\"#F+#F+F7" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "solv e(sol,x(t));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(-%\"xG6#\"\"!\"\"\"* &-%\"vGF&F(%\"tGF(F(*&%\"gGF()F,\"\"#F(#F(F0" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 12 "We used the " }{TEXT 19 5 "solve" }{TEXT -1 20 " comman d to isolate " }{TEXT 291 1 "x" }{TEXT -1 1 "(" }{TEXT 290 1 "t" } {TEXT -1 2 ")." }}{PARA 0 "" 0 "" {TEXT -1 128 "Maple has a built-in d ifferential equation solver, which can crack a large percentage of sol vable linear differential equations." }}{PARA 0 "" 0 "" {TEXT -1 86 "F irst we re-define NE as the differential equation for position as a fu nction of time:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "NE:=m*di ff(x(t),t$2)=m*g;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#NEG/*&%\"mG\" \"\"-%%diffG6$-%\"xG6#%\"tG-%\"$G6$F/\"\"#F(*&F'F(%\"gGF(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sol:=dsolve(NE,x(t));" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%$solG/-%\"xG6#%\"tG,(*&%\"gG\"\"\")F)\"\"#F-#F -F/*&%$_C1GF-F)F-F-%$_C2GF-" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 123 "N o boundary (initial) conditions were specified, and therefore we have \+ the general solution with two integration constants." }}{PARA 0 "" 0 " " {TEXT 293 1 "x" }{TEXT -1 1 "(" }{TEXT 292 1 "t" }{TEXT -1 149 ") ha s not been assigned. There are two options. The more convenient one is actually to not assign x(t), but to extract the solution as an expres sion:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "rhs(sol);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(*&%\"gG\"\"\")%\"tG\"\"#F&#F&F)*&%$_C1GF&F (F&F&%$_C2GF&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "x(t);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#-%\"xG6#\"\"\"" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 12 "assign(sol);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "x(t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(*&%\"gG\"\" \")%\"tG\"\"#F&#F&F)*&%$_C1GF&F(F&F&%$_C2GF&" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 160 "If one wants to use x(t) again (even for re-defining a differential equation), one has to unassign (this is why never making the assignment is more convenient):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "x(t):='x(t)':" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 189 "One can also find the special solution by specifying initial cond itions (either as numbers or as symbols). One needs the D differential operator to specify the condition for the derivative." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "IC:=x(0)=x0,D(x)(0)=v0;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#ICG6$/-%\"xG6#\"\"!%#x0G/--%\"DG6#F(F)%#v 0G" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "One solves the set of diffe rential equation(s) and initial conditions:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "sol:=dsolve(\{NE,IC\},x(t));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$solG6\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "Thi s used to work in previous versions, and does again in Maple 6. In Map le 5 one needs to give Maple a hint:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "sol:=dsolve(\{NE,IC\},x(t),method=laplace);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 230 "It is useful to assign dsolve to \+ a variable. In that case when the empty set is returned (which means: \+ \"I couldn't come up with a solution\", not \"There is no solution\") \+ one sees it right away (otherwise an empty line is produced)." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 294 28 "and some \+ linear algebra too!" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 179 "In this pa rt we deal with Maple's handling of linear algebra problems. Vectors p lay an important role in physics. We learn that Maple has (at least) t wo ways of dealing with them." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 174 "The first way is through objects called \+ lists. Lists can be ordered (tables) or unordered. They allow to appen d objects, similarly as sets represent accumulations of objects." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 224 "Vectors \+ are something more, there are mathematical operations defined on them \+ which are performed by arithmetic on the components. Maple has an arra y construct to deal with vectors and matrices, and a special package c alled " }{TEXT 19 6 "linalg" }{TEXT -1 184 " that contains many useful procedures to compute operations such as determinant, matrix inverse, eigenvalues, etc. In Maple 6 a new linear algebra package has been ad ded; it is called " }{TEXT 19 13 "LinearAlgebra" }{TEXT -1 162 ", and \+ allows superior handling of numerical linear algebra problems. For com patibility with Maple 5 we will refrain from using the new package for the time being." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "We first show the pitfalls of using simple lists:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 12 "xv:=[1,4,9];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#xvG7%\"\"\"\"\"%\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "xv[1]; xv[2]; xv[3];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"\" " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "pri nt(xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%\"\"\"\"\"%\"\"*" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "eval(xv);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#7%\"\"\"\"\"%\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "xv;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%\"\"\"\"\"%\" \"*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "This looks easy: we define d a quantity " }{TEXT 19 2 "xv" }{TEXT -1 105 ", and were able to acce ss its components using square brackets. Maple refers to this construc t as a list." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "whattype(xv);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%%listG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 282 "There was no need to declare the object. However, it is \+ clear from the first line that Maple had enough information to deal wi th the construct, namely an ordered list of 3 objects. We cannot trivi ally add another, e.g., xv[4]:an error message is produced by referrin g to the object:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "xv[4];" }}{PARA 8 "" 1 "" {TEXT -1 33 "Error, invalid subscript selector" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 115 "The reference to an element of the list \+ using the subscript in square brackets is equivalent to the op() const ruct:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "nops(xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "o p(2,xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 123 "Suppose we wish to expand the list by adding anot her element. The following doesn't work, as it generates a list in a l ist." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "xv1:=[xv,16];" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%$xv1G7$7%\"\"\"\"\"%\"\"*\"#;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 140 "We need to first extract the elements fr om the previous list. This can be performed the long way or with a sho rtcut (see ?list for details):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "o p(1..nops(xv),xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\"\"\"%\"\"* " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "op(xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\"\"\"%\"\"*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "We are ready to expand our list and re-use its name (be careful with recursive definitions)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "xv :=[op(xv),16];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#xvG7&\"\"\"\"\"% \"\"*\"#;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "xv[4];" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"#;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 195 "For many purposes the work with lists in Maple is the most eff icient way to deal with multi-component objects. It is possible for Ma ple to run out of steam when lists contain 100 entries or more." }} {PARA 0 "" 0 "" {TEXT -1 61 "We note that the following practice does \+ something different:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "yv[1]:=1;" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%#yvG6#\"\"\"F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "yv[2]:=8;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #>&%#yvG6#\"\"#\"\")" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "yv[ 3]:=27;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%#yvG6#\"\"$\"#F" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "print(yv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%&TABLEG6#7%/\"\"\"F(/\"\"#\"\")/\"\"$\"#F" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "whattype(yv);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%'symbolG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "yv[2];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\")" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 108 "Tables indexed by integers are ordered, \+ but the way they are stored and displayed is not always predictable." }}{PARA 0 "" 0 "" {TEXT -1 147 "There are functions to convert between tables and lists; in older Maple versions one had to watch what happe ned when the entries were out of order." }}{PARA 0 "" 0 "" {TEXT -1 208 "Tables are extremely flexible: they provide a very general pointe r structure, whereby the indexing does not have to be continuous. In f act the index can almost be anything. The table simply provides the li nk." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "yv[5]:=101;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>&%#yvG6#\"\"&\"$,\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "yv[4]:=87;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%#yvG6#\"\"%\"#()" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "yv[i]:=2*i;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%#yvG6#%\"iG,$F' \"\"#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "yv[j]:=2*j-1;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>&%#yvG6#%\"jG,&F'\"\"#!\"\"\"\"\"" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "print(yv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%&TABLEG6#7)/%\"jG,&F(\"\"#!\"\"\"\"\"/F,F,/F*\" \")/\"\"$\"#F/\"\"%\"#()/\"\"&\"$,\"/%\"iG,$F:F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "convert(yv,list);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7),&%\"jG\"\"#!\"\"\"\"\"F(\"\")\"#F\"#()\"$,\",$%\"iGF &" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 153 "It appears that the numeric ally indexed entries are coming out in proper order, and that the orde r of generally defined entries is not quite predictable." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 295 16 "Arrays in Maple. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 122 "To d eal with vectors and matrices where the indexing is in terms of intege r numbers Maple has the array construct. In the " }{TEXT 19 6 "linalg " }{TEXT -1 141 " package there are special procedures called vector a nd matrix which define the required arrays. It is possible to define a rrays outside the " }{TEXT 19 6 "linalg" }{TEXT -1 153 " package. Sinc e we are interested in the functions contained in the linalg package, \+ we use the vector and matrix constructs from it to define the arrays. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg);" }}{PARA 7 "" 1 " " {TEXT -1 32 "Warning, new definition for norm" }}{PARA 7 "" 1 "" {TEXT -1 33 "Warning, new definition for trace" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#7^r%.BlockDiagonalG%,GramSchmidtG%,JordanBlockG%)LUdeco mpG%)QRdecompG%*WronskianG%'addcolG%'addrowG%$adjG%(adjointG%&angleG%( augmentG%(backsubG%%bandG%&basisG%'bezoutG%,blockmatrixG%(charmatG%)ch arpolyG%)choleskyG%$colG%'coldimG%)colspaceG%(colspanG%*companionG%'co ncatG%%condG%)copyintoG%*crossprodG%%curlG%)definiteG%(delcolsG%(delro wsG%$detG%%diagG%(divergeG%(dotprodG%*eigenvalsG%,eigenvaluesG%-eigenv ectorsG%+eigenvectsG%,entermatrixG%&equalG%,exponentialG%'extendG%,ffg ausselimG%*fibonacciG%+forwardsubG%*frobeniusG%*gausselimG%*gaussjordG %(geneqnsG%*genmatrixG%%gradG%)hadamardG%(hermiteG%(hessianG%(hilbertG %+htransposeG%)ihermiteG%*indexfuncG%*innerprodG%)intbasisG%(inverseG% 'ismithG%*issimilarG%'iszeroG%)jacobianG%'jordanG%'kernelG%*laplacianG %*leastsqrsG%)linsolveG%'mataddG%'matrixG%&minorG%(minpolyG%'mulcolG%' mulrowG%)multiplyG%%normG%*normalizeG%*nullspaceG%'orthogG%*permanentG %&pivotG%*potentialG%+randmatrixG%+randvectorG%%rankG%(ratformG%$rowG% 'rowdimG%)rowspaceG%(rowspanG%%rrefG%*scalarmulG%-singularvalsG%&smith G%,stackmatrixG%*submatrixG%*subvectorG%)sumbasisG%(swapcolG%(swaprowG %*sylvesterG%)toeplitzG%&traceG%*transposeG%,vandermondeG%*vecpotentG% (vectdimG%'vectorG%*wronskianG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "We displayed the commands that become available with this package." } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "xv:=vector([1,4,9]);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%#xvG-%'vectorG6#7%\"\"\"\"\"%\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "yv:=vector([1,8,27]);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%#yvG-%'vectorG6#7%\"\"\"\"\")\"#F" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "These are column vectors displayed as row s to save space. " }}{PARA 0 "" 0 "" {TEXT -1 144 "One can refer to ve ctor elements using an index in square brackets, which is analogous to list elements, but the op construct works differently:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 6 "xv[2];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"% " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "nops(xv);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "N ote that this is not the dimension of the vector! There is a special c ommand for that:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "vectdim(xv);" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "op(xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'vectorG6 #7%\"\"\"\"\"%\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "op(o p(xv));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$;\"\"\"\"\"$7%/F$F$/\"\"#\" \"%/F%\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "whattype(xv) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%'symbolG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 107 "If one had to access the elements via the op constr uct, it would be a real nuisance (as compared to lists)." }}{PARA 0 " " 0 "" {TEXT -1 47 "The inner product can be calculated as follows:" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "dotprod(xv,xv);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#\"#)*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "We can \+ write a small loop to calculate this:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "dp:=0:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "for i from 1 to 3 do :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "dp:=dp+xv[i]*xv[i]; od:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "dp;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#)*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "dot prod(xv,yv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"$w#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "Edit the above loop and verify the calcul ation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 228 "Note that we have referred to the elements of the vector in the s ame way as list elements were addressed. In fact, we could write our o wn set of procedures, and always work with lists. We turn the do-loop \+ above into a procedure." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 111 "We pass two arguments (the vectors to be multiplied ) and check with an if-then-fi construct whether they match." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }{TEXT -1 0 "" }{MPLTEXT 1 0 40 "dprod:=proc(arg1,arg2) local i,n1,n2,dp;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "n1:=vectdim(arg1):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "n2:=vectdim(arg2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "if n1 <> \+ n2 then RETURN(`Mismatch of sizes in dprod procedure`); fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "dp:=0:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for i from 1 to n1 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "dp:=d p+arg1[i]*arg2[i]: od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "dp;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "dprod(xv,xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#) *" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "Note how a procedure returns the last executed statement." }}{PARA 0 "" 0 "" {TEXT -1 114 "It also has its error checking (which could be improved to check the type of \+ arguments passed into the procedure)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "dprod(xv,[1,1,1]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#9" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "evalm(xv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'VECTORG6#7%\"\"\"\"\"%\"\"*" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 102 "This worked even though [1,1,1] is a list and not a vector. vectdim must be working properly on lists:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "vectdim([1,2,3,4]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "dpr od(xv,[1,2,3,4]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%EMismatch~of~siz es~in~dprod~procedureG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "d otprod(xv,[1,2,3,4]);" }}{PARA 8 "" 1 "" {TEXT -1 44 "Error, (in dotpr od) arguments not compatible" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "M aple's dotprod procedure works also with lists:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "dotprod([1,2,3],[1,2,3]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#9" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "We now def ine a matrix:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "A:=matrix([[1,2,3] ,[4,5,6],[7,8,9]]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'matrix G6#7%7%\"\"\"\"\"#\"\"$7%\"\"%\"\"&\"\"'7%\"\"(\"\")\"\"*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "We can check some properties:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "trace(A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #\"#:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "We obtained the sum of t he diagonal elements. Next we calculate the determinant:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "det(A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\" \"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "Obviously the rows/columns are not independent of each other. Thus, no inverse exists." }}{PARA 0 "" 0 "" {TEXT -1 28 "We try a small modification." }}{PARA 0 "" 0 " " {TEXT -1 135 "Observe how elements of a matrix are addressed, and ho w vectors and matrices are not displayed by default, but evalm has to \+ be invoked." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "B:=A;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"BG%\"AG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "B[3,3]:=10;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"BG6$\"\"$F '\"#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "B;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"AG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"AG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalm(B);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'m atrixG6#7%7%\"\"\"\"\"#\"\"$7%\"\"%\"\"&\"\"'7%\"\"(\"\")\"#5" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "det(B);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "A; e valm(A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"AG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'matrixG6#7%7%\"\"\"\"\"#\"\"$7%\"\"%\"\"&\"\"'7%\"\" (\"\")\"#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalm(A-B);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "B;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"AG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"AG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Something apparently absurd happened:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "We assigned " }{TEXT 326 1 "B" }{TEXT -1 27 " t o pick up the content of " }{TEXT 327 1 "A" }{TEXT -1 33 ". Then we ch anged one element in " }{TEXT 328 1 "B" }{TEXT -1 32 ". That should no t have affected " }{TEXT 329 1 "A" }{TEXT -1 23 ", but obviously it di d." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "Binv:=inverse(B);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%BinvG-%'matrixG6#7%7%#!\"#\"\"$#!\"%F,\" \"\"7%F*#\"#6F,F+7%F/F+F/" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "Note that since the inverse exists, the system of equations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 325 1 "B" }{TEXT -1 1 " " } {TEXT 324 1 "x" }{TEXT -1 3 " = " }{TEXT 323 1 "b" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 "has a unique solution. It can be obtained as follows: we pick some right-hand-side " }{TEXT 322 1 "b" }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "bv:=vec tor([1,3,5]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#bvG-%'vectorG6#7% \"\"\"\"\"$\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "xsol:=e valm(Binv &* bv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%xsolG-%'vector G6#7%#\"\"\"\"\"$F)\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Obser ve that the " }{TEXT 19 2 "&*" }{TEXT -1 27 " operator works inside th e " }{TEXT 19 5 "evalm" }{TEXT -1 6 " call." }}{PARA 0 "" 0 "" {TEXT -1 84 "We verify the solution (a mathematician accepts a solution only after verification):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "evalm(B &* xsol - bv);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'vectorG6#7%\"\"!F'F '" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 28 "Thus we have found a vector \+ " }{TEXT 19 4 "xsol" }{TEXT -1 11 " such that " }{TEXT 19 12 "B&*xsol \+ = bv" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 116 "Of course, in pr actice one would not perform a matrix inverse to solve a single system of equations, as it requires " }{TEXT 298 1 "n" }{TEXT -1 48 " times \+ more operations to find an inverse of an " }{TEXT 297 1 "n" }{TEXT -1 4 "-by-" }{TEXT 296 1 "n" }{TEXT -1 40 " matrix than to solve the line ar system." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 194 "We demonstrate now that a homogeneous system of linear equatio ns has interesting solutions if the coefficient matrix is singular (ot herwise the solution is unique, and only the trivial solution " } {TEXT 321 1 "x" }{TEXT -1 23 " = [0,0,0] is allowed)." }}{PARA 0 "" 0 "" {TEXT -1 23 "We redefine our matrix " }{TEXT 320 1 "A" }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "A:=matrix([[1,2,3],[4,5,6],[7 ,8,9]]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'matrixG6#7%7%\"\" \"\"\"#\"\"$7%\"\"%\"\"&\"\"'7%\"\"(\"\")\"\"*" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 23 "zerov:=vector([0,0,0]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&zerovG-%'vectorG6#7%\"\"!F)F)" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 25 "xsol:=vector([x1,x2,x3]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%xsolG-%'vectorG6#7%%#x1G%#x2G%#x3G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "evalm(A&*xsol-zerov);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#-%'vectorG6#7%,(%#x1G\"\"\"%#x2G\"\"#%#x3G\"\"$,(F(\" \"%F*\"\"&F,\"\"',(F(\"\"(F*\"\")F,\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "solve(%,xsol);" }}{PARA 8 "" 1 "" {TEXT -1 35 "Error, (in solve) invalid arguments" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 " This error message means that the solve procedure does not accept vect ors as arguments." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "eqs:=evalm(A&* xsol-zerov);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$eqsG-%'vectorG6#7%, (%#x1G\"\"\"%#x2G\"\"#%#x3G\"\"$,(F*\"\"%F,\"\"&F.\"\"',(F*\"\"(F,\"\" )F.\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "whattype(eqs); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%'symbolG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "eqs[1];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(%#x1 G\"\"\"%#x2G\"\"#%#x3G\"\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sol:=solve(eqs,xsol);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$solG6 \"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "This didn't work. " }{TEXT 19 5 "solve" }{TEXT -1 104 " does not work on lists. We need to conver t them to sets (it escapes me why one should need to do this):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "convert(eqs,set);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<%,(%#x1G\"\"\"%#x2G\"\"#%#x3G\"\"$,(F%\"\"(F'\"\")F )\"\"*,(F%\"\"%F'\"\"&F)\"\"'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "sol:=solve(convert(eqs,set),convert(xsol,set));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$solG<%/%#x2G,$%#x3G!\"#/%#x1GF)/F)F)" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "Note that x3 is a parameter (pick ing a number makes the solution unique), while x1 and x2 are determine d from it." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 203 "We now proceed with the linear algebra eigenvalue problem. In \+ classical mechanics it is needed in the calculation of the principal a xes of a rigid body (diagonalization of the moments-of-inertia tensor) ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 16 "Give n a square (" }{TEXT 300 1 "n" }{TEXT -1 4 "-by-" }{TEXT 299 1 "n" } {TEXT -1 9 ") matrix " }{TEXT 305 1 "A" }{TEXT -1 41 " we are seeking \+ a solution of the problem" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT 308 1 "A" }{TEXT -1 1 " " }{TEXT 307 1 "x" }{TEXT -1 10 " = lambda " }{TEXT 306 1 "x" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 6 "where " }{TEXT 309 1 "x" }{TEXT -1 5 " are " } {TEXT 301 1 "n" }{TEXT -1 72 "-by-1 column vectors, and lambda is a sc alar that can be complex-valued." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 33 "One can prove that if the matrix " } {TEXT 310 1 "A" }{TEXT -1 81 " is real and symmetric, the eigenvalues \+ lambda are real-valued. There are always " }{TEXT 302 1 "n" }{TEXT -1 80 " of them, although the same answer can appear with a multiplicity \+ higher than 1." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 93 "The proof that a solution to the problem can be found is \+ by construction. Consider the matrix" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 313 1 "B" }{TEXT -1 3 " = " }{TEXT 312 1 "A" } {TEXT -1 10 " - lambda " }{TEXT 311 1 "I" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "where lambda is an unknown scalar, and " }{TEXT 314 1 "I" }{TEXT -1 25 " the unit matrix of size " } {TEXT 304 1 "n" }{TEXT -1 4 "-by-" }{TEXT 303 1 "n" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 84 "The above problem then is a homogeneous s ystem of equations with coefficient matrix " }{TEXT 315 1 "B" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 90 "A homogeneous system has non-t rivial solutions only if its coefficient matrix is singular." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 63 "Thus, we can fi nd solutions to the eigenvalue problem when det(" }{TEXT 316 1 "B" } {TEXT -1 105 ")=0. This becomes a condition on lambda, which can then \+ be found in a straightforward way as shown below." }}{PARA 0 "" 0 "" {TEXT -1 21 "The solution vectors " }{TEXT 317 1 "x" }{TEXT -1 126 " t o be found separately for each eigenvalue lambda(i) are determined fro m the solution of the homogeneous system of equations " }{TEXT 319 1 " B" }{TEXT -1 1 " " }{TEXT 318 1 "x" }{TEXT -1 86 " = 0. They will not \+ be unique in the sense that the length of the vector is arbitrary." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 58 "The geome tric interpretation of the problem is as follows:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "For an arbitrary vector \+ " }{TEXT 333 1 "x" }{TEXT -1 28 " we have the property that " }{TEXT 334 1 "y" }{TEXT -1 3 " = " }{TEXT 335 1 "A" }{TEXT -1 1 " " }{TEXT 336 1 "x" }{TEXT -1 38 " points in a direction different from " } {TEXT 337 1 "x" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 19 "For a given matrix " }{TEXT 339 1 "A" } {TEXT -1 47 " we are looking for solution vectors such that " }{TEXT 340 1 "A" }{TEXT -1 42 " does not rotate them. The only effect of " } {TEXT 338 1 "A" }{TEXT -1 86 " on these vectors is a stretch operation . The amount of stretching is given by lambda." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 117 "We first define a matrix that is real and symmetric. We can simply add the transpose of a non- symmetric matrix to it:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "Am:=eval m(transpose(A)+A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#AmG-%'matrixG 6#7%7%\"\"#\"\"'\"#57%F+F,\"#97%F,F.\"#=" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "I3:=array(identity,1..3,1..3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#I3G-%&arrayG6&%)identityG;\"\"\"\"\"$F)7\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "evalm(I3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'matrixG6#7%7%\"\"\"\"\"!F)7%F)F(F)7%F)F)F(" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Bm:=evalm(Am-lambda*I3);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#BmG-%'matrixG6#7%7%,&\"\"#\"\"\"%'l ambdaG!\"\"\"\"'\"#57%F/,&F0F,F-F.\"#97%F0F3,&\"#=F,F-F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "cpoly:=det(Bm);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%&cpolyG,(%'lambdaG\"#'**$)F&\"\"#\"\"\"\"#I*$)F&\" \"$F+!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "The characteristic \+ polynomial is of order " }{TEXT 332 1 "n" }{TEXT -1 80 ", i.e., in our case of order 3. The fundamental theorem of algebra asserts that " } {TEXT 330 1 "n" }{TEXT -1 79 " roots can be found over the field of co mplex numbers to a polynomial of order " }{TEXT 331 1 "n" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "solve(cpoly,lambda);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"!,&\"#:\"\"\"*$-%%sqrtG6#\"$@$F&F& ,&F%F&F'!\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"!$\"+(GZ;H$!\")$!*(GZ;HF&" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "The eigenvalues are real, as we co nstructed " }{TEXT 19 2 "Am" }{TEXT -1 84 " to be symmetric. The fact \+ that 0 is an eigenvalue implies that the original matrix " }{TEXT 19 2 "Am" }{TEXT -1 13 " is singular:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "det(Am);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "The solution of roots of polynomials with highe r " }{TEXT 342 1 "n" }{TEXT -1 56 " is difficult (impossible in closed form in general for " }{TEXT 341 1 "n" }{TEXT -1 50 ">5) and one has \+ to resort to numerical techniques." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 8 "For low " }{TEXT 343 1 "n" }{TEXT -1 70 " \+ they can be found as explained above by using the following routines: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "charpoly(Am,mu);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#,(*$)%#muG\"\"$\"\"\"F(*$)F&\"\"#F(!#IF&!#'*" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvals(Am);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"!,&\"#:\"\"\"*$-%%sqrtG6#\"$@$F&F&,&F%F&F'! \"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "To find the eigenvectors \+ requires more work, but for small " }{TEXT 344 1 "n" }{TEXT -1 47 " th e following works (if the roots are simple):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "eigenvects(Am);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%7% \"\"!\"\"\"<#-%'vectorG6#7%F%!\"#F%7%,&\"#:F%*$-%%sqrtG6#\"$@$F%F%F%<# -F(6#7%,&#!#5\"#F%F/#FDF@F%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 110 "The structure of the answer is: eigenvalue, multiplicity, set of \+ eigenvectors (even if the multiplicity is 1);" }}{PARA 0 "" 0 "" {TEXT -1 40 "The answer for lambda=0 is easy to read." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 96 "To obtain numerically \+ calculated eigenvalues (and eigenvectors) consult the following help p age:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "?Eigenvals" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "6" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }