Introduction To Maple 6: Worksheet Toolbar
Introduction To Maple 6: Worksheet Toolbar
Worksheet Toolbar
The toolbar is the area of the Maple window that contains buttons for performing
common tasks. You can toggle between having the toolbar visible and having it hidden.
From the View menu choose Toolbar. A check mark next to Toolbar in the
menu indicates that the toolbar is displayed.
Maple worksheets are files that document how to solve mathematical problems from the
fields of mathematics, science, and engineering. Worksheets are both interactive and reusable.
They can be used to replace calculators, spreadsheet application programs, and programs in
languages such as FORTRAN. Specifically, in worksheets you can:
• perform computations
• manipulate mathematical expressions
• describe the problem-solving process
When you use Maple to perform computations or manipulate expressions, Maple displays
the corresponding results, which you can use for subsequent processing. The request you send
Maple is called Maple input, it is displayed in red Courier typeface by default. You can change
the default by modifying the Maple Input text style. The result is called Maple output, it is
displayed centered in blue Times typeface by default. You can change the default by modifying
the Maple Output text style. Together, Maple input and output comprises an execution group,
which is the fundamental element of the worksheet.
Overview of Insert Menu
The Insert menu contains commands to insert text and Maple objects into an active
Maple worksheet.
Text
Insert text into your Maple worksheet. Text can include comments which help explain
your steps more effectively.
1. From the Insert menu, choose Text.
2. Type the text you want in the worksheet.
Standard Math
Standard Math notation is displayed in a format similar in appearance to that found
in a textbook. It is not necessarily executable.
1. From the Insert menu, choose Standard Math. A question mark appears at
the insertion point and the edit field is displayed.
2. Type the expression, using the edit field for editing, if necessary.
3. Press the Enter key. The output will be displayed in nonexecutable Standard Math
notation.
Maple Input
Maple input is executable Maple notation, usually a mathematical expression, that
Maple can evaluate.
1. From the Insert menu, choose Maple Input. The command prompt appears.
2. Type in the expression, followed by a semicolon to display the output, or by a colon to
suppress the output.
Plot
Create a blank plot object after the cursor.
Use the Symbol Palette - to add symbols and Greek letters to expressions.
The symbol palette contains buttons for inserting mathematical symbols into your
expressions.
1. Display the symbol palette. (See Show Palettes.)
2. Click where you want to insert the symbol.
3. On the symbol palette, click the symbol you want to enter. For example, to enter an alpha,
click on .
Title Your Worksheet
1. Place your cursor at the top of the worksheet.
2. From the Insert menu, choose Paragraph, and then Before.
3. Type the title.
4. In the list of styles on the far left of the context bar, click Title.
To change the way the text appears, see Overview: Maple Text Styles.
Use Maple to solve a wide range of mathematical problems. Enter, compute, and
manipulate mathematical expressions by using the powerful Maple mathematical engine. During
the problem-solving process, Maple can take the result of one calculation and use it as input for a
second calculation. In this way, Maple can solve complicated mathematical problems.
• diff (Diff)
• int (Int)
• limit (Limit)
• normal (Normal)
• product (Product)
• sum (Sum)
Maple displays inert forms in two colors in the worksheet. It maintains the default color
for variables and elements of the expression you can change, and it displays items you cannot
change in black.
> int(x^2,x);
1 3
x
3
> Int(x^2,x);
⌠ 2
x d x
⌡
A new worksheet opens with a Maple prompt in the upper left-hand corner. Enter Maple
commands at this prompt so that Maple recognizes your entry as Maple input and executes the
command. (See Overview of Palettes for information on using palettes to enter expressions
without having to remember all the syntax of Maple commands.)
The following assumes the Input Display is set to Maple Notation. See Set Input Display for
more information.
1. Type the Maple input, followed by either a semicolon or a colon. The semicolon indicates
that the input executes and the corresponding Maple output is displayed, as seen below.
> factor(x^2 + 2*x + 1);
( x + 1 )2
The colon indicates that the input executes, but the corresponding output is suppressed, as
seen below.
> assume(z > 0):
2. Press the Enter key. Maple evaluates the input and displays the output, provided that the
input ends with a semicolon.
> f(3);
6
> cos(alpha)^2+sin(alpha)^2;
cos( α ) 2 + sin( α ) 2
> a*x^2+b*x=c;
a x2 + b x = c
> a*Int(exp(sqrt(2)*x),x);
⌠ ( 2 x)
a e dx
⌡
> Limit(f(x),x=infinity);
lim f( x )
x→ ∞
Composition Function
The Composition function, @ @, takes two arguments. The first argument must be a
function, such as sin or cos, or a variable name that can be treated as a function. The second
argument specifies the number of times the function should be composed. Because the @ symbol
RootOf
Maple uses the function RootOf to represent the roots of a polynomial in one variable. It is a
compact representation because all roots can be expressed at once. In addition, it enables Maple
to manipulate the roots of a polynomial even when it is unable to find explicit representations for
them. The polynomial is always expressed in terms of the variable _Z.
Solve for the Roots explicitly.
1. Select the expression.
2. From the Context menu, choose All Values You could also use the allvalues function.
Examples:
> RootOf(x^2+1=0);
RootOf( _Z 2 + 1 )
> evalf(%);
-1.414213562
> evalf(%);
-.6299605249 − 1.091123636 I
> evalf(r1);
.5000000000 + .8660254038 I
> allvalues(r1);
1 1
+ I 3
2 2
> evalf(r2);
RootOf( _Z 4 + _Z 2 + 1, label = 1 )
> allvalues(r2);
1 1 1 1 1 1 1 1
− + I 3, − − I 3, + I 3, − I 3
2 2 2 2 2 2 2 2
Getting Started
Executing Commands
To execute commands in the New User's Tour (and any other) worksheets:
1. Place the cursor on the first command line (for example, 1+1; below) by using your
mouse or the Tab key.
2. Press Enter.
Please note:
• If you happen to place the cursor elsewhere in a worksheet, place it back on the appropriate
command line before pressing Enter to continue.
• It is important to execute the commands in order because some computations require results
from previous command lines.
Execution Groups
Execution groups are the fundamental computation elements in the worksheet. Their primary
purpose is to combine one or more Maple commands and their results into a single re-executable
unit. You can easily recognize an execution group by a square bracket immediately to the left of
the command prompt.
When you place the cursor on any command line in an execution group and press Enter,
all commands in that group are executed in sequence and the results (or output) are displayed at
the end of the execution group. The cursor is automatically advanced to the first command line in
the next execution group.
In addition to Maple commands and their results, an execution group can contain descriptive
paragraphs.
DIAGRAM
Typing Commands
You can execute commands by typing them at a Maple prompt, and pressing Enter. You
can display commands as Maple notation or as standard math notation.
Try this out now. Copy the equation: Select it, and from the Edit menu, choose Copy.
Create a new worksheet: From the File menu, choose New. (Switch between the worksheet and
this one by using the Window menu.) Paste the equation at the command prompt: From the Edit
menu, choose Paste. Type a semicolon at the end of the command line, and press Enter. Right-
click (or option-click) on the result to see the context-sensitive menu. (Left-click elsewhere to
close the menu without choosing an item.)
You can also use the context-sensitive menus to plot expressions. Go back to your new
worksheet, and right-click on the result again. From the context-sensitive menu, choose Plots,
then Implicit 3-D Plot, then x,y,z as the desired permutation for the axes. You should arrive at
the three-dimensional smart plot displayed below.
> smartplot3d[x,y,z](z = sin(x^2*y));
DIAGRAM
Formulae may also be dragged from the worksheet into a cell of a spreadsheet, or from a
cell of a spreadsheet to a worksheet.
Paragraphs are used for explanatory notes such as this. They are presented in black Times
or Times New Roman font by default. The following sentences illustrate the types of formatting
that you can easily apply to Maple paragraphs:
(Please note that you cannot change text in this worksheet, because it's set to "read only.")
As in word processors and desktop publishers, you can create your own paragraph and
character styles for text. To do so, from the Format menu, choose Styles.
Numerical Calculations
Computations with Integers
At its most basic level, you can use Maple as a very powerful calculator.
13
To calculate (32)( 12 ), you would enter the following:
> 32*12^13;
3423782572130304
Maple recognizes many special operators, including factorial, greatest common divisor, least
common multiple, and computation over the integers modulo m. The following line is an
example of the factorial operator in use.
> 200!;
7886578673647905035523632139321850622951359776871732632947425332443594\
499634033429203042840119846239041772121389196388302576427902426371\
050619266249528299311134628572707633172373969889439224456214516642\
402540332918641312274282948532775242424075739032403212574055795686\
602260319041703240623517008587961789222227896237038973747200000000\
00000000000000000000000000000000000000000
You can easily include the previous expansion of 200! in any subsequent calculation
without having to type it. The ditto operator, represented by a percent sign (%), refers to the last
expression computed by Maple. (For more information on the ditto operator, see the help page
for ditto.) The command ifactor factors the previous result into its prime factors.
> ifactor(%);
( 2 ) 197 ( 3 ) 97 ( 5 ) 49 ( 7 ) 32 ( 11 ) 19 ( 13 )16 ( 17 ) 11 ( 19 ) 10 ( 23 )8 ( 29 ) 6 ( 31 )6 ( 37 ) 5
( 41 ) 4 ( 43 ) 4 ( 47 ) 4 ( 53 ) 3 ( 59 ) 3 ( 61 ) 3 ( 67 ) 2 ( 71 ) 2 ( 73 ) 2 ( 79 ) 2 ( 83 ) 2 ( 89 ) 2
( 97 ) 2 ( 101 ) ( 103 ) ( 107 ) ( 109 ) ( 113 ) ( 127 ) ( 131 ) ( 137 ) ( 139 ) ( 149 ) ( 151 )
( 157 ) ( 163 ) ( 167 ) ( 173 ) ( 179 ) ( 181 ) ( 191 ) ( 193 ) ( 197 ) ( 199 )
The next command calculates the product again, which is precisely the value of 200!.
> expand(%);
Floating-point Arithmetic
A principal strength of Maple is its ability to do exact arithmetic. Fractions and radicals
during computation are not converted to their decimal equivalent, thereby avoiding round-off
2 30 3
Consider the expression , which is entered on the Maple command line as follows:
3 20
> (2^30/3^20)*sqrt(3);
1073741824
3
3486784401
Use the evalf command to generate an approximation in the form of a floating-point value.
> evalf(%);
.5333783739
Algebraic Computations
Working with Expressions
Maple provides different ways of manipulating and displaying expressions to make them
easier to verify, or more effective to use. This flexibility allows you to do such things as expand
binomials, factor results, simplify trigonometric expressions, assign variable names to results,
and convert expressions to different forms.
Simplifying Expressions
Maple can apply identities to simplify many lengthy mathematical expressions, such as
trigonometric expressions.
Consider cos( x ) + sin( x ) + 2 cos( x ) − 2 sin( x ) − cos( 2 x ) .
5 4 2 2
Solving an Equation
a x2 13 x2 13 a x 10 x 5 a
Use Maple to solve the following equation: x −
3
+ = + − .
2 3 6 3 3
Now solve the system for the variables a , b , c , and d. Maple will return its solutions in terms
of the fifth variable, e. Since there are four equations and five unknowns, we will have a
parametric set of solutions. On the other hand, if we solved for a, b, c, d and e, Maple would
choose one of the variables (at random) as a free parameter.
> solve( {eqn1, eqn2, eqn3, eqn4}, {a, b, c, d} );
313 22 483 31 79 4
{b = − + e, c = − e, d = − − e, a = 2 }
13 13 13 13 13 13
To verify that this solution satisfies eqn1 and eqn2, evaluate both of them at this solution.
> eval( {eqn1, eqn2} , % );
{ 20 = 20, 41 = 41 }
Solving Inequalities
The following examples show how easy it is to solve systems of inequalities in Maple.
1
Use Maple to solve systems of inequalities, such as x2 < 1, y2 ≤ 1, x + y < .
2