{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 "" -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 "Helvetica" 0 1 128 0 0 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 262 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 267 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 1 14 0 0 0 0 0 2 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 273 "" 0 14 128 0 128 1 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 128 0 128 1 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 1 12 0 0 1 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 }{PSTYLE "Norm al" -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 "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 16 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 262 1 {CSTYLE "" -1 -1 "Times " 1 16 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 263 1 {CSTYLE "" -1 -1 "Times" 1 16 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 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 257 13 "MLC Lab Visit" }}{PARA 0 "" 0 "" {TEXT 256 31 "Mth 351 October 18 2002 Maple 6" }}{PARA 0 "" 0 "" {TEXT 258 16 "Bent E. Petersen" }}{PARA 0 "" 0 "" {TEXT 259 32 "F ilename: 351f2002_lab_visit.mws" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 260 "" 0 "" {TEXT 272 12 "Introduction" }{TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 386 "Maple is a CAS, that is, a Computer Alge bra System. It performs mathematical operations symbolically, but a la rge number of robust numerical routines are also built in. Maple can b e used interactively as a rather fancy calculator, but it can also be \+ used as a flexible programming language. Our emphasis in this introduc tion is on interactive use. Even so we barely scratch the surface." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 13 "The Work sheet" }}{PARA 257 "" 0 "" {TEXT -1 470 "When you are using Maple in a window environment it is possible to move around on the worksheet by \+ left-clicking the mouse. As a result, commands may end up being execut ed 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 on the Edit menu). This works best if old expre ssions are cleaned up first, so it is a good idea to start each worksh eet with the command " }{TEXT 263 8 "restart;" }{TEXT -1 40 " You do n ot 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 261 "" 0 "" {TEXT 273 115 "Maple commands are executed by pressing the Enter key when the mouse cursor is in th e line containing the commands." }}{PARA 263 "" 0 "" {TEXT -1 0 "" }} {PARA 262 "" 0 "" {TEXT 278 74 "Note that Maple skips over the interpo lated text comments (like this one)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 468 "Note each Maple command must be termin ated by a colon or a semicolon (except help commands preceded by a que stion mark). You can spread the command over several lines by postponi ng the terminating colon or semicolon. You simply move to a new line b y pressing Enter. Maple will chatter at you when you move to a new lin e in this manner if the previous command is unterminated. Ignore it, b ut keep in mind a command will not be executed before it is properly t erminated." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 338 "You can also stack up several commands on one line by terminat ing them individually with colons or semicolons. The effect of the col on is to suppress output from the corresponding command, though the co mmand is still carried out. All the commands on a line are executed wh en you press the Enter key (with the cursor 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 command 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 s tep." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 249 " Maple has two ditto operators, % and %%. The value of % is the previ ously evaluated expression, the value of %% is the one before that. \+ Since the Worksheet commands may be executed in any order, the ditto o perators can cause a lot of confusion. " }{TEXT 274 86 "It is probably best to restrict them to the same line as the expressions they refer \+ to" }{TEXT 275 1 "." }{TEXT -1 74 " Here is a silly example, which als o demonstrates 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 "You can also unassign variables. Right now a is 5. That would \+ cause problems if we want to use a as a dummy variable of integratio n!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "a:='a';" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 127 "Note the single quotes. Basically you un assign a variable by assigning it its name. There are other ways to un assign variables." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 330 "One important function you need to know at the st art is evalf(). This function evaluates to floating point, that is, i t returns the floating point value, at the current precision, of its a rgument. If you have generated a fraction with many digits in the nume rator and in the denominator, you will find evalf() very useful indeed ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "a:=(D@@20)(x->1/(1+x^2))(12);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 128 "Don't worry about t he command right now. Can you interpret the fraction? You may be happi er with a floating point approximation:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(a);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 98 "The preci sion used by evalf() may be specified, in decimal digits, as an option al second variable." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(a,6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "Note that the answer was \+ rounded but the value of a is not affected." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "evalf(a,50) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 30 "Let's unassign a to be tidy." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "a:='a';" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 171 "If the precision \+ is not specified Maple uses the value of the builtin constant Digits. The default value of Digits is 10. You can set it by just assigning \+ a value to it;" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 7 "Digits;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 32 "Maple has some builtin constants" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Pi; evalf(Pi); I; I^2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 214 "Note the upper case lettersfor Pi and \+ I. If you enter pi you will just get the Greek letter pi, not the real number pi. Not all builtin constants require initial capitals. For ex ample the Euler-Mascheroni constant " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "gamma; evalf(%,20);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 194 "C onstants such as Pi are exact values in Maple, not approximations. W henever Maple does a calculation exact values are returned if possible , and if you have not requested an approximate value." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "For example." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "c os(Pi/3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 168 "If you have a burning desire to compute Pi to numerous decimal values it is possible to do so with evalf() because Maple reg ards Pi as a symbolic (and exact) value." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(Pi,360);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 " Note the use of the line continuation character \\ in Maple's response ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 151 "It \+ is possible to convert floating point numbers to rational numbers. In \+ this process Maple uses the precision set by Digits. Here's an amusing example" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "Digits:=4: convert(evalf(Pi),`rational`);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 55 "You can e asily 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),rational);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 292 "Note this time I omit ted the backticks on the word \"rational.\" Most of the time you do no t need them, but if you have a variable called \"rational\" you need t he backticks to ensure that you pass a literal string to Maple's conve rt() function, rather than the value of your variable \"rational.\"" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 37 "Let's se t Digits back to its default." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Digits:=10:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 139 "Let's lo ok a bit at symbolic manipulations now. Maple distinguishes between fu nctions and expressions. Here's one way to define a function:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "f:=x->sin(3*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 16 "g:=sin(3*x+x^2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 261 "Both of the examples above 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 pla ce marker. In g however, it is part of the expression, and one can r efer to it." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 159 "To evaluate a function we use the usual function convention. T o 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 "No te the subs() command above does not assign a value to x." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 310 "An expression can also be evaluated by using the eval() command, but do check help to m ake sure you don't have any surprises in more complicated situations. \+ The commands eval() and subs() work in quite different ways. In the si mple case that we illustrated here eval() is actually the preferred co mmand to use." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "eval(g,x=1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "Note the eval() command above d oes 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() command" }}{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 162 "You can \+ think of unapply() as turning the indicated variable(s) into dummy var iables or place markers. Here's an example where we turn x and y i nto variables:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 32 "expr:=(2*x*y+z*x)/(x^2+y^2+z^2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "h:=unapply(expr,x,y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "h(2,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "If we just want to replac e x by 2 and y by 3 in expr it is simpler to use subs()" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "subs(x=2,y=3, expr);" }}}{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 d erivatives 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 derivati ves are no problem" }}{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 get out hand. Fortunately there is an alternative! Here are the f ourth derivatives 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 "Partial 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 i nert function returns unevaluated. That may seem strange, but sometime s one can save time by postponing evaluation, or one can prevent Maple from attempting a calculation that will fail at present, but can be c aried out later in special cases or different contexts. Unevaluated ex pressions may be evaluated by using the command value(), thought 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 f ollowing:" }}{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 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 290 "As a fin al general example let's bring back some fond memories from calculus - the problem of integration. Here's an example to get you started: Onc e again I use postponed evaluation to get a nicely typeset equation. Y ou don't need to do such trickery, of course, but it's nice to know ho w." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "Int(1/(1+x^4),x): % = value(%);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "You can obtain the same effect by writing" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "Int(1/(1+x^4),x) = int(1/(1+x^4),x) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 157 "if you don't mind writing the integrand twice. If you are just in terested in evaluating the integral then you can dispense with all the typesetting niceties:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "int(1/(1+x^4),x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 72 "I bet you wish \+ you had a tool like this when you were studying calculus!" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 46 "Naturally definite integrals are possible too." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "Int(2*x^2*log(x)^3+x^3*log(x ),x=1..2): %=value(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 139 "If you want a floating point number you \+ can simply use evalf(), but there is a subtle and important difference depending on how you do it. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "a:=int(2*x^2*log(x)^3+x^3*lo g(x),x=1..2): evalf(a,16);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "evalf(Int(2*x^2*log(x)^3+x^3*log(x),x=1..2),16);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 299 "In the first c ase we assign the symbolic expression for the integral to a and then evaluate that expression. In the second example, Maple detects that w e want a numeric result and evaluates the integral numerically without first trying to obtain a symbolic solution. This is important. For ex ample" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "int(arctan(x)/log(x),x=Pi/8..Pi/4); evalf(%);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "evalf(Int(arctan(x)/log(x),x =Pi/8..Pi/4));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 500 "Here, in the first case, Maple decided after a whil e (possibly a long while) that it can not return a symbolic value for \+ the integral and so returned it unevaluated. Then evalf() called a num eric quadrature rule to get an answer. In the second case however, Map le wasted no time trying to find a nonexistent symbolic solution, but \+ instead used a numeric quadrature method. This is an important use of \+ inert functions. You can grow noticably older waiting for a symbolic s olution to a complex problem." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 137 "There are refinements. For example, you \+ can specify what quadrature method to use. Enter the command ?int[nume ric] for more information." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 279 18 "R oots of Equations" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "Maple can solve some equations exactly" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "soln01:=s olve(x^3-2*x+5=0,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 160 "If you don't need the exact answer, or would j ust like to see it in a more convenient form you can convert it to flo ating point. Note all 3 roots are converted." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(soln01);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 " Let's try another one" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "s oln02:=solve(x^5-x+1=0,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 190 "Maple can not find an exact solution her e so it returns a RootOf expression or place holder. This expression c an be manipulated in various ways. For example, we can get floating po int values" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "soln02est:=evalf(soln02);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 76 "You can pick out indiv idual roots from this list by using the ops() command:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "soln02 est[1]; soln02est[2];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 68 "Maple also has a command fsolve() which returns approximate roots." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "fsolve(x^5-x+1=0,x);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 71 "No te only real roots are returned unless we specify the complex option. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "fsolve(x^5-x+1=0,x,complex);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "Heres an equation with infinitely many roots:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "eqn03:=tan(x)-3*x=0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 168 "Note how I assigned a name to the equation so I do not have to type it several times. Let's suppose I am looking for a root bigger than 10, but the smallest such root." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "fsolve(eqn03,x,x=10..infinity);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 213 "N ote here how one can pass a hint to fsolve() and that infinity is \+ recognized by Maple. The double dots are a Maple idiom. The expression a..b means the interval with left endpoint a and right endpoint \+ b." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 "Thi s root looks suspiciously large. Let's check with a graph." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "plo t(lhs(eqn03),x=10..21, y=-100..20);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 106 "Note here lhs(eqn03) means t he left hand side of equation eqn03. This is a useful function, as is \+ rhs()." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 195 "Note in the plot command I specified a range for y as well as f or x. I did this because the expression lhs(eqn03) has infinities. \+ If we don't restrict the y range we get a very poor graph." }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 90 "Cl early there seems to be a root near 11 - certainly under 12. Let's use this information:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "fsolve(eqn03,x,x=10..12);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 258 "" 0 "" {TEXT -1 10 "Some Plots" } {TEXT 268 0 "" }{TEXT 269 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 124 "Functions and expressions can be plotted . There are numerous plot variations. 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=\"Plottin g a function\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "plot(g, x=0..1,numpoints=200,title=\"Plotting an expression\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 88 "We can co nvert a function into an expression simply by evaluating it, so one ca n 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 92 "I supressed the output, s ince you probably don't want to see a third copy of the same graph." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 117 "You can also plot anonymous functions, or expressions, that is, plot them wit hout 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 265 29 "Taylor Series and Polynomials" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "We have studied Taylor polynomi als in class. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 35 "expr:=taylor(exp(2*sin(x)),x=0,10);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 181 "N ote taylor() works on expressions, not functions. The second argument \+ specifies the center. The third argument specifies the order of the te rms omitted. Parameters may be included:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "a:=evaln(a);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "expr:=taylor(exp(a*sin(x)),x =0,5);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 236 "Note I unevaluated a first, just in case we left it ass igned to some number above. If I had not unevaluated it then Maple wou ld have substituted the value of a in this expression. Of course, it i s not always necessary to be so careful." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 132 "The data type returned by taylor( ) is a series, not a polynomial. If you want a polynomial to play with you need to do a conversion:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "taylor(tan(x),x=0,10): p:=co nvert(%,polynom);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 55 "You can specify a different center, even a symboli c one" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "taylor(exp(x),x=c,4): pc:=convert(%,polynom);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 264 25 "I nterpolation Polynomials" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 74 "Maple provides a builtin command for computing int erpolation polynomials. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "q1:=interp([1,3,4,2],[2,1,3,1],x); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 193 "The first parameter we pass to interp() is the list of (distinct) abscissas, the second is the list of ordinates and the third is a nam e, the name for the variable to be used in the polynomial." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 110 "If you want a po lynomial function rather than a polynomial expression in some variable , you can use unapply():" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "q2:=unapply(interp([1,3,4,2],[2,1,3 ,1],x),x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "Let's check that it worked:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "q2(1); q2(3); q2(4); q2(2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 163 "If you have a list of points you want to interpolate you can extract the abscissas and ordinates by using the op() command (it lists the operands in its argument):" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "L:=[ [1,2], [2,-1], [3, -2], [-1,1], [-2,7], [8,6], [7,5] ];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "We start by declaring two empt y lists, XX and YY, and then push the abscissas on XX and the ordinate s on YY:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "XX:=[]: YY:=[]: for pnt in L do XX:=[op(XX),pnt[1]]; \+ YY:=[op(YY),pnt[2]]; od:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 59 "Before we use XX and YY let's check that they look alright" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "XX; YY;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "p3:=interp(XX,YY,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "plot(p3,x=1..7,title=\"p3\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 186 "A convenient way to construct an interpolation polynomial for a function is to use the ma p() command to evaluate the function at each abscissa. Let's consider \+ the sine function on [0,4]:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "XX:=[0,1/2,1,3/2,2,5/2,3,7/2 ,4];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "YY:=evalf(map(sin,X X));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 126 "Here we used evalf() to force (approximate) evaluation of the \+ sine. Otherwise we will get an (painfully) exact answer. Try it." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "ps:=interp(XX,YY,t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "plot([ps,sin(t)],t=0..6.5,title=\"Interpolation (red) of sin(t)(bl ue)\",color=[red,blue]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 79 "Note the previous example shows one way o f plotting two functions on one graph." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 266 20 "Interpolating Spline" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 267 "Maple computes splines of all degrees - check the help. Here we will look only at linear and (natural) cubic splines. A linear spline is just a piecewise linear function. The parameters are much the same as for interp(), but the abscissas must be in increasin g order." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "XX:=[1,2,5/2,3,13/4,15/4,5];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "YY:=[1,1,2,1,-1,-1,3];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "sp1:=spline(XX,YY,x,linear);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "sp3:=spline(XX,YY,x,cubic);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "plot([sp1,sp3],x=1..5,color=[red,b lue],thickness=2,numpoints=200,title=\"piecewise linear (red) and cubi c spline (blue) interpolation\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 230 "You can see how the cubic spline \+ smoothens out the graph without introducing too much oscillation. If w e compare the piecewise linear spline and the interpolation polynomial we see unreasonable oscillation unsupported by the data:" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "pp:= interp(XX,YY,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 132 "plot([ sp1,pp],x=1..5,color=[red,blue],thickness=2,numpoints=200,title=\"piec ewise linear (red) and polynomial interpolation (blue)\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 203 "Note the vertical scales are different in the two graphs. We can plot all thre e function in one graph for a more convincing demonstartion of how wel l the cubic spline follows the piecewise interpolation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 161 "plot( [sp1,sp3,pp],x=1..5,-3..9,color=[red,blue,black],thickness=2,numpoints =200,title=\"red=piecewise linear, blue=cubic spline, black=interpolat ion polynomial\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 174 "Note how I restricted the vertical range to -3. .9 so we would be able to see the details (otherwise the piecewise lin ear and the cubic spline just about merge on the graph)." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 267 30 "Trapezoi dal and Simpson's Rule" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 229 "Maple has numerous high-power quadrature methods bu ilt in, but if one simply wants to experiment with the trapezoidal rul e or Simpson's rule, these are available in the student package, acces sed through the command with(student)." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 179 "It is also fairly easy to roll your \+ own, even to write high order Newton-Cotes methods, if you wish. There are some example on my web page. For now, let's use the student packa ge." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(student):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "trapezoid(f(x),x=a..b,6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "simpson(f(x),x=a..b,6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 48 "Let's try an actual funct ion, say exp(x)*cos(x)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "trapezoid(exp(x)*cos(x),x=0..3,12): test:=evalf(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "simpson (exp(x)*cos(x),x=0..3,12): sest:=evalf(%);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 36 "int(exp(x)*cos(x),x=0..3); evalf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 57 "As we exp ected, Simpson's rule performs much better here." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 277 10 "M ore Plots" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 151 "Maple has a number of builtin plot commands. Additional commands \+ are made available by loading the plots package (by means of the with( plots) command)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 103 "Here is a well know plot. Note that you can use the mous e to resize or even to rotate the plot. Try it!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "plot3d(sin( sqrt(x^2+y^2))/sqrt(x^2+y^2),x=-7..7,y=-7..7);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 202 "We can also do parametric plots. We will use parame ters t and p, so lets make sure first they have not been assigned \+ to some other expressions (otherwise we will get incomprehensibe 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*sin(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 comamnds are available. \+ Check ?plots. A nice plot to experiment with is the 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 "tubep lot([t,t^2,t*sin(t)],t=-1..12,radius=6*(1+cos(t/4)));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "tubeplot([8*cos(t),8*sin(t),2*t],t= 0..18,radius=4,scaling=constrained);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 81 "The option scaling=constrained forces Maple to use the same scale on each axis." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 270 15 "Closing Remarks " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 112 "We h ave barely scratched the surface. There are many other things Maple ca n do. Try exploring the help facility!" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "ifactor(111111111111111 111);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "isprime(333667);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "isprime(333613);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "limit((exp(x)-1-x)/x^2,x=0); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "sum(k^4,k=1..n);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "sum(k^(-2),k=1..infinity);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "fsolve(tan(x)=3*x,x,avoid =\{x=0\},0..1.4);" }}}{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 11 "Experiment!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{MARK "0 0 0" 13 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }