{VERSION 5 0 "SUN SPARC SOLARIS" "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 "Help Heading" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "Helvetica" 1 14 128 0 0 1 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 24 0 0 255 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "Helvetica" 0 1 128 0 0 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 261 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 14 255 0 0 1 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 255 0 0 1 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 14 0 0 1 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 14 255 0 0 1 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 267 "" 0 14 0 0 1 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 268 "" 0 14 255 0 0 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE " " -1 269 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 271 "Helvetica" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "helvetica" 1 14 255 0 255 1 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "helvetica" 0 1 0 0 0 0 0 0 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 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 3" 4 5 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }1 1 0 0 12 12 1 0 1 0 2 2 19 1 } {PSTYLE "Normal" -1 257 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 "Normal" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 2 1 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 259 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 260 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 }{PSTYLE "Normal" -1 261 1 {CSTYLE "" -1 -1 "Times" 1 10 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 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 257 39 "First Lab Visit - Intro duction to Maple" }}{PARA 0 "" 0 "" {TEXT 256 43 "Mth 355 (a.k.a. Mth \+ 399) Oct 2 2002 Maple 7" }}{PARA 0 "" 0 "" {TEXT 258 32 "orignal autho r: Bent E. Petersen" }{TEXT -1 2 ", " }{TEXT 271 39 "shredded and reas sembled by David Finch" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 4 "" 0 "" {TEXT -1 12 "Introduction" }{TEXT 26 0 "" }}{PARA 0 " " 0 "" {TEXT -1 386 "Maple is a CAS, that is, a Computer Algebra Syste m. It performs mathematical operations symbolically, but a large numbe r of robust numerical routines are also built in. Maple can be used in teractively as a rather fancy calculator, but it can also be used as a flexible programming language. Our emphasis in this introduction is o n interactive use. Even so we barely scratch the surface." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 504 "Scroll down to the res tart command below. Position the cursor on the line containg the resta rt command and press Enter. Maple will execute the restart command and then position the cursor on the next command, skipping over all the i ntervening text. Now press Enter to execute the next command, etc., or be brave and edit it first. Experiment! Some of the commands depend o n previous commands, etc. If you skip around and something doesn't wor k you may just have to execute a few of the previous commands." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 263 "This ent ire document was written in Maple. The sample commands were selected t o illustrate a few Maple features to get you started using Maple. To l earn more you should make heavy use of the online help. The help is ve ry good and usually includes a few examples. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 272 12 "Getting Help" }}{PARA 0 "" 0 "" {TEXT -1 912 "You will find the Help menu on the menubar. You \+ might want to try the New User's Tour later, if you haven't used Maple before. It will take you through a series of worksheets exposing a nu mber of differt Maple features. Once you know some of the commands and capabilities, you can use the Topic Search menu entry (on the Help Me nu) to find the correct usage, and some examples, for each of the comm ands in Maple. If you know the name of a command, but have forgotten s omething about the usage, you can type a question mark followed immedi ately by the command name from within the worksheet, rather than going through the menus of the help system. For example, if you needed to k now about the \"read\" command, which allows you to load an external f ile into your Maple session, you could type ?read at the command promp t. Unlike other Maple commands, this does not have to be terminated wi th a colon or a semicolon." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 259 13 "The Worksheet" }}{PARA 257 "" 0 "" {TEXT -1 645 "When you are using Maple in a window environment it is possible to mo ve around on the worksheet by clicking the mouse. (On the PC, this is \+ a left click. On the Mac, just a click. Right clicking on the PC bring s up a context dependent menu. Option-click on the Mac has the same ef fect.) As a result, commands may end up being executed in a nonlinear order. This can cause some confusion, since there is no visual clue. \+ One way to fix a mess is to have Maple re-execute the whole worksheet \+ (look for Execute on the Edit menu). This works best if old expression s are cleaned up first, so it is a good idea to start each worksheet w ith the command " }{TEXT 260 7 "restart" }{TEXT 270 1 ";" }{TEXT -1 40 " You do not need to do so of course ...." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 132 " Maple commands are executed by pressing the Enter key when the mouse c ursor (pointer, thumb) is in the line containing the commands." } {TEXT 264 76 " Note that Maple skips over the interpolated text commen ts (like this one). " }{TEXT 266 139 "To execute the commands on this \+ worksheet position the mouse cursor on the command line and press Ente r. Edit the command first if you wish" }{TEXT 268 1 "." }{TEXT 267 72 " Explore! Simply waiting for something to happen will not be producti ve." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 239 "N ote each Maple command must be terminated by a colon or a semicolon (e xcept help commands preceded by a question mark). The effect of the co lon is to suppress output from the corresponding command, though the c ommand is still carried out." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 347 "You can spread the command over several lines \+ by postponing the terminating colon or semicolon. You simply move to a new line by pressing Enter. Maple will chatter at you when you move t o a new line in this manner if the previous command is unterminated. I gnore it, but keep in mind a command will not be executed before it is properly terminated." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 220 "You can also stack up several commands on one line by terminating them individually with colons or semicolons. All the com mands on a line are executed when you press the Enter key (with the cu rsor anywhere on the line)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 222 "Here's a useful fact: You can open a new comma nd line below the current one by pressing Ctrl-J, or above the current line, by pressing Ctrl-K. This is pretty useful when you realize you \+ omitted something at a certain step." }}{PARA 5 "" 0 "" {TEXT -1 0 "" }{TEXT 273 0 "" }}{PARA 4 "" 0 "" {TEXT -1 22 "The Structure of Maple " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1675 "Map le has two parts. The first part manages the interface and handles bas ic commands. However, most of the power of Maple is embedded in the li brary, which is a collection of packages offering a number of commands in a particular area of mathematics, or to handle a particular type o f programming task. If these commands are to be called from the comman d line, you can use the long form of the name, which includes the pack age name and then the command name, as in plots[animate](???);, where the ??? indicate the arguments to the command, or you can load that s pecific command into your session by typing with(plots, animate);, or the whole plots package can be loaded into your session by typing wi th(plots); at which point all the commands in the plots package can be used without the \"plots\" prefix. There are two potential disadvant ages to the third way, but these don't really affect beginning users t oo much. First, loading a number of packages increases the amount of c omputer memory needed by Maple, and if you happen to be working on a m achine with limited memory or have a program which uses a lot of memor y, you may run short of this resource. (This is less of a problem than it used to be, since computer memory is now relatively inexpensive, a nd most machines have plenty.) The second problem is that there may be conflicts between names: that is, there may be an \"animate\" command in the plots package, and there may be an \"animate\" command in the \+ Frankenstein package (it is yours to write), and if you load both pack ages there is a conflict of names. In this circumstance, I think the \+ most recently loaded instance of the name is the one which prevails." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 30 "Assignm ent and Ditto Operators" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 187 "The assignment operator in maple is := (colon and e quals sign juxtaposed). The equals sign by itself does not perform ass ignment, but instead makes a statement which may be true or false." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 248 "Maple ha s two ditto operators, % and %%. The value of % is the previously ev aluated expression, the value of %% is the one before that. Since th e Worksheet commands may be executed in any order, the ditto operators can cause a lot of confusion." }{TEXT 269 1 " " }{TEXT 263 87 "It is \+ probably best to restrict them to the same line as the expressions the y refer to." }{TEXT -1 74 " Here is a silly example, which also demons trates the assignment operator." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "a:=5; b:=4; %%; %%; %;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 137 "Y ou can also unassign variables. Right now a is 5. That would cause \+ problems if we want to use a as a dummy variable of integration!" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "unassign('a','b'); a; b;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 63 "You can pass any number of variables \+ to the unassign() command." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 114 "A simpler way to unassign one variable is to ass ign it its name extracted by single quotes (this is a Maple idiom)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "a:=5; a:='a': a;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 279 "This is quite convenient, but sometimes \+ the single quotes are hard to find on the keyboard and even harder to \+ see on the monitor. Thus, even though it is more typing you may prefer to use the evaluate to a name function evaln() since it does not req uire the pesky single quotes." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "a:=5; b:=4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "unassign(evaln(a),evaln(b)); a; b; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 92 "Unfortunately, you can pass only one expression to evaln(), since \+ it returns only one name. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 175 "Some Maple statements may have equal signs in th em. It is important to remember that the the equals sign by itself (wi thout a preceeding colon) does not perform an assignment." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "3=4; 3:=4;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 222 "Here the error comes f rom trying to assign 4 to 3. The expression 3=4 causes no problem thou gh. It is simply an expression. The truth value of an expression may b e evaluated by using the evaluate Boolean, evalb(), function" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "e valb(3=4); evalb(3=3);" }}}{EXCHG {PARA 4 "" 0 "" {TEXT -1 0 "" }} {PARA 4 "" 0 "" {TEXT -1 9 "Constants" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 28 "Maple has built-in constants" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "Pi = evalf(Pi,60); I; I^2; gamma = evalf(gamma,40); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "Note the upper case letters. If you enter pi you will just get the Greek lette r pi, not the real number pi. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 357 "The evalf() function evaluates an expres sion to floating point. As you can see, the evalf() function takes a s econd parameter specifiying the precision in decimal digits. This para meter is optional. If it is not specified then the global constant Dig its is used (the default value is 10, but you can assign any positive \+ integer value (up to many thousands)." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(Pi); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(Pi,200);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 119 "Note the use of t he line continuation character \\ in Maple's response when the respons e will not fit on a single line.." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 4 "" 0 "" {TEXT -1 6 "Digits" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 238 "You set the Maple's floating point preci sion by assigning a value to Digits (the default is 10). Maple usually does exact calculations, but when floating point numbers are involved then Digits sets the precision. Here's an amusing example" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "Dig its:=4: convert(evalf(Pi),rational);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 172 "The conversion to a rational n umber makes use of Digits, rather than any precision specified in the \+ evalf() command. You can easily find other rational approximations to \+ pi" }{MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "Digits:=8: convert(evalf(Pi),ration al);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 103 "The label \"rational\" is protected in Maple 7. You can not as sign a value to it (which is just as well)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 37 "Let's set Digits back to its de fault." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Digits:=10:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 38 "Functions and Expressions. Derivatives " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 91 "Maple distinguishes between functions and expressions. Here's one way to de fine a function:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "f:=x->sin(Pi*x+x^2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 33 "We can also define an \+ expression:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "g:=sin(Pi*x+x^2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 261 "Both of the examples abo ve assume that x has not already been assigned a value. It needs to \+ be an unassigned variable. In the definition of f the x is a dummy variable, a place marker. In g however, it is part of the expressio n, and one can refer to it." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 159 "To evaluate a function we use the usual functi on convention. To evaluate an expression one generally uses the subs() command (though it has other subtle uses)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "f(1); subs(x=1,g) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "Note the subs() command above does not assign a value to x." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 310 "An expre ssion can also be evaluated by using the eval() command, but do check \+ help to make sure you don't have any surprises in more complicated sit uations. The commands eval() and subs() work in quite different ways. \+ In the simple case that we illustrated here eval() is actually the pre ferred command to use." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "eval(g,x=1);" }{TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "Can you see why \"eval\" is prefer red to \"subs\" here?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 60 "Note the eval() command above does not assign a value \+ to x. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "We can convert an expression into a function by using the unapply() c ommand" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "h:=unapply(g,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 226 "You can think of unapply() as tur ning the indicated variable(s) into dummy variables or place markers. \+ Thus f(x) is the the function f evaluated at x and unapply(f(x), x) ought to return the function f. Let's check that:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "ff:=unap ply(f(x),x); (ff-f)(w);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 12 "Sure enough!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 150 "If you have an inquisitive nature you probably wonder if Maple has an apply() command. It does but the \+ functional notation is usually more convenient." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "is(f(t) = a pply(f,t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 134 "Some Maple commands work on expressions, some work on \+ functions, and some on both. For example, here are the derivatives of \+ f and g." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 16 "D(f); diff(g,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 33 "Second derivatives are no probl em" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "D(D(f)); diff(g,x,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 124 "but this notation can ge t out hand. Fortunately there is an alternative! Here are the fourth d erivatives as an illustration:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "(D@@4)(f); diff(g,x$4);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 119 "P artial derivatives of expressions are also easily computed (here once \+ relative to y and three times relative to x):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "diff(x/(x^2 +y^2),x$3,y);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 414 "There is an inert version Diff() of diff(). An inert \+ function returns unevaluated. That may seem strange, but sometimes one can save time by postponing evaluation, or one can prevent Maple from attempting a calculation that will fail at present, but can be carrie d out later in special cases or different contexts. Unevaluated expres sions may be evaluated by using the command value(), though there are \+ other ways." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 135 "Inert functions, together with the ditto operator can be used \+ to get nicely typeset expressions. See if you can sort out the followi ng:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "Diff(x/(x^2+y^2),x$3,y): %=value(%);" }}}{EXCHG {PARA 4 "" 0 "" {TEXT -1 16 "Basic Data Types" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 344 "Maple has many data type s. This gives it a lot of flexibility, but is frustrating for new user s. The basic types that we will use in discrete math are sets, which \+ are unordered collections and lists, which are ordered collections, a nd then graphs and other objects which we will build later. At the mom ent, let us just look at sets and lists." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "?set" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "?lis t" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 247 "You see that they are discussed on the same help page. You create a set by listing a number of objects, separated by commas, inside the curly brackets \{\}, whereas a list is obtained by putting the comma \+ separated objects inside square brackets []." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "S1:=\{2,3,8,5,13,8,5\};" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 179 "Notice that the duplicates were deleted and that Mapl e has returned them in a different order than you entered them. If we \+ take the same sequence of entries inside square brackets" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "L:=[2,3,8,5,13,8,5];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 165 "we get a list. Here repetitions are perm itted, because they appear in different positions. You can extract a s pecific entry from the list by specifying its position." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "L[2];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "And you can extract a range (a sublist) with the range no tation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "L[2..5];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "Sets permit the set operations of union, intersection, and set difference, with the infix (between the objects) operators of union, intersect , and minus." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "S2:=\{2,5,6 ,12\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "S1 union S2;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "S1 intersect S2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "S1 minus S2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 237 "We want to work with the Cartesian products of sets as well. How might we do this? Well, we want ordered pairs of element s, and these can be represented by two-element lists. Thus we could bu ild a set whose entries are two-element lists." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 25 "S3:=\{'salt','gum','wax'\};" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 259 "This is a set of strings (words) which we can \+ distinguish from the elements of our set S2 for example. One way to en ter the product set S2 X S3 might be to type in each ordered pair. Thi s will take a while, since there are 4x3=12 ordered pairs in the produ ct." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "SP:=\{[2,'salt'],[5, 'salt'],[6,'salt'],[12,'salt']\}:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 218 "together with 8 more entries. (Replace the colon by semicolon to \+ see the output.) It would be nice to automate this process, and this w e do with our first example of a Maple procedure. It uses a \"do loop \" construction." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "SP:=\{\} :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "for x in S2 do;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "for y in S3 do;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 23 "SP := SP union \{[x,y]\};" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "SP;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 202 "In fact we had to nest two do loops. We will see next time how to further automate this process. The rest of the worksheet is devoted t o showing a few features of Maple which you can peruse on your own." } }{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 0 "" }}}{EXCHG {PARA 4 "" 0 "" {TEXT -1 8 "Plotting " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 124 "Func tions and expressions can be plotted. There are numerous plot variatio ns. Check the help facility, ?plot, for details." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "f:=x->sin(1 /x); g:=sin(1/x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot(f ,0..1,numpoints=200,title=\"Plotting a function\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "plot(g,x=0..1,numpoints=200,title=\"Plott ing an expression\"):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 75 "Replace the colon above by semicolons and press Enter to generate the plot." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 88 "We can convert a function into an express ion simply by evaluating it, so one can also do" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " plot(f(x), x=0..1):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 76 "Replace the colon above by a semicolon and press Enter to generate the plot." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 117 "You can also plot anonymous functions, or expressions, that is, plot them without first assigning them to a variable:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "plot(x->x+sin(x),0..4*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "plot(x+sin(x),x=0..4*Pi):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "Replace the colon above b y semicolons and press Enter to generate the plot." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 171 "Maple has many plot type s. Some 3D plots are demonstrated below, but if you need something els e, you will have to explore Maple help to see if you can find what you want.." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 10 "More Plots" }{TEXT 265 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 152 "Map le has a number of built-in plot commands. Additional commands are mad e available by loading the plots package (by means of the with(plots) \+ command)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 26 "Here is a well-known plot." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "plot3d(sin(sqrt(x^2+y^2))/sq rt(x^2+y^2),x=-7..7,y=-7..7);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 202 "We can also do parametric plots. We \+ will use parameters t and p, so lets make sure first they have not been assigned to some other expressions (otherwise we will get incomp rehensibe error messages)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "t:=evaln(t): p:=evaln(p):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "plot3d([4*cos(t)*sin(p),4*si n(t)*sin(p),4*cos(p)],t=-Pi..Pi/2,p=0..Pi/2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 101 "Many other plot comam nds are available. Check ?plots. A nice plot to experiment with is th e tubeplot" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "tubeplot([t,t^2,t*sin(t)],t=-1..22,radius=6*(2+cos(t/4)));" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 95 "N ote you can drag the plot around with the mouse to see the surface fro m different view points." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "tubeplot([4*cos(t),4*sin(t),4*t],t= 0..18,radius=1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 " " 0 "" {TEXT -1 17 "Sums and Products" }{TEXT 261 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 57 "Maple can compute quit e a few standard sums and products:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "expr:=k^2,k=1..n: Sum(expr )=sum(expr); expand(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " Sum(k^3,k=1..n): %=value(%); expand(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "Sum(k^4,k=1..n) = sum(k^4,k=1..n); expand(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 248 "T hese three examples illustrate different ways of achieving the same ty pographical effect. Note that sum() computes a sum, whereas Sum() simp ly returns unevaluated. The first example also shows that you can assi gn any kind of expression to a label." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 25 "Here's an obvious product" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "pro duct(k/(k+1),k=1..n); simplify(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 13 "Number Theory" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 167 "Maple has a some simpl e number theory support built-in. Additional resources are available i n the (standard) numtheory library (loaded by with(numtheory) if nee ded)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 128 "We can compute greatest common divisors, gcd, and least common multip les, lcm, of polynomials, and so in particular of integers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "g cd(810,35);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "lcm(810,35); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 "We can test for primality" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "isprime(7531829);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "isprime(1337);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 22 "We can fa ctor integers" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "ifactor(1337);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "ifactor(1111111111111111111111111111111111111111);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 82 " We can compute Mersenne primes, that is primes of the form 2^n-1 (n mu st be prime)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(numtheory):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "for k from 1 to 11 do 'k'=k, mersenne(k); od;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 117 "I f you just want to list known Mersenne primes (Maple has a built-in li st) you can use a modified mersenne() command:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "for k from \+ 1 to 11 do mersenne([k]); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 105 "If you want to find the k's which gives rise to the Mersenne primes above, you could do the following: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "for k from 1 to 11 do 2^n-1 = mersenne([k]), 'n' = ro und(evalf(log[2](mersenne([k])+1))); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 33 "A bit of recursion and \" remember\"" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "We can define sequences and functions recursively" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "T := \+ n->" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "if n=1 then 3;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "elif n=2 then 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "else 2*T(n-2)+T(n-1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "and then compute any part of the sequence" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "L:=[]: for k from 11 to 15 do L:=[op(L),T(k)]: od: L;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 158 "Note here op(L) r eturns the operands in L, then we tack on T(k) and form a list by enc losing everything in square brackets, i.e., we push T(k) on the list. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 264 "This calculation is actually very inefficient. If we write it as a procedu re with the remember option, then Maple will remember results from pre vious incantations of the procedure (there are many since it calls its elf) and therefore run quicker (but use more RAM)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "TT:=proc(n) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "option remember;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 14 "if n=1 then 3;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "elif n=2 then 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "else 2* TT(n-2)+TT(n-1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 39 "Let's check the run-times (in seconds )." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "tm:=time(): T(25); time()-tm;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "tm:=time(): TT(25); time()-tm;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 249 "Your tim es will differ from mine, but you will see that TT is hundreds of ti mes faster than T. Keep the \"option remember\" in mind when doing re cursion. If you try to compute T(1000) you will grow very much older, \+ whereas TT(1000) is very quick." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "tm:=time(): TT(2000); time() -tm;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 196 "If you try to compute TT(n) for too large an n Maple will \+ return an error, \"Too many levels of recursion.\" It is not always a \+ good idea to define a function recursively, even when it is slick." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 6 "Limits" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 43 "Maple has a limited understanding of li mits" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "limit((exp(x)-1-x)/x^2,x=0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 100 "As above, we can use \+ the inert (unevaluated) form of limit(), i.e., Limit(), to do fancy ty pography." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 58 "Limit((exp(x)-1-x)/x^2,x=0) = limit((exp(x)-1-x)/x^ 2,x=0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 48 "Or with less typing (and less chance for errors)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "Limit((exp(x)-1-x)/x^2,x=0): % = value(%);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 "Here are some more limits" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "k:=evaln(k): Sum(k^(-4),k=1..infinity): %=value(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "sum(1/k^1.0002,k=1..infin ity);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "Int(exp(-x^4),x=0. .infinity): %=value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 4 "" 0 "" {TEXT -1 17 "Solving Equations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 161 "We can solve a few equat ions symbolically with solve(), and many more numerically with fsolve( ). Note we can specify the range in which to look for a solution. " } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "fsolve(tan(x)=3*x,x,avoid=\{x=0\},0..1.4);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 127 "We didn't actuall y need the avoid=\{x=0\} here, but it is one way to make sure the tri vial solution x=0, is not the one found." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "fsolve(tan(x)=3*x ,x,1.4..5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "solve(sin(x) =cos(x),x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "solve(x^4+1= 0,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 30 "We can also solve some systems" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "solve(\{x+2*y=3,3 *x-2*y=5\},\{x,y\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 96 "For serious work with linear equations use the \+ linear algebra packages, linalg or LinearAlgebra." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 135 "We have barely scratched the surface. There are many other things Maple can do. Try exploring \+ the help facility. Above all, experiment!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "81 2 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }