CS 121 Lab 1: A Tutorial Introduction to MapleDr. Jeremy Johnson & Dr. Frederick W. ChapmanWe encourage you to work on all the CS 121 labs in groups of two or three students. Although you may work together, you should each submit your own copy of the lab to Blackboard Vista at the end of class. Type your name and the name(s) of your partner(s) in the spaces provided below.Your Name: Partner #1: Partner #2:

Lab 1 has 10 tutorials, 3 required problems (which will reinforce essential Maple skills), and 1 optional problem (which will deepen your understanding of Maple). You will need to complete all 10 tutorials and all 3 required problems to prepare for Quiz 1. If you finish all of the tutorials and required problems before the end of class, you may work on the optional problem or explore other Maple topics which interest you.Click on the triangles in the left margin to open each of the worksheet sections below and begin the lab.
<Text-field style="Heading 1" layout="Heading 1">Introduction</Text-field>The purpose of Lab 1 is to introduce some of the functionality of Maple using simple mathematical computations (such as those seen in high school mathematics), two- and three-dimensional plotting, and simple programming constructs (such as assignment). We will begin by focusing on the specific commands and features which you will need later for Lab 2 (an opportunity to apply your new-found Maple knowledge).There are two kinds of sections in the rest of the lab. The tutorial sections provide basic information on a particular topic, and the corresponding problem sections provide you with an opportunity to apply what you have just learned.
<Text-field style="Heading 1" layout="Heading 1">Tutorial 1: Using the Maple Worksheet Interface</Text-field>Maple provides a worksheet interface which combines text, mathematics, computations, and graphics. Maple provides a large collection of commands for performing various mathematical computations. Computations can be performed with numbers (integers, fractions, square roots, etc.) and symbolic expressions (variables, mathematical symbols such as LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEnJiM5NjA7RicvJSdpdGFsaWNHUSZmYWxzZUYnLyUsbWF0aHZhcmlhbnRHUSdub3JtYWxGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRidGMg==, mathematical functions such as sin(x), etc.).
Maple commands are entered at a prompt (>) within an execution group, which consists of the Maple input (displayed in red) and the corresponding Maple output (displayed in blue). The input and output in an execution group are grouped together with a square bracket in the left margin. Example: Type the text 2 + 3*5; (including the semicolon) at the red Maple prompt below and press the Enter key to see an example of an execution group.Note that all Maple commands must be terminated with a semicolon (;) or colon (:). If terminated with a semicolon, then, after the Enter key is pressed, the command is evaluated and the result is displayed. If terminated with a colon, the command is evaluated but the result is not displayed. Example: Position the cursor on the red Maple input below and press the Enter key to see an example of a calculation without output.(2 + 3)*5:The value of the previously executed command can be recalled with the percent (%) character and used in further computations. Try it by pressing Enter on the commands below:%;% - 1;%/3;Warning: The value of % refers to the last command executed -- regardless of where it occurs in the worksheet! Be careful to execute the commands of a worksheet in the order given when using %.Maple remembers the results of the last three calculations, which you can recall with percent (%), double percent (%%), and triple percent(%%%), respectively. See for yourself:1;2;3;%; # last result1;2;3;%%; # second-last result1;2;3;%%%; # third-last resultMultiple commands can be put in one execution group provided they are separated by semicolons or colons. For example, the following two commands compute the sum 1+2+3+4:1 + 2: % + 3 + 4;You can use the pound (#) character to enter a comment after a Maple command. This is handy for explaining what the command does:1 + 2: % + 3 + 4; # compute 1+2+3+4Execution groups can be inserted into a worksheet before or after the cursor. Using the menu at the top of the screen, select Insert > Execution Group > After Cursor three times to insert three new Maple prompts after the one below:# Insert three executions groups AFTER this line.Many menu commands have shortcut keys. Look at the menu item Insert > Execution Group > After Cursor again and notice the shortcut key (Apple-J on a Macintosh, Ctrl-J on Windows). Now use the shortcut key to insert three new prompts after the one below:# Insert three executions groups AFTER this line.You can convert an empty Maple prompt into a text region with the menu item Insert > Text or the corresponding shortcut key (Apple-T on a Macintosh, Ctrl-T on Windows). Try it on the middle prompt below and then type in today's date:# Create the text region BELOW this line.# Create the text region ABOVE this line.
<Text-field style="Heading 1" layout="Heading 1">Problem 1: Practicing the Worksheet Interface</Text-field>
<Text-field style="Heading 2" layout="Heading 2">Part (a): Working with Previous Results</Text-field>Enter a single Maple command to compute the sum of 1, 3, 5, and 7, in that order, and display the output:Now enter a single Maple command to compute the sum of 7, 5, 3, and 1, in that order, but do not display the output:Finally, enter a Maple command which subtracts the previous result from the result before that:Question: What does the value of the difference prove about the values of your two sums? Type your answer in the space below.Answer:
<Text-field style="Heading 2" layout="Heading 2">Part (b): Inserting Execution Groups Before the Cursor</Text-field>Position the cursor on the Maple input below and use a menu command from the Insert menu three times to insert three new execution groups before the prompt:# Insert three executions groups BEFORE this line.Now position the cursor on the Maple input below and use a shortcut key three times to insert three new execution groups before the prompt:# Insert three executions groups BEFORE this line.
<Text-field style="Heading 2" layout="Heading 2">Part (c): Deleting Execution Groups</Text-field>Use a menu command from the Edit menu to delete all but one of the execution groups below:# Delete this execution group.# Delete this execution group.# Delete this execution group.# Do NOT delete this execution group.Now use a shortcut key to delete all but one of the execution groups below:# Delete this execution group.# Delete this execution group.# Delete this execution group.# Do NOT delete this execution group.
<Text-field style="Heading 1" layout="Heading 1">Tutorial 2: Working with Variables</Text-field>Maple can work with symbolic variables. For example, here is a polynomial in LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn:2*x + x^2 - x + 3*x*x + x^3/x;The result of a command can be assigned to a variable, which can be used in later commands. The Maple assignment operator is colon equals (:=) and should not be confused with ordinary equals (=).v := 2 + 3*5;Observe that once a variable is assigned a value, the corresponding value is used in expressions containing the variable (i.e., it can no longer be used as a symbol like we did with x above). 2*v;v + 1;In the following assignment, the variable v is assigned the value obtained from the expression v+1 using the current value of v. If v is used in another expression after the updated assignment, the new value is used.v := v + 1; # increment v2*v;We can clear the value of the variable v in order to use v as a symbol once again. Here's how:v := 'v';Now LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEidkYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn behaves as a symbol since it has no value assigned to it:v+1;
<Text-field style="Heading 1" layout="Heading 1">Problem 2: Assigned versus Unassigned Variables</Text-field>
<Text-field style="Heading 2" layout="Heading 2">Part (a): Storing Intermediate Results in Variables</Text-field>Compute the value of the expression LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkobWZlbmNlZEdGJDYkLUYjNictSSNtbkdGJDYkUSIyRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEiK0YnRjQvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRj0vJSlzdHJldGNoeUdGPS8lKnN5bW1ldHJpY0dGPS8lKGxhcmdlb3BHRj0vJS5tb3ZhYmxlbGltaXRzR0Y9LyUnYWNjZW50R0Y9LyUnbHNwYWNlR1EsMC4yMjIyMjIyZW1GJy8lJ3JzcGFjZUdGTC1GMTYkUSIzRidGNC8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRidGNEY0LUY4Ni1RJyZzZG90O0YnRjRGO0Y+RkBGQkZERkZGSC9GS1EmMC4wZW1GJy9GTkZZLUYsNiQtRiM2Jy1GMTYkUSI1RidGNEY3LUYxNiRRIjdGJ0Y0RlJGNEY0RlJGNA== and assign the result to the variable LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn:Now compute the value of the expression LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0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LyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn:Question: What does the value of the quotient prove about the values of your two original expressions? Type your answer in the space below.Answer:
<Text-field style="Heading 2" layout="Heading 2">Part (b): Clearing the Values of Variables</Text-field>Enter a Maple command for the expression LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUklbXN1cEdGJDYlLUkobWZlbmNlZEdGJDYkLUYjNiwtSSNtbkdGJDYkUSIzRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEnJnNkb3Q7RidGNy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQC8lKXN0cmV0Y2h5R0ZALyUqc3ltbWV0cmljR0ZALyUobGFyZ2VvcEdGQC8lLm1vdmFibGVsaW1pdHNHRkAvJSdhY2NlbnRHRkAvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZPLUY7Ni1RIn5GJ0Y3Rj5GQUZDRkVGR0ZJRktGTUZQLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnL0Y4USdpdGFsaWNGJy1GOzYtUSgmbWludXM7RidGN0Y+RkFGQ0ZFRkdGSUZLL0ZOUSwwLjIyMjIyMjJlbUYnL0ZRRlxvLUY0NiRRIjJGJ0Y3RjotRlY2JVEieUYnRllGZm4vJStiYWNrZ3JvdW5kR1EuWzI1NSwyNTUsMjU1XUYnRjdGNy1GIzYlLUY0NiRRIjVGJ0Y3RmRvRjcvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMEYnLUY7Ni1RIi5GJ0Y3Rj5GQUZDRkVGR0ZJRktGTUZQRmRvRjc=The result is a number since LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbW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nL0Y4USdpdGFsaWNGJy1GOzYtUSgmbWludXM7RidGN0Y+RkFGQ0ZFRkdGSUZLL0ZOUSwwLjIyMjIyMjJlbUYnL0ZRRlxvLUY0NiRRIjJGJ0Y3RjotRlY2JVEieUYnRllGZm4vJStiYWNrZ3JvdW5kR1EuWzI1NSwyNTUsMjU1XUYnRjdGNy1GIzYlLUY0NiRRIjVGJ0Y3RmRvRjcvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMEYnLUZWNiNRIUYnRmRvRjc= again. You can copy and paste (see the Edit menu) to save yourself some typing.The result is now a polynomial in LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn. Clear the value of the variable LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn:Enter your Maple command for the expression LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUklbXN1cEdGJDYlLUkobWZlbmNlZEdGJDYkLUYjNiwtSSNtbkdGJDYkUSIzRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEnJnNkb3Q7RidGNy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQC8lKXN0cmV0Y2h5R0ZALyUqc3ltbWV0cmljR0ZALyUobGFyZ2VvcEdGQC8lLm1vdmFibGVsaW1pdHNHRkAvJSdhY2NlbnRHRkAvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZPLUY7Ni1RIn5GJ0Y3Rj5GQUZDRkVGR0ZJRktGTUZQLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnL0Y4USdpdGFsaWNGJy1GOzYtUSgmbWludXM7RidGN0Y+RkFGQ0ZFRkdGSUZLL0ZOUSwwLjIyMjIyMjJlbUYnL0ZRRlxvLUY0NiRRIjJGJ0Y3RjotRlY2JVEieUYnRllGZm4vJStiYWNrZ3JvdW5kR1EuWzI1NSwyNTUsMjU1XUYnRjdGNy1GIzYlLUY0NiRRIjVGJ0Y3RmRvRjcvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMEYnLUZWNiNRIUYnRmRvRjc= one more time: The result should be a polynomial in both LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn and LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn.
<Text-field style="Heading 1" layout="Heading 1">Tutorial 3: Getting Help</Text-field>The most important thing to learn in this lab is how to get help. Maple provides an extensive array of resources to help you use Maple. There are resources for new users, for students, for quickly looking up syntax or how to accomplish basic tasks, detailed documentation with examples for all commands, and even materials reviewing different mathematical concepts. The various help resources can be accessed through the Help menu. You should familiarize yourself with these features:Help > Maple Help is the main help facility. Note that you can search either by command name (Topic) or by keywords (Text). The table of contents organizes all of the features of Maple.Help > Take a Tour of Maple provides an introduction, quick tour, and summaries of how to do many basic tasks.Help > Manuals, Dictionary, and more > Dictionary accesses the built in mathematics and engineering dictionary, which defines over 5000 mathematical terms and has over 300 figures.If you know the name of the Maple command, you can access the corresponding Maple help page directly from the Maple prompt using the question mark (?) prefix. Try it:?plot?solve
<Text-field style="Heading 1" layout="Heading 1">Problem 3: Looking Up Mathematical Functions</Text-field>
<Text-field style="Heading 2" layout="Heading 2">Part (a): Looking Up the Square Root Function</Text-field>Use the Help > Maple Help menu selection to search for square root in two different ways: first as a Topic, then as Text.Question 1: Which search method gives you the mathematical definition of square root?Answer 1: Question 2: What is Maple's name for the square root function? (Refer to the top ten results from one of your two searches.)Answer 2:
<Text-field style="Heading 2" layout="Heading 2">Part (b): Looking Up the Cosine Function</Text-field>Use the Help > Maple Help menu selection to search for cosine or cosine function first as a Topic and then as Text.Question 1: Which combination gives you the mathematical definition of cosine?Answer 1: Question 2: Which combination gives you Maple's name for the cosine function?Answer 2: Question 3: What is Maple's name for the cosine function?Answer 3:
<Text-field style="Heading 1" layout="Heading 1">Tutorial 4: Integers and Rational Numbers</Text-field>Recall the definition of the factorial function: LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2I1EhRictRiM2KUYrLUYjNiYtRiw2JVEibkYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21vR0YkNi1RIiFGJy9GOlEnbm9ybWFsRicvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRkQvJSlzdHJldGNoeUdGRC8lKnN5bW1ldHJpY0dGRC8lKGxhcmdlb3BHRkQvJS5tb3ZhYmxlbGltaXRzR0ZELyUnYWNjZW50R0ZELyUnbHNwYWNlR1EsMC4xMTExMTExZW1GJy8lJ3JzcGFjZUdGUy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRidGQC1GPTYtUSI9RidGQEZCRkVGR0ZJRktGTUZPL0ZSUSwwLjI3Nzc3NzhlbUYnL0ZVRmduLUYjNilGKy1JK211bmRlcm92ZXJHRiQ2Jy1GPTYvUSomUHJvZHVjdDtGJy8lK2ZvcmVncm91bmRHUS5bMTQ0LDE0NCwxNDRdRidGQC9JK21zZW1hbnRpY3NHRiRRJmluZXJ0RidGQkZFL0ZIRjhGSS9GTEY4L0ZORjhGTy9GUlEmMC4wZW1GJy9GVVEsMC4xNjY2NjY3ZW1GJy1GIzYnLUYsNiVRImlGJ0Y2RjlGWS1JI21uR0YkNiRRIjFGJ0ZARlZGQEYzLyUnYWNjZW50R0ZELyUsYWNjZW50dW5kZXJHRkRGKy1JJ21zcGFjZUdGJDYmLyUnaGVpZ2h0R1EmMC4wZXhGJy8lJndpZHRoR1EkNS4wRicvJSZkZXB0aEdGYHEvJSpsaW5lYnJlYWtHUSVhdXRvRidGYHBGVkZARitGVkZARitGVkZA Here's how to compute factorials in Maple:3! = 3*2*1;Maple can compute exactly with very large integers. The next command computes 100!100!;The resulting number can be factored using the command ifactor. ifactor(%);Note that 100! has 158 digits.length(100!);Maple can also perform exact arithmetic with fractions. 1 + 1/2 + 1/3;Fractions are always simplified by removing common factors in the numerator and denominator. 9/12;The functions ilcm and igcd compute the least common multiple and greatest common divisor of two or more integers.ilcm(6,4) = 6*4/igcd(6,4);Maple can also compute both definite and indefinite sums.Sum(i, i=1..10) = sum(i, i=1..10); # the .. denotes a rangeSum(i, i=1..n) = sum(i, i=1..n);factor(%);
<Text-field style="Heading 1" layout="Heading 1">Tutorial 5: Polynomials and Rational Functions</Text-field>Maple can also compute with polynomials, which are generally entered as expressions involving powers of some symbol. In these examples we use the symbol x, though any symbol can be used. Just like the integer examples, we can factor polynomials.factor(x^2-1);x^12-1;factor(%);We can also multiply the factors together.expand(%);We can evaluate the previous result for a particular value of the variable.eval(%, x=1);We can also compute the greatest common divisor of two polynomials.gcd(x^15-1, x^12-1);We can also divide polynomials to obtain a quotient and remainder. Note that these command require that the name of the variable be passed as an argument.rem(x^15-1, x^3-1, x);quo(x^15-1, x^3-1, x);Maple can also compute with rational functions (quotients of two polynomials). 1/(1-x) + 1/(1+x);We can obtain a common denominator.normal(%);We can also express a rational function in terms of partial fractions.convert(%, parfrac);
<Text-field style="Heading 1" layout="Heading 1">Tutorial 6: Symbolic and Numeric Computation</Text-field>Maple is aware of mathematical constants such as \317\200 and can compute symbolically with them.Pi;sin(Pi);The function evalf can be used to obtain numeric approximations, to any desired precision, of many mathematical expressions.evalf(Pi);evalf(Pi, 100);evalf(Pi, 1000);
<Text-field style="Heading 1" layout="Heading 1">Tutorial 7: Sequences, Lists, and Sets in Maple</Text-field>The command seq can be used to generate a Maple sequence of elements, where the i-th element of the sequences is given as a function of the index i. Elements in a sequence are separated by commas. seq(i, i=1..10);We can generate sequences using formulas.seq(3*i+1, i=1..10);An arbitrary sequence can be constructed by listing element separated by commas. S := 2, 7, 1;The i-th elements of a sequence S can be accessed with S[i]. Note that sequences are indexed starting at 1.S[1]; S[2]; S[3];A Maple list can either be empty, denoted by [], or it contains a sequence of elements [S]. Elements of a list are accessed in the same way as elements in a sequence. The number of elements in a list can be determined using the function nops. An empty list has zero elements.L := [];nops(L);L := [seq(i^2, i=1..3)];nops(L);We can use lists to represent points in a plane.p1 := [x1,y1];p1[1]; p1[2];We can create lists of lists; e.g., a list of points in the plane.p2 := [x2,y2];L := [p1,p2];L[1];L[1][1]; L[1][2];A Maple set is similar to a list except that the order is unspecified and any duplicate elements are removed. Sets are designated in Maple using curly brackets.L := [3,2,1,2,3]; # listS := {3,2,1,2,3}; # set
<Text-field style="Heading 1" layout="Heading 1">Tutorial 8: Plotting Functions and Points</Text-field>Simple two-dimensional plots can be obtained using the plot function. (Three-dimensional plots are also available with the plot3d command.)plot(sin(x), x=-Pi..Pi);Additional plotting functions are available in the plots package. Functions in the plots package can be used by specifying the function name and package name with the syntax package[name], e.g. plots[pointplot]. To avoid having to specify the package every time you want to call functions in the plots package, use the with(plots) command.with(plots);p1 := [1,2]; p2 := [2,3];pointplot([p1, p2]);The result of a plot command is a data structure which can be displayed by Maple as you have seen. Plots can be assigned to variables and used later. In particular, the display command, from the plots package, can be used to display a set of plots.plot1 := %;plot2 := plot(x+1, x=0..3);display({plot1,plot2});The plots package provides a function, implicitplot, to display curves in the plane. implicitplot will plot the points (x,y) in a given range such that the specified function, or set of functions, are equal to zero. The following commands plot the points on a circle, with center (0,0) and radius 1, and the line LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2I1EhRictRiM2Jy1GLDYlUSJ4RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUkjbW9HRiQ2LVEiPUYnL0Y4USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQi8lKXN0cmV0Y2h5R0ZCLyUqc3ltbWV0cmljR0ZCLyUobGFyZ2VvcEdGQi8lLm1vdmFibGVsaW1pdHNHRkIvJSdhY2NlbnRHRkIvJSdsc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLyUncnNwYWNlR0ZRLUYsNiVRInlGJ0Y0RjcvJStiYWNrZ3JvdW5kR1EuWzI1NSwyNTUsMjU1XUYnRj5GK0ZXRj4= in the range LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2I1EhRictRiM2KC1GLDYlUSJ4RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUkjbW9HRiQ2LVEiPUYnL0Y4USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXR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GK0Zcb0Y+RitGXG9GPg==.implicitplot(x^2+y^2=1, x=-2..2, y=-2..2);implicitplot(x=y, x=-2..2, y=-2..2);plot1 := implicitplot(x^2+y^2=1, x=-2..2, y=-2..2):plot2 := implicitplot(x=y, x=-2..2, y=-2..2):display({plot1,plot2});
<Text-field style="Heading 1" layout="Heading 1">Tutorial 9: Solving Equations</Text-field>The function solve can be used to solve a large class of equations. The following simple examples show how to use solve to solve a linear equation with either symbolic or numeric coefficients. solve(a*x + b = 0, x);solve(3*x - 2 = 0, x);plot(3*x - 2, x=-2..2);pointplot([[2/3, 0]], symbolsize=20);p1 := plot(3*x - 2, x=-2..2):p2 := pointplot([[2/3, 0]], symbolsize=20):display({p1,p2});This example shows how to use solve to find the common solutions of two equations, namely for a circle and line. The common solutions are the points where the line intersects the circle.solve({x^2+y^2=2, x=y}, {x,y});plots[implicitplot]({x^2+y^2=2, x=y},x=-2..2, y=-2..2);
<Text-field style="Heading 1" layout="Heading 1">Tutorial 10: Watch Out!</Text-field>Maple can be frustrating at times, especially when you are first starting to use it. Since you may encounter cryptic error messages, the response you get might not be what you expected, and you might not understand the result. Occasionally you will encounter problems which Maple can not solve. Here are some examples of common problems you may encounter.restart; # reset Maple to its start-up stateYou cannot increment a symbolic variable in Maple. The following command gives an error because the variable LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn does not have a numeric value assigned to it:x := x + 1;It may be that you really meant to enter an equation, not an assignment:x = x + 1;Note that an equation can be assigned to a variable:eq := x = x+1;Suppose we now assign a value to the variable LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn:x := 1;The value of LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn is automatically substituted into any expression using LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn:x^2-1;This will cause problems with commands which expect LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn to be a symbolic variable:plot(x^2-1, x=0..3);One solution is to clear LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEieEYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lK2JhY2tncm91bmRHUS5bMjU1LDI1NSwyNTVdRicvRjNRJ25vcm1hbEYn of its assigned value:x := 'x';When we solve polynomial equations, the answer may be presented in an abstract form which is hard to understand:solve({x^2+y^2=1, x=y}, {x,y});We can convert this abstract form into a more concrete form as follows:allvalues(%);Note that Maple does not necessarily provide all solutions of an equation:solve(sin(x)=cos(x));Some equations may lead to solutions involving complex numbers:solve(sin(x) = 2);evalf(%);Maple is case sensitive! Consequently, only one of the following represents the mathematical constant \317\200 as far as Maple is concerned:[pi, Pi, PI];evalf(%);Finally, note that some names are special to Maple cannot be used as variable names:for := 5; # "for" is a reserved word in MapleI := 3; # I = sqrt(-1) in Maple
<Text-field style="Heading 1" layout="Heading 1">Problem 4 (Optional): Maple Manuals in the Online Help</Text-field>
<Text-field style="Heading 2" layout="Heading 2">Part (a): Maple Getting Started Guide</Text-field>Use the Help > Manuals, Dictionary, and more > Manuals > Getting Started Guide menu selection to access the Maple Getting Started Guide, an electronic version of one of the printed Maple manuals. This guide provides a broad overview of Maple. Explore the guide to find answers to the following questions.Question 1: For what audience is the Maple Getting Started Guide intended?Answer 1: Question 2: The guide describes six different ways to use Maple to solve problems quickly by pointing and clicking the mouse instead of entering commands at a prompt. What are these six ways, and which section of the guide contains this information?Answer 2: Question 3: According to the guide, what are the names of the top five Maple commands?Answer 3:
<Text-field style="Heading 2" layout="Heading 2">Part (b): Maple User Manual</Text-field>Use the Help > Manuals, Dictionary, and more > Manuals > User Manual menu selection to access the Maple User Manual, an electronic version of another of the printed Maple manuals. This manual discusses Maple in much greater depth than the guide discussed in Part (a). Consult the manual to find answers to the following questions.Question 1: For what audience is the Maple User Manual intended?Answer 1: Question 2: You can build your own graphical user interface (GUI) for a Maple application by inserting "embedded components" into your Maple document. Which section of the manual explains how to do this?Answer 2: Question 3: When we write programs in the Maple programming language, there are two ways to control the flow of the program's execution: (1) by executing some Maple commands conditionally, and (2) by repeatedly executing a group of Maple commands. What are the names of the Maple programming constructs which perform (1) conditional execution and (2) repeated execution?Answer 3: