Maple User Manual

Copyright © Maplesoft, a division of Waterloo Maple Inc.
2024

Maple User Manual
Copyright
Maplesoft, Maple, MapleSim, Maplet, Maple T.A., MapleNet, Clickable Math, Drag-to-Solve, and MapleCloud are all trademarks of Waterloo
Maple Inc.
© Maplesoft, a division of Waterloo Maple Inc. 1996-2024. All rights reserved.
No part of this book may be reproduced, stored in a retrieval system, or transcribed, in any form or by any means — electronic, mechanical, photocopying, recording, or otherwise. Information in this document is subject to change without notice and does not represent a commitment on the partof the vendor. The software described in this document is furnished under a license agreement and may be used or copied only in accordance withthe agreement. It is against the law to copy the software on any medium except as specifically allowed in the agreement.
Adobe and Acrobat are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Java and all Java based marks are trademarks or registered trademarks of Oracle and/or its affiliates.
MATLAB is a registered trademark of The MathWorks, Inc.
Microsoft and Windows are registered trademarks of Microsoft Corporation.
NAG is a registered trademark of The Numerical Algorithms Group Ltd.
All other trademarks are the property of their respective owners.
This document was produced using Maple and DocBook.

Contents
Preface ........................................................................................................................................... xiii
1 Getting Started ................................................................................................................................. 1
1.1 In This Chapter .......................................................................................................................... 1
1.2 Introduction to Maple .................................................................................................................. 1
Working in Maple ....................................................................................................................... 1
Starting the Standard Document Interface ........................................................................................ 2
Entering 2-D Math ...................................................................................................................... 4
Toolbar Options .......................................................................................................................... 7
The Context Panel and Copy & Drag ............................................................................................ 10
Saving a Maple Document .......................................................................................................... 13
Saving a Maple Document as a Workbook ..................................................................................... 13
1.3 Entering Expressions ................................................................................................................. 14
Execution Groups ...................................................................................................................... 14
Math Mode vs. Text Mode .......................................................................................................... 14
Palettes ................................................................................................................................... 15
Symbol Names ......................................................................................................................... 21
Toolbar Icons ........................................................................................................................... 22
1.4 Point-and-Click Interaction ......................................................................................................... 24
Assistants ................................................................................................................................ 24
Tutors .................................................................................................................................... 25
Math Apps ............................................................................................................................... 27
The Context Panel ..................................................................................................................... 27
Task Templates ......................................................................................................................... 28
Exploration Assistant ................................................................................................................. 30
1.5 Commands .............................................................................................................................. 32
The Maple Library .................................................................................................................... 32
Entering Commands .................................................................................................................. 33
Document Blocks ...................................................................................................................... 36
1.6 The Maple Help System ............................................................................................................. 38
Accessing the Help System ......................................................................................................... 38
Using the Help Navigator ........................................................................................................... 39
Viewing Help Pages as Documents ............................................................................................... 40
Viewing Examples in 2-D Math ................................................................................................... 40
Copying Examples .................................................................................................................... 40
1.7 Available Resources .................................................................................................................. 41
Resources Available through the Maple Help System ....................................................................... 41
Quick Reference Card ................................................................................................................ 42
Website Resources ..................................................................................................................... 42
2 Document Mode .............................................................................................................................. 45
2.1 In This Chapter ......................................................................................................................... 45
2.2 Introduction ............................................................................................................................. 45
2.3 Entering Expressions ................................................................................................................. 46
Example 1 - Enter a Partial Derivative ........................................................................................... 46
Example 2 - Define a Mathematical Function ................................................................................. 48
2.4 Evaluating Expressions .............................................................................................................. 48
2.5 Editing Expressions and Updating Output ...................................................................................... 49
2.6 Performing Computations ........................................................................................................... 50
Computing with Palettes ............................................................................................................. 50
Computing with the Context Panel ............................................................................................... 50
Assistants and Tutors ................................................................................................................. 55
3 Worksheet Mode ............................................................................................................................. 57iii

iv • Contents

3.1 In This Chapter ......................................................................................................................... 57
3.2 Input Prompt ............................................................................................................................ 58
Suppressing Output ................................................................................................................... 58
1-D Math Input ......................................................................................................................... 58
Input Separators ........................................................................................................................ 59
3.3 Commands .............................................................................................................................. 59
The Maple Library .................................................................................................................... 60
Top-Level Commands ................................................................................................................ 60
Package Commands ................................................................................................................... 61
3.4 Palettes ................................................................................................................................... 63
3.5 The Context Panel ..................................................................................................................... 65
Example - Using the Context Panel ............................................................................................... 65
3.6 Assistants and Tutors ................................................................................................................. 66
Launching an Assistant or Tutor ................................................................................................... 66
3.7 Task Templates ......................................................................................................................... 66
3.8 Text Regions ............................................................................................................................ 67
3.9 Names .................................................................................................................................... 68
Assigning to Names ................................................................................................................... 68
Unassigning Names ................................................................................................................... 69
Valid Names ............................................................................................................................. 70
3.10 Equation Labels ...................................................................................................................... 70
Displaying Equation Labels ........................................................................................................ 71
Inserting Equation Labels ........................................................................................................... 71
Execution Groups with Multiple Outputs ....................................................................................... 73
Label Numbering Schemes ......................................................................................................... 73
Features of Equation Labels ........................................................................................................ 73
4 Basic Computations ......................................................................................................................... 75
4.1 In This Chapter ......................................................................................................................... 75
4.2 Symbolic and Numeric Computation ............................................................................................ 76
Exact Computations ................................................................................................................... 76
Floating-Point Computations ....................................................................................................... 77
Converting Exact Quantities to Floating-Point Values ....................................................................... 77
Sources of Error ........................................................................................................................ 78
4.3 Integer Operations ..................................................................................................................... 78
Non-Base 10 Numbers and Other Number Systems ......................................................................... 80
4.4 Solving Equations ..................................................................................................................... 82
Solving Equations and Inequations ............................................................................................... 82
Other Specialized Solvers ........................................................................................................... 89
4.5 Units, Scientific Constants, and Uncertainty ................................................................................... 95
Units ...................................................................................................................................... 95
Scientific Constants and Element Properties ................................................................................... 99
Uncertainty Propagation ........................................................................................................... 103
4.6 Restricting the Domain ............................................................................................................. 105
Real Number Domain ............................................................................................................... 105
Assumptions on Variables ......................................................................................................... 106
5 Mathematical Problem Solving ......................................................................................................... 111
5.1 In This Chapter ....................................................................................................................... 111
5.2 Algebra ................................................................................................................................. 111
Polynomial Algebra ................................................................................................................. 112
5.3 Linear Algebra ........................................................................................................................ 118
Creating Matrices and Vectors .................................................................................................... 118
Accessing Entries in Matrices and Vectors .................................................................................... 124
Linear Algebra Computations .................................................................................................... 126
Student LinearAlgebra Package .................................................................................................. 131

Contents • v

5.4 Calculus ................................................................................................................................ 131
Limits ................................................................................................................................... 131
Differentiation ........................................................................................................................ 133
Series .................................................................................................................................... 136
Integration ............................................................................................................................. 137
Calculus Packages ................................................................................................................... 139
Differential Equations .............................................................................................................. 140
5.5 Optimization .......................................................................................................................... 140
Point-and-Click Interface .......................................................................................................... 141
Large Optimization Problems .................................................................................................... 142
MPS(X) File Support .............................................................................................................. 143
Optimization Package Commands ............................................................................................... 143
5.6 Statistics ................................................................................................................................ 144
Probability Distributions and Random Variables ............................................................................ 144
Statistical Computations ........................................................................................................... 145
Plotting ................................................................................................................................. 146
Student Statistics Package ......................................................................................................... 148
Additional Information ............................................................................................................. 148
5.7 Teaching and Learning with Maple ............................................................................................. 148
Student Packages and Tutors ...................................................................................................... 150
Calculus Problem Solving Examples ........................................................................................... 154
5.8 Clickable MathTM ................................................................................................................... 160
Smart Popups ......................................................................................................................... 160
Drag-to-Solve ......................................................................................................................... 160
Examples ............................................................................................................................... 161
6 Plots and Animations ...................................................................................................................... 187
6.1 In This Chapter ....................................................................................................................... 187
6.2 Creating Plots ......................................................................................................................... 187
Interactive Plot Builder ............................................................................................................. 188
Context Panel ......................................................................................................................... 193
The plot and plot3d Commands .................................................................................................. 194
The plots Package .................................................................................................................... 202
Multiple Plots in the Same Plot Region ........................................................................................ 206
6.3 Customizing Plots ................................................................................................................... 209
Interactive Plot Builder Options ................................................................................................. 209
Context Panel Options .............................................................................................................. 210
The plot and plot3d Options ...................................................................................................... 213
6.4 Analyzing Plots ...................................................................................................................... 215
Point Probe, Rotate, Pan, and Zoom Tools .................................................................................... 215
6.5 Representing Data ................................................................................................................... 216
6.6 Creating Animations ................................................................................................................ 216
Interactive Plot Builder ............................................................................................................. 216
The plots[animate] Command .................................................................................................... 217
The plot3d(...,viewpoint) Option ................................................................................................. 219
6.7 Playing Animations ................................................................................................................. 221
Animation Context Bar ............................................................................................................. 221
6.8 Customizing Animations .......................................................................................................... 222
Interactive Plot Builder Animation Options .................................................................................. 222
Context Panel Options .............................................................................................................. 222
The animate Command Options ................................................................................................. 223
6.9 Exporting ............................................................................................................................... 224
7 Creating Mathematical Documents .................................................................................................... 227
7.1 In This Chapter ....................................................................................................................... 227
7.2 Document Formatting .............................................................................................................. 228

vi • Contents

Copy and Paste ....................................................................................................................... 228
Quick Character Formatting ...................................................................................................... 229
Quick Paragraph Formatting ...................................................................................................... 231
Character and Paragraph Styles .................................................................................................. 232
Sections ................................................................................................................................. 237
Headers and Footers ................................................................................................................. 239
Show or Hide Worksheet Content ............................................................................................... 239
Indentation and the Tab Key ...................................................................................................... 241
7.3 Commands in Documents ......................................................................................................... 241
Document Blocks .................................................................................................................... 241
Typesetting ............................................................................................................................. 243
Auto-Execute .......................................................................................................................... 243
7.4 Tables ................................................................................................................................... 245
Creating a Table ...................................................................................................................... 245
Cell Contents .......................................................................................................................... 245
Navigating Table Cells ............................................................................................................. 245
Modifying the Structural Layout of a Table ................................................................................... 246
Modifying the Physical Dimensions of a Table .............................................................................. 248
Modifying the Appearance of a Table .......................................................................................... 248
Printing Options ...................................................................................................................... 251
Execution Order Dependency .................................................................................................... 251
Editable Tables ....................................................................................................................... 252
Additional Examples ................................................................................................................ 252
7.5 Drawing Canvas ...................................................................................................................... 254
Insert a Drawing Canvas ........................................................................................................... 255
Drawing ................................................................................................................................ 255
Drawing Canvas Style .............................................................................................................. 256
Inserting Images ...................................................................................................................... 257
7.6 Hyperlinks ............................................................................................................................. 258
Inserting a Hyperlink in a Document ........................................................................................... 258
Bookmarks ............................................................................................................................. 261
7.7 Embedded Components ............................................................................................................ 263
Adding Graphical Interface Components ...................................................................................... 263
Task Template with Embedded Components ................................................................................. 264
7.8 Spell Checking ....................................................................................................................... 265
How to Use the Spellcheck Utility .............................................................................................. 266
Selecting a Suggestion .............................................................................................................. 266
User Dictionary ....................................................................................................................... 266
8 Maple Expressions ......................................................................................................................... 269
8.1 In This Chapter ....................................................................................................................... 269
8.2 Creating and Using Data Structures ............................................................................................ 269
Expression Sequences .............................................................................................................. 269
Sets ...................................................................................................................................... 270
Lists ...................................................................................................................................... 270
Arrays ................................................................................................................................... 271
Tables ................................................................................................................................... 273
Matrices and Vectors ................................................................................................................ 273
Functional Operators ................................................................................................................ 274
Strings ................................................................................................................................... 277
8.3 Working with Maple Expressions ............................................................................................... 278
Low-Level Operations .............................................................................................................. 278
Manipulating Expressions ......................................................................................................... 282
Evaluating Expressions ............................................................................................................. 285
9 Basic Programming ........................................................................................................................ 293

Contents • vii

9.1 In This Chapter ....................................................................................................................... 293
9.2 Flow Control .......................................................................................................................... 293
Conditional Execution (if Statement) ........................................................................................... 293
Repetition (for Statement) ......................................................................................................... 296
9.3 Iterative Commands ................................................................................................................. 301
Creating a Sequence ................................................................................................................. 301
Adding and Multiplying Expressions ........................................................................................... 301
Selecting Expression Operands .................................................................................................. 302
Mapping a Command over a Set or List ....................................................................................... 303
Mapping a Binary Command over Two Lists or Vectors .................................................................. 303
Additional Information ............................................................................................................. 303
9.4 Procedures ............................................................................................................................. 303
Defining and Running Simple Procedures .................................................................................... 304
Procedures with Inputs ............................................................................................................. 304
Procedure Return Values ........................................................................................................... 304
Displaying Procedure Definitions ............................................................................................... 305
Displaying Maple Library Procedure Definitions ........................................................................... 305
Modules ................................................................................................................................ 306
Objects .................................................................................................................................. 306
9.5 Programming in Documents ...................................................................................................... 306
Code Edit Region .................................................................................................................... 306
Startup Code ........................................................................................................................... 307
9.6 Additional Information ............................................................................................................. 308
10 Embedded Components and Maplets ................................................................................................ 309
10.1 In This Chapter ..................................................................................................................... 309
10.2 Using Embedded Components ................................................................................................. 309
Interacting .............................................................................................................................. 309
Printing and Exporting a Document with Embedded Components ..................................................... 312
10.3 Creating Embedded Components .............................................................................................. 312
Inserting Components .............................................................................................................. 312
Editing Component Properties: General Process ............................................................................ 313
Removing Graphical Interface Components .................................................................................. 313
Integrating Components into a Document ..................................................................................... 313
Example 2 - Creating Embedded Components ............................................................................... 315
10.4 Using Maplets ....................................................................................................................... 318
Maplet File ............................................................................................................................ 318
Maple Document ..................................................................................................................... 319
10.5 Authoring Maplets ................................................................................................................. 319
Simple Maplet ........................................................................................................................ 319
Maplet Builder ........................................................................................................................ 320
Maplets Package ..................................................................................................................... 323
Saving ................................................................................................................................... 324
11 Input, Output, and Interacting with Other Products ............................................................................. 325
11.1 In This Chapter ..................................................................................................................... 325
11.2 Writing to Files ..................................................................................................................... 325
Saving Data to a File ................................................................................................................ 325
Saving Expressions to a File ...................................................................................................... 326
Saving Data as Part of a Workbook ............................................................................................. 327
11.3 Reading from Files ................................................................................................................. 327
Reading Data from a File .......................................................................................................... 327
Reading Expressions from a File ................................................................................................ 328
Reading Data From Workbook Attachments ................................................................................. 329
11.4 Exporting to Other Formats ..................................................................................................... 329
Exporting Documents ............................................................................................................... 329

viii • Contents

MapleNet ............................................................................................................................... 331
11.5 Connectivity ......................................................................................................................... 331
Translating Maple Code To Other Programming Languages ............................................................. 331
Accessing External Products from Maple ..................................................................................... 331
Accessing Maple from External Products ..................................................................................... 332
Sharing and Storing Maple Content ............................................................................................. 333
Index ............................................................................................................................................ 335

List of Figures
Figure 1.1: The Maple Environment ........................................................................................................ 2
Figure 1.2: Text and Math Buttons on the Toolbar .................................................................................... 14
Figure 1.3: Accessing the Assistants from the Tools Menu ......................................................................... 24
Figure 1.4: Accessing Tutors from the Tools Menu ................................................................................... 26
Figure 1.5: Calculus - Single Variable → Differentiation Methods Tutor ....................................................... 27
Figure 1.6: Click the expression to see applicable operations in the context panel ........................................... 28
Figure 1.7: Click the plot to see plot options in the context panel ................................................................. 28
Figure 1.8: Browse Tasks Dialog ........................................................................................................... 29
Figure 1.9: Equation Label ................................................................................................................... 35
Figure 1.10: Inserting an Equation Label ................................................................................................ 36
Figure 1.11: Controlling Equation Label Format ...................................................................................... 36
Figure 1.12: Label Reference ............................................................................................................... 36
Figure 1.13: Document Block Markers ................................................................................................... 37
Figure 1.14: Expanded Document Block ................................................................................................. 37
Figure 1.15: Sample Help Page ............................................................................................................. 39
Figure 2.1: Context Panel .................................................................................................................... 51
Figure 2.2: Approximating the Value of a Fraction .................................................................................... 53
Figure 2.3: Finding the Approximate Solution to an Equation ..................................................................... 54
Figure 2.4: Units Palette ...................................................................................................................... 54
Figure 3.1: Calculus Palette .................................................................................................................. 64
Figure 3.2: Integer Context Panel .......................................................................................................... 65
Figure 3.3: ODE Analyzer Assistant ...................................................................................................... 66
Figure 3.4: Task Browser ..................................................................................................................... 67
Figure 3.5: Insert Label Dialog ............................................................................................................. 72
Figure 3.6: Format Labels Dialog: Adding a Prefix ................................................................................... 73
Figure 4.1: Context Panel for an Integer ................................................................................................. 79
Figure 4.2: Context Panel for an Equation ............................................................................................... 83
Figure 4.3: ODE Analyzer Assistant ...................................................................................................... 90
Figure 4.4: ODE Analyzer Assistant: Solve Numerically Dialog ................................................................. 91
Figure 4.5: ODE Analyzer Assistant: Solve Symbolically Dialog ................................................................ 92
Figure 4.6: Units Converter Assistant ..................................................................................................... 96
Figure 4.7: Units Palette ...................................................................................................................... 97
Figure 5.1: Sorting a Polynomial Using the Context Panel ........................................................................ 115
Figure 5.2: Matrix Palette .................................................................................................................. 119
Figure 5.3: Matrix Palette: Choosing the Size ........................................................................................ 119
Figure 5.4: Insert Matrix or Insert Vector .............................................................................................. 120
Figure 5.5: Matrix Browser ................................................................................................................ 122
Figure 5.6: Computing the Infinity Norm of a Matrix .............................................................................. 129
Figure 5.7: Directional Derivative Tutor ............................................................................................... 135
Figure 5.8: Optimization Assistant ....................................................................................................... 141
Figure 5.9: Optimization Assistant Plotter Window ................................................................................. 142
Figure 5.10: Calculus 1 Derivatives Tutor ............................................................................................. 150
Figure 5.11: Calculus 1 Differentiation Methods Tutor ............................................................................. 151
Figure 5.12: Multivariate Calculus Gradient Tutor .................................................................................. 152
Figure 5.13: Multivariate Calculus Gradient Tutor Showing x-y Plane ........................................................ 152
Figure 5.14: Flowchart of solving a problem .......................................................................................... 155
Figure 5.15: Volume of Revolution Tutor .............................................................................................. 157
Figure 5.16: Inserted Task Template ..................................................................................................... 158
Figure 5.17: Example Worksheet ......................................................................................................... 159
Figure 6.1: Plot an Expression Using the Context Panel ........................................................................... 194
Figure 7.1: Select Color Dialog ........................................................................................................... 229

ix

x • List of Figures

Figure 7.2: Character Style Dialog ....................................................................................................... 230
Figure 7.3: Paragraph Style Dialog ...................................................................................................... 231
Figure 7.4: Style Management Dialog .................................................................................................. 232
Figure 7.5: Defining a Character Style .................................................................................................. 234
Figure 7.6: Defining a Paragraph Style ................................................................................................. 237
Figure 7.7: Style Set Management Dialog ............................................................................................. 237
Figure 7.8: Header and Footer Dialog - Custom Header ........................................................................... 239
Figure 7.9: Show Contents Dialog ....................................................................................................... 240
Figure 7.10: Working with Document Blocks ......................................................................................... 242
Figure 7.11: Delete Table Contents Verification Dialog ............................................................................ 247
Figure 7.12: Table Paste Mode Selection Dialog ..................................................................................... 247
Figure 7.13: Two Cells ...................................................................................................................... 248
Figure 7.14: Merged Cells .................................................................................................................. 248
Figure 7.15: Drawing Tools and Canvas ................................................................................................ 255
Figure 7.16: Drawing Outline Color Icon .............................................................................................. 256
Figure 7.17: Drawing Properties Canvas Icon - Change the Gridline Color .................................................. 257
Figure 7.18: Hyperlink Properties Dialog .............................................................................................. 258
Figure 7.19: Bookmark Indicator ......................................................................................................... 261
Figure 7.20: Create Bookmark Dialog .................................................................................................. 262
Figure 7.21: Components Palette ......................................................................................................... 264
Figure 7.22: Interactive Application Task Template ................................................................................. 265
Figure 7.23: Spellcheck Dialog ........................................................................................................... 266
Figure 8.1: Function Definition Palette Items ......................................................................................... 274
Figure 8.2: Evaluate at a Point ............................................................................................................ 286
Figure 9.1: Code Edit Region .............................................................................................................. 306
Figure 9.2: Collapsed Code Edit Region ............................................................................................... 307
Figure 9.3: Startup Code Editor ........................................................................................................... 307
Figure 10.1: Components Palette ......................................................................................................... 313
Figure 10.2: Label Properties Dialog .................................................................................................... 314
Figure 10.3: Slider Properties Dialog .................................................................................................... 314
Figure 10.4: The Inserted Components ................................................................................................. 316
Figure 10.5: DialComponent Action Code Editor .................................................................................... 317
Figure 10.6: A Simple Maplet ............................................................................................................. 319
Figure 10.7: Maplet Builder Interface ................................................................................................... 320
Figure 10.8: Image of the Maplet ......................................................................................................... 321
Figure 10.9: Body Elements Used to Define This Maplet ......................................................................... 321
Figure 11.1: Import Data Assistant ....................................................................................................... 327

List of Tables
Table 1.1: Common Keystrokes for Entering Symbols and Formats ............................................................... 5
Table 1.2: Maple Toolbar Options ........................................................................................................... 7
Table 1.3: Context Bar Tools .................................................................................................................. 9
Table 1.4: Context Selector Options ........................................................................................................ 9
Table 1.5: Text Mode vs. Math Mode ..................................................................................................... 14
Table 1.6: Palette Categories ................................................................................................................ 16
Table 1.7: Managing Palettes ................................................................................................................ 18
Table 1.8: Complex Numbers using I ..................................................................................................... 22
Table 1.9: Complex Numbers using i ..................................................................................................... 22
Table 1.10: Help Page Icons ................................................................................................................. 40
Table 3.1: Top Commands ................................................................................................................... 61
Table 3.2: Top Packages ...................................................................................................................... 62
Table 4.1: Select Integer Commands ...................................................................................................... 79
Table 4.2: Modular Arithmetic Operators ................................................................................................ 81
Table 4.3: Overview of Solution Methods for Important Equation Types ....................................................... 82
Table 4.4: Sample Dimensions .............................................................................................................. 95
Table 4.5: Scientific Constants ............................................................................................................ 100
Table 4.6: Restricting to Real Numbers ................................................................................................. 106
Table 5.1: Polynomial Arithmetic Operators .......................................................................................... 112
Table 5.2: Polynomial Coefficient and Degree Commands ....................................................................... 116
Table 5.3: Select Other Polynomial Commands ...................................................................................... 117
Table 5.4: Additional Polynomial Help ................................................................................................. 117
Table 5.5: Matrix and Vector Arithmetic Operators ................................................................................. 126
Table 5.6: Select Matrix and Vector Operators ........................................................................................ 127
Table 5.7: Select LinearAlgebra Package Commands .............................................................................. 130
Table 5.8: Limits .............................................................................................................................. 132
Table 5.9: Optimization Package Commands ......................................................................................... 144
Table 5.10: Student and Instructor Resources ......................................................................................... 149
Table 6.1: The plot and plot3d Commands ............................................................................................. 194
Table 6.2: Common Plot Options ......................................................................................................... 213
Table 6.3: Plot Context Bar Analysis Options ........................................................................................ 215
Table 6.4: The animate Command ....................................................................................................... 217
Table 6.5: Animation Options ............................................................................................................. 221
Table 9.1: Default Clause Values ......................................................................................................... 296
Table 9.2: Iterative Commands ............................................................................................................ 301
Table 9.3: The seq Command .............................................................................................................. 301
Table 9.4: The add and mul Commands ................................................................................................ 302
Table 9.5: The select, remove, and selectremove Commands ..................................................................... 302
Table 9.6: The map Command ............................................................................................................ 303
Table 9.7: The zip Command .............................................................................................................. 303
Table 10.1: Embedded Component Descriptions ..................................................................................... 309
Table 11.1: Summary of Content Translation When Exporting to Different Formats ...................................... 330

xi

xii • List of Tables

Preface
Maple Software
MapleTM software is a powerful system that you can use to solve mathematical problems from simple to complex. You
can also create professional quality documents, presentations, and custom interactive computational tools in the Maple
environment.
You can access the power of the Maple computational engine through a variety of interfaces.
Interface
Standard (default)

Command-line version
MapletTM Applications

Description
A full-featured graphical user interface that helps you create electronic documents to show all
your calculations, assumptions, and any margin of error in your results. You can also hide thecomputations to allow your reader to focus on the problem setup and final results. The advanced
formatting features lets you create the customized document you need. Because the documents
are live, you can edit the parameters and, with the click of a button, compute the new results.
The Standard interface has two modes: Document mode and Worksheet mode.
A command-line interface for solving very large complex problems or batch processing withscripts. No graphical user interface features are available.
Graphical user interfaces containing windows, textbox regions, and other visual interfaces,
which gives you point-and-click access to the power of Maple. You can perform calculations
and plot functions without using the worksheet.

This manual describes how to use the Standard interface. As mentioned, the Standard interface offers two modes:
Document mode and Worksheet mode. Using either mode, you can create high quality interactive mathematical documents. Each mode offers the same features and functionality, the only difference is the default input region of eachmode.

Shortcut Keys by Platform
This manual will frequently refer to shortcut keys and command completion when entering expressions. The keyboard
keys used to invoke these features differ based on your operating system.
The keystrokes given in this document are for Windows. There will be differences for other platforms. If you are using
a different platform, see Shortcut Keys.

Command Completion• Esc, Macintosh, Windows, and Linux• Ctrl + Space, Windows• Ctrl + Shift + Space, Linux
Begin entering a command in a Maple document. Press the Esc key. Alternatively, use the platform-specific keys. For
Windows, press and hold the Ctrl key and then press the Space bar.
For more information on Command Completion, see Command Completion (page 34).

In This ManualThis manual provides an introduction to the following Maple features:• Ease-of-use when entering and solving problems• Point-and-click interaction with various interfaces to help you solve problems quickly• Maple commands and standard math notationxiii

xiv • Preface• Clickable MathTM• The help system• Online resources• Performing computations• Creating plots and animations• The Maple programming language• Using and creating custom Maplet applications• File input and output, and using Maple with third party products• Data structures
For a complete list of manuals, study guides, toolboxes, and other resources, visit the Maplesoft website at
http://www.maplesoft.com

Audience
The information in this manual is intended for first-time Maple users and users looking for a little more information.

Conventions
This manual uses the following typographical conventions.
• bold font - Maple command, package name, option name, dialog, menu, or text field• italics - new or important concept• Note - additional information relevant to the section• Important - information that must be read and followed

Customer Feedback
Maplesoft welcomes your feedback. For suggestions and comments related to this and other manuals, contact support@maplesoft.com.

1 Getting Started
Don't worry about your difficulties in Mathematics. I can assure you mine are still greater.
~Albert Einstein

Mathematics touches us every day—from the simple chore of calculating the total cost of our purchases to the complex
calculations used to construct the bridges we travel.
To harness the power of mathematics, Maplesoft provides a tool in an accessible and complete form. That tool is Maple.

1.1 In This Chapter
SectionTopicsIntroduction to Maple (page 1) - The main features of Maple's • Starting the Standard Document Interface
Standard Interface• Entering commands and mathematical expressions• Toolbars• Context Panel• Copy and drag keys
• Saving Maple documents
Entering Expressions (page 14) - Methods of entering
expressions in 1-D and 2-D Math

• Execution groups• Math Mode and Text Mode
• Palettes• Symbol names• Toolbar icons

Point-and-Click Interaction (page 24) - An introduction to the • Assistants
point-and-click features in Maple• Tutors• Context Panel• Task Templates• Exploration AssistantCommands (page 32) - An introduction to the commands of the • Using commands from the Maple library
Maple language• Entering commands• Document blocks
The Maple Help System (page 38) - Accessing help oncommands, packages, point-and-click features, and more

• How to access help for Maple features• Interacting with help pages• Viewing and interacting with examples

Available Resources (page 41) - Both online and from within
Maple• New user resources, including tutorials and the Maple Portal• Examples• Maple website resources

1.2 Introduction to Maple
Working in Maple
With Maple, you can create powerful interactive documents. The Maple environment lets you start solving problems
right away by entering expressions in 2-D Math and solving these expressions using point-and-click interfaces. You
can combine text and math in the same line, add tables to organize the content of your work, or insert images and sketch

12 • 1 Getting Started

regions. You can visualize and animate problems in two and three dimensions, format text for academic papers orbooks, and insert hyperlinks to other Maple files, websites, or email addresses. You can embed and program graphicaluser interface components, as well as devise custom solutions using the Maple programming language.

Figure 1.1: The Maple Environment

Starting the Standard Document Interface
To start Maple on:
Windows

From the Start menu, select All Programs → Maple 2024 → Maple 2024.
Alternatively:
Double-click the Maple 2024 desktop icon.

1.2 Introduction to Maple • 3

macOS

1. From the Finder, select Applications and Maple 2024.
2. Double-click Maple 2024.

Linux

Enter the full path, for example, /usr/local/maple/bin/xmaple
Alternatively:
1. Add the Maple directory (for example, /usr/local/maple/bin) to your command search path.
2. Enter xmaple.

When the first Maple session opens, a Start Page displays shortcuts to useful tasks and topics.
To start a Maple session:• In the Start Page, select New Document or New Worksheet. A blank document displays.
or• From the File menu, select New, and then either Document Mode or Worksheet Mode. A blank document displays.
You can opt to start Maple with a blank document instead of the start page. You can also replace the default start page
with a custom start page. For instructions, refer to the startpage help page.
To invoke the Start Page at any time, click the home button () on the worksheet toolbar.

Document and Worksheet Modes
Maple offers two modes, Document Mode and Worksheet Mode. Using either mode, you can create high quality interactive mathematical documents. Each mode offers the same features and functionality; the only difference is the default
input region of each mode.
Document Mode
Document mode uses Document Blocks as the default input region to hide Maple syntax. A Document Block region
is indicated by two triangles located in the vertical Markers column along the left pane of the Maple Document,.
If the Markers column is not visible, open the View menu and select Markers. This allows you to focus on the problem
instead of the commands used to solve the problem. For example, when using the context-sensitive operations fromthe Context Panel on Maple input in Document mode (invoked by moving your mouse cursor over your input expression,then selecting the appropriate operation from the displayed context panel), input and output are connected using anarrow or equal sign with self-documenting text indicating the calculation that had taken place. The command used tosolve this expression is hidden.

To create a new document, select File → New → Document Mode.

Worksheet Mode
Worksheet mode uses a Maple prompt as the default input region. The Maple input prompt is a red angle bracket,
When using context-sensitive operations on input in Worksheet mode, all commands are displayed.

.

4 • 1 Getting Started

To create a new worksheet, select File → New → Worksheet Mode.
Full Flexibility in Either Mode
Regardless of which mode you begin working in, you have the opportunity to use both document blocks and commandprompts.
For example, you can hide commands in Worksheet Mode by adding a document block from the Edit menu, Edit →Document Blocks → Create Document Block (see Document Blocks (page 36)), or you can show commands inDocument mode by adding a Maple prompt from the Insert menu, Insert → Execution Group → Before / After
Cursor (see Input Prompt (page 58)).
This chapter discusses features common to both modes. Specific aspects of Document mode are explained in Document
Mode (page 45), and aspects of Worksheet mode are explained in Worksheet Mode (page 57).
The Maple Workbook
The Maple Workbook acts as a container that lets you collect Maple worksheets, library archives and language files,
data (such as images or spreadsheets), and other items into a single file, stored in the .maple file format. This lets you
better organize your Maple-based projects. For more information, refer to the Workbook Overview help page.
Navigation of Workbook files is accomplished through the workbook Navigator palette, available in the Workbook
tab. For more information, refer to The Workbook Navigator help page.

Entering 2-D MathIn documents, the default format for entering mathematical expressions is 2-D Math. This results in mathematical expressions that are equivalent to the quality of math found in textbooks. Entering 2-D Math in Maple is done using
common key strokes or palette items. For more information on palettes, see Palettes (page 15). An example of entering
an expression using common key strokes is presented in the following section. An example of entering an expression
using palette items is presented in Example 3 - Enter an Expression Using Palettes (page 20).
Common Operations
Entering mathematical expressions, such as
To enter a fraction starting with the numerator:
1. Enter the numerator.
2. Press the forward slash (/) key.
3. Enter the denominator.
4. To leave the denominator, press the right arrow key.
To enter a fraction starting with the denominator:
1. Enter the denominator.
2. Press // (two forward slashes).
3. Enter the numerator.
4. To leave the numerator, press the right arrow key.

,

, and

is natural in 2-D Math.

1.2 Introduction to Maple • 5

To enter a power:
1. Enter the base.
2. Press the caret (^) key.
3. Enter the exponent, which displays in math as a superscript.
4. To leave the exponent, press the right arrow key.
To enter a product:
1. Enter the first factor.
2. Press the asterisk (*) key, which displays in 2-D Math as a dot, .
3. Enter the second factor.
Implied Multiplication:
In general, the best practice is to enter a multiplication symbol (*) for multiplication in any calculation. In some cases,
you can instead insert a space character between two quantities to multiply them. This is called implicit multiplication.
For example, in the expression

a space is used for the multiplication 4*a*c and 2*a.

In the case of a number followed by a variable, Maple interprets the expression as meaning multiplication even without
the presence of * or a space character.
However, it's easier to identify and correct mistakes in your formulas if you use the multiplication symbol (*) regularly.
Important: Maple interprets a sequence of letters, for example,, as a single variable. To specify the product of
two variables, you must insert a space character (or multiplication operator), for example,or. For more information, refer to the 2DMathDetails help page.
Shortcuts for Entering Mathematical Expressions
Table 1.1: Common Keystrokes for Entering Symbols and Formats
Symbol/Formats
implicit multiplication

Key
Space key

explicit multiplication

Shift + *fraction/ (forward slash)exponent (superscript)// (two forward slashes)
Shift + ^indexed subscript
literal subscript (subscriptedvariable name)navigating expressions

Ctrl + Shift + _ (Command + Shift + _ inMac)__ (two underscores)
Arrow keys

Example6 • 1 Getting Started

Symbol/Formats
command / symbol completion

Key• Esc in Mac, Windows, and Linux

Example• Ctrl + Space in Windows• Ctrl + Shift + Space in Linuxsquare root

sqrt and then command completion

exponential function
enter / exit 2-D Math

exp and then command completion• F5 key• Math and Text icons in the toolbar

versus 1/4

required for products of numbers
use the right arrow key to leave a denominator, numerator, superscript, or subscript region
for more information, see Command Completion (page 34).

For a complete list of shortcut keys, refer to the 2-D Math Shortcut Keys and Hints help page. To access this help
page in the Maple software, in Math mode enter ?MathShortcuts and then press Enter. For information on the Maple
Help System, see The Maple Help System (page 38).
Example 1 - Enter and Evaluate an Expression Using Keystrokes
Review the following example:

In this example, you will enterand evaluate the expression.

ActionTo enter the expression:
1. Enter x.
2. Press Shift + ^ . The cursor moves to the superscript position.
3. Enter 2.
4. Press the right arrow key. The cursor moves right and out of the superscript position.
5. Enter the + symbol.

6. Enter y.
7. Press Shift + ^ to move to the superscript position.
8. Enter 2 and press the right arrow key.
9. With the mouse, select the expression that will be the numerator of the fraction.

Result in Document

1.2 Introduction to Maple • 7

ActionResult in Document

10. Enter the / symbol. The cursor moves to the denominator, with the entire expression in
the numerator.
11. Enter 2.

12. Press the right arrow key to move right and out of the denominator position.

To evaluate the expression and display the result inline:=

13. Press Ctrl + = (Command + = in Mac).

To execute 2-D Math, you can use any of the following methods.
• Pressing Ctrl + = (Command + = in Mac). That is, press and hold the Ctrl (or Command) key, and then press theequal sign (=) key. This evaluates and displays results inline.
• Pressing the Enter key. This evaluates and displays results on the next line and centered.
• Select the input and from the context panel, select Evaluate and Display Inline. See The Context Panel (page 27)
for more details.
• Using the Evaluate menu items Evaluate and Evaluate and Display Inline.

Toolbar Options
The Maple toolbar offers easy access to a number of actions. See Table 1.2.
Table 1.2: Maple Toolbar Options
Basic Usage

Open an existing document or worksheet

Equivalent Menu Option or
Command
From the File menu, select New andthen Document Mode
From the File menu, select Open...

Save the active document or worksheet

From the File menu, select Save...

Print the active document or worksheet

From the File menu, select Print...

Print preview the active document or worksheet

From the File menu, select Print
Preview...
From the File menu, select Print
Layout Mode.

Create a new Maple document

Toggle the Print Layout Mode

Icon

Cut the selection to the clipboard

From the Edit menu, select Cut

Copy the selection to the clipboard

From the Edit menu, select Copy

Paste the clipboard contents into the current document
or worksheet
Undo the last operation

From the Edit menu, select Paste

Redo the last operation

From the Edit menu, select Redo

From the Edit menu, select Undo

8 • 1 Getting Started

Basic Usage
Insert the Code Edit Region
Inserts plain text after the current execution group.
Inserts Maple Input after the current execution group.
For details, refer to Execution Groups (page 14).
Encloses the selection in a document block. If nothingis selected, it creates a new document block.
Encloses the selection in a subsection. For details,
refer to Sections (page 237).
Remove one level of indentation enclosing theselection.
Move backward to previous document in the hyperlink
history
Open the start page
Move forward to next document in the hyperlink
history.
Executes all commands in the worksheet or document
Executes a selected area.

Icon

Equivalent Menu Option or
Command
From the Insert menu, select Code
Edit Region
From the Insert menu, select Text.
From the Insert menu, selectExecution Group and then After
CursorFrom the Edit menu, select Document
Blocks and then Create Document
Block
From the Format menu, select Insert
SectionFrom the Format menu, select Remove
SectionFrom the Execute menu, selectExecute Worksheet.
From the Evaluate menu, selectExecute Selection.

Interrupt the current operation.
Debug the current operation
Clears Maple's internal memory. For details, refer tothe restart help page.
Add and edit Maple code that is executed each time
the worksheet is opened. For details, refer to thestartupcode help page.
Adjusts the display size of document content. Note:
Plots, images, and sketches remain unchanged.
Reset zoom level.

Enter restart.

Opens the Maple help system in a new window. For
details, refer to The Maple Help System (page 38).
Search box provides quick access to the help system.

From the Help menu, select Maple
Help.

From the Edit menu, select Startup
Code.
From the View menu, select Zoom
Factor and then a zoom size.
From the View menu, select Zoom
Factor → Default.

Access to the MapleCloud on the web.

The Context Bar shows icons that are relevant to the location of the cursor in the document. For example, place thecursor at an input region and the Text and Math tools are accessible. See Table 1.3 for a list of the tools available ineach icon.

1.2 Introduction to Maple • 9Table 1.3: Context Bar Tools
Context Bar Tools
Text
otsol
Math
otsol
Drawing tools

2-D Plot tools

3-D Plot tools

Animation tools

Table 1.4: Context Selector Options
RegionInput region
Plot region
Animation region
Drawing Canvas and Image regions

Available Tools
Text and Math icons
Drawing and Plot icons
Drawing, Plot, and Animation icons
Drawing icon

The Text and Math icons allow you to enter text and math in the same line by choosing the appropriate input style ateach stage when entering the sentence, such as the following sentence:
The graph ofis a parabola that opens up with vertex at.

For a step-by-step example of creating a sentence with text and math, see Example 6 - Enter Text and 2-D Math in theSame Line Using Toolbar Icons (page 22).
The meaning of the Text and Math icons differs while at a Maple input prompt. The Math icon displays input as 2-D
Math, whereas the Text icon displays Maple input. For details, refer to Math Mode vs. Text Mode (page 14).
>> x^2/2;
To access the tools available in the Plot and Drawing icons, click a plot region. These tools allow you to manipulate
the plot or draw shapes and enter text on the plot region. By clicking an animation region, you have the same features
available for a plot region, in addition to tools for playing the animation in the Animation icon. For details on plots
and animations, refer to Plots and Animations (page 187).
For the description of any icon, hover the mouse over the icon to display at tooltip.

10 • 1 Getting Started

The Context Panel and Copy & Drag
Context Panel
Maple dynamically generates a collection of applicable options when you select or hover your mouse over an object,expression, or region. The options are organized and collectively displayed in the context panel to the right-hand sideof the Maple user interface. The options available in the context panel depend on the selected input region. For example,
you can manipulate and graph expressions, enhance plots, format text, manage palettes, structure tables, and more.
When using menu items from the context panel to perform an action on an expression, the input and output are connectedwith a self-documenting arrow or equal sign indicating the action that had taken place. For more information, see The
Context Panel (page 27).
Copy & DragWith Maple, you can drag input, output, or curves in a plot region into a new input region. This is done by highlighting
the input or selecting the curve and dragging it with your mouse into a new input region. Dragging the highlighted region
will cut or delete the original input. To prevent this, use the copy and drag feature.
• Ctrl + drag, Windows and Linux• Command + drag, Mac
That is, highlight the region you want to copy. Press and hold the Ctrl key while you drag the input to the new region
using the mouse. The analogous operation on Mac uses the Command key.
Example 2 - Solve and Plot an Equation Using Context Panel Options and Copy & Drag
Review the following example:

In this example, you will enter the equation and then solve and plot the equation using the context panel and the copy
& drag feature. This example will only refer to the keystrokes needed on a Windows operating system to invoke thecontext panel and the copy & drag feature. For your operating system, refer to section Shortcut Keys by
Platform (page xiii) for the equivalent keystrokes.

1.2 Introduction to Maple • 11

To solve the equation:
1. Enter the equation.
2. Click the equation and select Move to Left.

Input:

Result:A brief description, "move to left" is displayed above the arrow that connects the input and output.
3. Right-click the output from the previous action,, and select Solve → Isolate Expression for → x.

12 • 1 Getting Started

Input:

Result:

Now that we have solved the equation, we can plot it. To do this, we will copy the equation
block and use the context panel again.

to a new document

4. From the Edit menu, select Document Blocks→ Create Document Block.
5. To copy the expression, highlight this expression from the previous line. Press and hold the Ctrl key anddrag the expression to the new document block region.

Result:1.2 Introduction to Maple • 13

To plot the expression:
6. From the context panel, select Plot both sides.
Input:

Result:Saving a Maple Document
To save these examples you created, from the File menu, select Save. Maple documents are saved as .mw files.

Saving a Maple Document as a Workbook
To save these examples you created as part of a new Maple workbook, from the Workbook tab, click Save As
Workbook. For more information about saving Maple content refer to the worksheet,managing,saving help page.

14 • 1 Getting Started

1.3 Entering Expressions
Execution Groups
An execution group is a grouping of Maple input with its corresponding Maple output. It is distinguished by a large
square bracket, called a group boundary, at the left. An execution group may also contain any or all of the following:a plot, text, embedded components, and a drawing canvas.
Execution groups are the fundamental computation and documentation elements in the document. If you place thecursor in an input command and press the Enter or Return key, Maple executes all of the input commands in thecurrent execution group.

Math Mode vs. Text Mode
The default mode of entry in Document or Worksheet mode is Math Mode, which displays input in 2-D Math. In
Worksheet Mode or at a prompt, you can opt to use Maple Input (1-D Math). This is 1-D math input:> simplify(cos(alpha)^2+sin(alpha)^2);> a*int(exp(sqrt(2)*x),x);> limit(f(x),x=infinity);> sum(a[k]*x^k, k=0..m)=product(b[j]*x^j, j=0..n);

In Document Mode, to enter input using Maple Input mode, insert a Maple prompt by clicking in the toolbar, andthen click the Text button in the context bar. In Worksheet Mode, simply click the Text button. See Figure 1.2.

Figure 1.2: Text and Math Buttons on the Toolbar
Table 1.5: Text Mode vs. Math Mode
Math Mode

Text Mode

Maple's default setting. Executable standard math notation. Executable Maple notation. This is referred to as 1-D MathThis is also referred to as 2-D Math Input.
Input or Maple Input.
>> int(x^2+2*x+6, x);

Access from the Insert → 2-D Math menu.
Access from the Insert → Maple Input menu.
When using 2-D Math, the Math mode icon is highlighted in the When entering Maple Input or text in a text region, the Text mode
toolbar,.
icon is highlighted in the toolbar,.

1.3 Entering Expressions • 15

Math Mode
Text Mode
In Document Mode (or a document block), input is entered in a In Document Mode (or a document block), text is entered with adocument block with a slanted cursor,.

vertical cursor, as plain text,.

In Worksheet Mode, input is made at an input prompt with a

In Worksheet Mode, input is made at an input prompt with aslanted cursor,

vertical cursor,.

To convert a 2-D Math expression to 1-D Math, click theexpression, then from the context panel select 2-D Math →Convert To → 1-D Math Input.
Palettes make entering expressions in familiar notation easierthan entering foreign syntax and reduces the possibility of
introducing typing errors.

.

To convert a 1-D Math expression to 2-D Math, click theexpression, then from the context panel select Convert To →2-D Math Input.
Using palettes while in 1-D Math teaches you the related Maple
command syntax.

If you prefer 1-D Math input in Worksheet mode, you can change the default math input notation.
To change math input notation for a session or globally across all documents:
1. From the Tools menu, select Options. The Options Dialog opens.
2. Click the Display tab.
3. In the Input Display drop-down list, select Maple Notation.
4. Click the Apply to Session or Apply Globally button.
This changes the default input math notation at the prompt ( ).
Important: The new input display becomes the default setting after pressing the Enter key.

Palettes
Palettes are collections of related items that you can insert into a document by clicking or drag-and-dropping. The
Maple environment provides access to over 30 palettes containing items such as symbols
ematical operations, layouts

math-and much more.

By default, palettes are displayed in the left pane of the Maple environment when you launch Maple. If the palettes
are not displayed,
1. From the View menu, select Palettes.
2. Select Expand Dock.
3. Right-click (Control-click, Mac) the palette dock. From the context menu, select Show Palette. Alternatively, fromthe main menu, select View → Palettes → Show Palette.
A list of potential palettes is displayed, with currently displayed palettes dimmed.
4. Select a palette.
Alternatively, select View → Palettes → Show All Palettes.
You can create a Favorites palette of the expressions and entities you use often by right-clicking (Control-click, Mac)
the palette template you want to add and selecting Add To Favorites Palette from the context menu.

16 • 1 Getting Started

Table 1.6: Palette Categories
Palette Category
Alphabetical Palettes

Palette Description
Greek

,

Script,,Fraktur,Open Face,

Cyrillic

Diacritical Marks

Mathematical Palettes,

Roman Extended Upper Case,

Roman Extended Lower Case.

Palettes for constructing expressions
Common Symbols,,

Relational

Relational Round,,Operators

Large Operators,,

NegatedFenced,Arrows,Constants and Symbols.

Punctuation - insert punctuation symbols, such as inserting the registered trademark andcopyright symbols

into text regions

Miscellaneous - insert miscellaneous math and other symbols outside the above categories.

1.3 Entering Expressions • 17

Palette Category
Expression Palettes

Palette Description
Expression - construct expressions such as logarithms.

Matrix - enter the number of rows and columns required, designate type, such as zero-filled,
and designate shape, such as diagonal.
Layout - add math content that has specific layout, such as expressions with one or more
superscripts and subscripts.

Calculus - construct expressions such as integrals.

Handwriting - an easy way to find a desired symbol.
Units - select a unit and insert into document, such as
Accents - insert decorated names, such as anor.

with an arrow over it to denote a vector.

Trigonometric & Hyperbolic - a palette for constructing expressions containing
trigonometric and hyperbolic functions
Student Random Variables - a palette for constructing random variables based on
distributions in the Student Statistics package
Group Constructors - a palette for constructing groups based on the Group Theory package

Other Palettes

Components - embed graphical interface components such as a button into your document
or worksheet. Components can be programmed to perform an action when selected such as
executing a command when a button is clicked.
Favorites - add templates that you use most often from other palettes.Variables - manage
all of your assigned variables in your current Maple session.

18 • 1 Getting Started

Palette Category
Task Palettes

Palette Description
Live Data Plots - templates for visual representation of your data.
eBook Metadata - markup tags for use when creating eBooks from Maple worksheets
Tasks - a palette where you can store tasks that you have createdViewing and Arranging Palettes
By default, palettes display in palette dock in the left pane of the Maple window. To view and manage palettes andpalette docks, see Table 1.7.
Table 1.7: Managing Palettes
To view the palette dock:• From the View menu, select Palettes, and then Expand
Dock. The dock is in the left pant of the window.

1.3 Entering Expressions • 19

To add a palette:
1. Right-click the palette dock. Maple displays a context
menu near the palette.
2. From the context menu, select Show Palette and thenselect the palette.

To expand or collapse a palette in the palette dock:• Click the triangle at the left of the palette title.

To move a palette in the palette dock:• Move the palette by clicking the title and dragging thepalette to the new location.

20 • 1 Getting Started

To expand or collapse the pane containing the palettedock:• Select the appropriate triangle at the top right side of thepalette region.

Example 3 - Enter an Expression Using Palettes
Review the following example:=

In this example, we will enterand evaluate the expression.

ActionResult in Document
1. Place the cursor in a new document block. In the Expression palette,

click the summation template. Maple inserts the summation
symbol with the range variable placeholder highlighted.
2. Enter i and then press Tab. The left endpoint placeholder is selected.
Notice that the color of the range placeholder has changed to black.
Each placeholder must have an assigned value before you execute theexpression. The Tab key advances you through the placeholders of an
inserted palette item.
3. Enter 1 and then press Tab. The right endpoint placeholder is selected.

4. Enter 10 and then press Tab. The expression placeholder is selected.

5. Enter
For instructions on entering this type of expression,see Example 1 - Enter and Evaluate an Expression Using
Keystrokes (page 6).
6. Press Ctrl + = (Command + = for Mac) to evaluate the summation.
=

Favorites Palette
You can add to the Favorites palette any expressions that you use most often.
• To add an entry from another palette to the Favorites palette, simply drag the entry to the Favorites palette.

1.3 Entering Expressions • 21

• To add a custom expression, select the expression in the worksheet and select Add Selection to Favorites Palettefrom the Context Panel.

Symbol Names
Each symbol has a name and some have aliases. By entering its name (or an alias) in Math mode, you can insert thesymbol in your document. All common mathematical symbols, including all Greek characters,
symbol (, and the square root), are recognized by Maple.

Note: If you hover the mouse pointer over a palette item, a tooltip displays the symbol's name.
To insert a symbol, enter the first few characters of a symbol name using a keyword that is familiar to you and thenpress the completion shortcut key, Esc (see Shortcut Keys by Platform (page xiii)). Symbol completion works in thesame way as command completion (see Command Completion (page 34)).
• If a unique symbol name matches the characters entered, Maple inserts the corresponding symbol.
• If multiple symbol names match the characters entered, Maple displays the completion list, which lists all matches,
including commands. To select an item, click its name or symbol.
Example 4 - Square Root
To find the square root of:

Action1. In a new document block, enter sqrt.

Result in Document

2. Press the symbol completion shortcut key, Esc. Maple
displays a popup list of exact matches.

3. In the completion list, selectMaple inserts the symbol with the
4. Enter.
placeholder selected.

into the placeholder.

5. Press Ctrl + = (Command + =, Mac).

=

Example 5 - Complex Numbers
In Maple, the default display for imaginary i is a capital . When you simply type the letter
italics. This letter is just a variable, and is not the same as the imaginary unit

in Math mode, it is indenoted byor=Multiply two complex numbers,
We will compute the result two ways, using

and:and then using . The first way is the quickest to enter.

in Maple.

22 • 1 Getting Started

Table 1.8: Complex Numbers using I
Action1. In a new document block, enter

Result in Document

Use * to enter multiplication between the twocomplex numbers.
2. Press Ctrl + = (Command + =, Mac) to evaluate
the product.

=

The next method, while not as quick to enter, displays the computation using lowercase i.
Table 1.9: Complex Numbers using i
Action1. In a new document block, enter.

Result in Document

2. Press the symbol completion shortcut key, Esc.
Maple displays a popup list of partial and exact
matches, including symbols and commands.

3. Select the imaginary unit,.

4. Close the parentheses, enter * (for multiplication),and type the second expression in parentheses,
using symbol completion for the second imaginary
number.
5. Press Ctrl + = (Command + =, Mac) to evaluate
the product.

=

For more information on entering complex numbers, refer to the HowDoI/EnterAComplexNumber help page.

Toolbar Icons
In the introduction section, you learned about the toolbar icons and context toolbars available in Maple (see Toolbar
Options (page 7)). The toolbar can be used to format your document, alter plots and animations, draw in a canvas,
write in both Math and Text modes in one line and much more. The last of these is demonstrated in the next example.
Example 6 - Enter Text and 2-D Math in the Same Line Using Toolbar Icons
Enter the following sentence:
Evaluate
and write in simplest terms.

1.3 Entering Expressions • 23

ActionTo enter this sentence:

Result in Document

1. Select the Text icon and enter "Evaluate ".

2. Select the Nonexecutable Math icon.
3. From the Calculus palette, select the definite integration

template,. The expression is displayed with thefirst placeholder highlighted.
4. With the first placeholder highlighted, enter 1, then press
Tab.
5. Enter 5 and press Tab to highlight the integrand region.
6. Enter (3x^2 and press the right arrow to leave thesuperscript position.
7. Enter + 2.
8. Press the Space bar for implicit multiplication. Enter sqrt
and press Esc to show the command completion options.
Maple displays a popup list of exact matches. Select thesquare root symbol,.
Maple inserts the symbol with the x placeholder selected.
(Alternatively, select the square root symbol from theExpression palette.)
9. Enter x, then press the right arrow to leave the square root
region.
10. Enter + 3, and then press the Space bar.
11. Select the n-th root symbol from the Expression palette,.

12. Enter 3, then press Tab.
13. Enter x, then press the right arrow to leave the root region.
14. Enter ), then press Tab.
15. Enter x for the integration variable.

16. Put the cursor after the expression and click the Text iconin the toolbar, then enter the rest of the sentence: " andwrite in simplest terms."

Note: When an expression is intended for display purposes only, as in this example, it can be displayed in nonexecutable
math. This is indicated by the gray background. For more information on executable and nonexecutable math, refer tothe 2DMathDetails help page.

24 • 1 Getting Started

1.4 Point-and-Click Interaction
Maple contains many built-in features that allow you to solve problems quickly without having to know any commands.

Assistants
Maple offers a set of assistants in the form of graphical user interfaces to perform many tasks without the need to use
any syntax.
Using the Tools → Assistants menu, you can access tools to help you accomplish various tasks. See Figure 1.3. In
some cases, you can launch an assistant by entering an expression and selecting the assistant from the options in theContext Panel.

Figure 1.3: Accessing the Assistants from the Tools Menu

Descriptions of Assistants
The available assistants are described below. Some of the assistants are interfaces to package commands. For more
information on package commands, see Package Commands (page 34).
• Code Generation - an interface to automatically transform Maple expressions and programs to other languages.
• eBook Publisher - an interface to the eBook Publisher tools.
• Import Data - an interface to read data from an external file into Maple.
• Installer Builder - an interface to the InstallerBuilder package in which you can create installers for your Maple
toolboxes.
• Library Browser - an interface to manipulate the libraries in a specified directory.
• Maplet Builder - an interface to the Maplets package. The Maplets package contains commands for creating anddisplaying Maplet applications (point-and-click interfaces). Using the Maplet Builder, you can define the layout ofa Maplet, drag-and-drop elements (visual and functional components of Maplets), set actions associated with elements,
and directly run a Maplet application. The Maplet Builder is available in the Standard interface only.
• Plot Builder - an interface for creating two and three-dimensional plots, animations, and interactive plots.

1.4 Point-and-Click Interaction • 25

• Scientific Constants - an interface to over 20 000 values of physical constants and properties of chemical elements.
All of these constants come with the corresponding unit and, if applicable, with the uncertainty or error, that is, how
precisely the value of this constant is known.
• Special Functions - an interface to the properties of over 200 special functions, including the Hypergeometric,
Bessel, Mathieu, Heun and Legendre families of functions.
• Thermophysical Properties Calculator - Calculate state-dependent and independent thermophysical properties.
• Units Converter - an interface to convert between 500 units of measurement.
• Worksheet Migration - an interface to convert worksheets from Classic Maple (.mws files) to Standard Maple(.mw files).

Tutors
Maple provides over 50 interactive tutors and assistants to aid in the learning of• Basics• Precalculus• Calculus• Multivariate Calculus• Vector Calculus• Complex Variables• Differential Equations• Linear Algebra• Numerical Analysis• Optimization• Statistics
These tutors are easily accessible in the Tools menu by selecting Tutors. See Figure 1.4.

26 • 1 Getting Started

Figure 1.4: Accessing Tutors from the Tools Menu

Some of the tutors can also be accessed through the Student package. The Differential Equations tutor, DE Plots, isaccessible through the DEtools package. For a definition of the term package, see Package Commands (page 34).
The Student package is a collection of subpackages designed to assist with the teaching and learning of standard undergraduate mathematics. The subpackages contain many commands for displaying functions, computations, and theorems in various ways, and include support for stepping through important computations.
The interactive commands help you explore concepts and solve problems using a point-and-click interface. These
commands launch tutors that provide a graphical interface to some of the visualization and computation commands
described above. See Figure 1.5 for an example of one of the tutors.

1.4 Point-and-Click Interaction • 27

Figure 1.5: Calculus - Single Variable → Differentiation Methods Tutor

The Practice Sheets Assistant, found under Tools → Tutors→ Basics, lets you construct a practice sheet of mathproblems. It's easy to interactively construct a randomized set of problems arithmetic, algebra, calculus, factorizationand more. Students can then do the problems, check their solutions, and even generate another set of problems.
For more information on the tutors and related resources for mathematics education, see Teaching and Learning with
Maple (page 148).

Math Apps
Maple provides Math Apps that offer interactive, entertaining ways to explore mathematical concepts, ranging from
Precalculus to Physics to Economics. A guide to these demonstrations is accessible in the Tools menu by selecting
Math Apps.

The Context Panel
The context panel is a dynamically generated list of tools and actions that are applicable for the region on which it isinvoked. These tools and actions are further organized into menus. Use the context panel to perform calculations andmanipulations on expressions without using Maple syntax. To display the context panel, select an object, expression,or region. Context panel options are available for many input regions, including:• expressions to perform calculations, manipulations, or plotting• plot regions to apply plot options and manipulate the plot
• tables to modify the table properties28 • 1 Getting Started• text regions to add annotations and format text
When performing calculations or manipulations on an expression, a self-documenting arrow or equal sign connects
the input and output, indicating the action that took place. See Figures 1.8 and 1.9 for two examples of context-sensitive
operations.

Figure 1.7: Click the plot to see plot options in the context
panel

Figure 1.6: Click the expression to see applicable operationsin the context panel

Task Templates
Task templates help you perform specific tasks in Maple, such as:• performing a mathematical computation such as solving an equation symbolically or numerically, or determining
the Taylor approximation of a function of one variable• constructing a Maple object such as a function• creating a document such as an application
Each task contains a description along with a collection of content that you can insert directly into your document.
Content consists of 2-D mathematics, commands, embedded components (for example, buttons), and plots. You specify
the parameters of your problem and then execute the commands in the document. See Figure 1.8 for an example of a
Task Template.

1.4 Point-and-Click Interaction • 29

Figure 1.8: Browse Tasks Dialog

Previewing Tasks
To preview Maple tasks,• From the Tools menu, select Tasks, and then Browse. The Browse Tasks dialog opens and displays the list of tasks.
The tasks are sorted by subject to help you quickly find the desired task. In the Browse Tasks dialog, you can viewtasks without inserting them into your document.
Inserting a Task into the Document
To insert a task into your document,
1. Select the Insert into New Worksheet check box to insert the task into a new document.
2. Click one of the insert buttons.
• Click the Insert Default Content button. Maple inserts the default content. The default content level is set using
the Options dialog. For instructions, refer to the usingtasks help page.
• Click the Insert Minimal Content button. Maple inserts only the commands and embedded components, for example,
a button to launch the related assistant or tutor.
• Click the Copy Task to Clipboard button. Place the cursor where you want to insert the task, and then paste thetask. Maple inserts the default content. Use this method to quickly insert a task multiple times.

30 • 1 Getting Started

Note: You can view the history of previously inserted tasks. From the Tools menu, select Tasks. Previously selectedtask names are displayed below the Browse menu item.
Before inserting a task, Maple checks whether the task variables have assigned values in your document. If any task
variable is assigned, the Task Variables dialog opens to allow you to modify the names. Maple uses the edited variablenames for all variable instances in the inserted task.
By default, the Task Variables dialog is displayed only if there is a naming conflict. You can set it to display every
time you insert a task.
To specify that the Task Variables dialog be displayed every time you insert a task:
1. From the Tools menu, select Options.
2. Click the Display tab.
3. In the Show task variables on insert drop-down list, select Always.
4. Click Apply to Session or Apply Globally, as necessary.
Updating Parameters and Executing the Commands
In inserted Task Templates, parameters are marked as placeholders (in purple text) or specified using sliders or otherembedded components.
1. Specify values for the parameters in placeholders or using graphical interface components. You can move to thenext placeholder by pressing Tab.
2. Execute all commands in the task by:• Placing the cursor in the first task command, and then pressing Enter repeatedly to execute each command.
• Selecting all the template commands, and then clicking the execute toolbar icon.

3. If the template contains a button that computes the result, click it.
For more information on task templates, refer to the tasks help page.

Exploration Assistant
The Exploration Assistant allows you to interactively make parameter changes to expressions and view the result. The
assistant can be used with almost any Maple expression or command that has at least one variable or parameter.
To launch the Exploration Assistant:
1. Enter an expression or command.
2. Click the expression or command. From the context panel, select Explore.
3. The Explore parameter selection dialog appears, where you can select the parameters to explore and the range foreach parameter.
If you enter integer ranges, only integer values are allowed for parameters. To allow floating-point values, enter floatingpoint ranges.
Select skip for any of the parameters to leave that parameter as a variable.
4. Click Explore to continue to the Exploration Assistant. The assistant creates a table in the document. You can use
the slider or sliders to vary the parameters and see your changes as the expression output is updated.
5. Once you are finished interacting with the assistant, you can copy and paste the results into your document, or savethe interactive document for later use.

1.4 Point-and-Click Interaction • 31

Example 7 - Use the Exploration Assistant to Explore a PlotIn this example, we will explore how the plot of.
Action1. Enter the plot command shown.
2. Click the expression and select Explore
from the context panel.

3. In the Explore parameter selection dialog,
set the ranges a = 0..10.0 and b = -5..5.0.

Result in Documentchanges as we vary the parametersand32 • 1 Getting Started

ActionResult in Document
4. Click Explore. The Exploration Assistantcreates a table in the document. Move thesliders to see the plot as the parameterschange.

Tip: Since decimal numbers were used forthe ranges in step 3, the slider uses decimal
numbers. If you use integers for the ranges,
the slider uses integer numbers.

1.5 Commands
Even though Maple comes with many features to solve problems and manipulate results without entering any commands,
you may find that you prefer greater control and flexibility by using the set of commands and programming languagethat Maple offers.

The Maple Library
Commands are contained in the Maple library, which is divided into two groups: the main library and packages.
The main library contains the most frequently used Maple commands.
Packages contain related commands for performing tasks from disciplines such as Student Calculus, Statistics, orDifferential Geometry. For example, the Optimization package contains commands for numerically solving optimization problems.
For details on top-level and package commands, see Commands (page 59).

1.5 Commands • 33

Entering Commands
If you want to interact with Maple using commands, simply enter the command using 2-D math. Notice that commands
and variable names display in italics. Maple commands are constructed in a format similar to command(arguments),
based on the command you are using.
For example, to factor an expression, enter:To differentiate an expression, enter:To integrate an expression on the interval, enter:

To plot an expression, enter:

For a list of the top commands in Maple, see Top Commands (page 61).

34 • 1 Getting Started

Package Commands
There are two ways to access commands within a package, using the long form of the package command or the shortform.
Long Form of Accessing Package Commands:
The long form specifies both the package and command names using the syntax package[command](arguments).

Short Form of Accessing Package Commands:
The short form makes all of the commands in the package available using the with command, with(package). If you
are using a number of commands in a package, loading the entire package is recommended. When you execute thewith command, a list of all commands in the package displays. To suppress the display of all command names, end
the with(package) command with a colon. Alternatively, you can load packages through the Tools menu, by selecting
Load Package, and then the package name.

After loading a package, you can use the short-form names, that is, the command names, without the package name.

For a list of the top packages in Maple, see Top Packages (page 62).
Command Completion
To help with syntax and reduce the amount of typing when entering Maple commands, you can use command completion.
Command completion displays a list of all Maple packages, commands, and functions that match the entered text. If
there are multiple ways to call a command, then the command completion list contains each one, with appropriate
placeholders.
To use command completion:
1. Begin entering a command or package name.
2. Select Tools → Complete Command or use the shortcut key Esc (see Shortcut Keys by Platform (page xiii)). If
there is a unique completion, it is inserted. Otherwise, a list of possible matches is displayed.
3. Select the correct completion from the list.

1.5 Commands • 35

4. Some inserted commands have placeholders, denoted by purple text. The first placeholder is highlighted after you
insert it into the document. Replace it with your parameter, then move to the next placeholder by pressing the Tab
key.
Equation Labels
Equation labels help to save time entering expressions by referencing Maple output. See Figure 1.9.
By default, equation labels are displayed. If equation labels are not displayed,
1. From the Tools menu, select Options, and click the Display tab. Ensure that the Show equation labels check box
is selected.
2. From the Format menu, select Equation Labels. Ensure that both Execution Group and Worksheet are selected.

Figure 1.9: Equation LabelTo apply equation labels:
1. Enter an expression and press Enter. Note that the equation label is displayed to the right of the answer in the document.
2. In a new execution group, enter another expression that will reference the output of the previous execution group.
3. From the Insert menu, select Label. Alternatively, press Ctrl+L (Command+L, for Mac) to open the Insert Labeldialog. Enter the label number in the Insert Label dialog and click OK. The item is now a label. See Figure 1.10.

36 • 1 Getting Started

Figure 1.10: Inserting an Equation Label

4. Press Enter to obtain the result.
To change the format of equation labels:• Select Format → Equation Labels → Label Display. In the Format Labels dialog, select one of the numbering
schemes. Numbering can be flat numbers for the entire worksheet, or by section, so that equations in section 1 arelabeled (1.1), (1.2), and so on.
• Optionally, enter an appropriate numbering prefix.

Figure 1.11: Controlling Equation Label Format

The Label Reference menu item allows you to switch between the label name and its reference content. Place thecursor on the referenced equation label and select Format → Equation Labels → Label Reference.

Figure 1.12: Label Reference

The label is associated with the last output within an execution group.
You cannot apply equation labels to the following:• Error, warning, and information messages• Tables, images, plots, or sketches

Document Blocks
In Document mode, content is created as a series of document blocks. Document blocks allow you to hide the syntax
used to perform calculations, which in turn lets you focus on the concept presented instead of the command used tomanipulate or solve the problem. You can also create document blocks in Worksheet mode to perform the same function.

1.5 Commands • 37

Document blocks are typically collapsed to hide the Maple code, but these regions can also be expanded to reveal thiscode.
To create a document block:
From the Edit menu, select Document Blocks → Create Document Block. If text or math in one or more executiongroups is selected, then a document block is created that contains those execution groups. If not, a new document blockis created after the current execution group. For more information, see the next example.
Document block regions are identified using markers that are located in a vertical bar along the left pane of the document.
See Figure 1.13. In addition to document block boundaries, these markers (icons) indicate the presence of hidden attributes in the document such as annotations, bookmarks, and numeric formatting.
To activate markers:
From the View menu, select Markers. See Figure 1.13.

Figure 1.13: Document Block Markers

To view code in a document block:
1. Place the cursor in a document block to be expanded.
2. From the Edit→Document Blocks menu, select Show Command.

Figure 1.14: Expanded Document BlockWith the Document Block expanded, you can see the Maple command that was used to perform this calculation. In
Figure 1.14, the solve command was used.
Also notice a red prompt (>) before the original expression and the solve command. Entering commands outside of adocument block region is done at this input region. To insert an input region, click the
button in the toolbar menu.
In Figure 1.14, an equation label was used to refer to the expression. For more information, see Equation
Labels (page 35).
To collapse a Document Block:• With your cursor inside the document block, from the Edit → Document Blocks menu, clear the check box forShow Command.
You can use this process of expanding document blocks to view and edit Maple commands within a document block.

38 • 1 Getting Started

Changing the Display:
You can specify which parts of the input and output are displayed when the document block is collapsed. For each
execution group in the block, you can choose to display either the input or the output.
• Place the cursor in the execution group.
• From the Edit → Document Blocks menu, select Toggle Input/Output Display.
Also, you can choose to display output either inline or centered on a new line.
• From the Edit → Document Blocks menu, select Inline Document Output.

1.6 The Maple Help System
The Maple program provides a custom help system consisting of almost 5000 reference pages. The help system is aconvenient resource for determining the syntax of Maple commands and for learning about Maple features.

Accessing the Help System
There are several ways to access the Maple help system:• From the Help menu, select Maple Help.
• Enter a search term in the search box in the worksheet toolbar.
• Clickin the toolbar.

To get help on a specific word:• In a document, place the insertion point in a word for which you want to obtain help. From the Help menu, selectHelp on .... Alternatively, press F2 (Control + ?, for Mac) to access context-sensitive help.
• In a document, execute the command ?topic, for example, enter ?LinearAlgebra and press Enter.
The Maple help system opens in a separate window with two panes. The left pane contains the Help Navigator where
you initiate searches and browse the table of contents, and the right pane displays the final search result, such as a
specific help page.

1.6 The Maple Help System • 39

Figure 1.15: Sample Help Page

Every help page in Maple lists the command's calling sequence, parameters, and a description, with examples of thecommand at the end of the page. Some help pages also contain hyperlinks to related help pages and hyperlinks to dictionary definitions. Hyperlinks to dictionary definitions display in red to distinguish them from hyperlinks to help
pages.

Using the Help Navigator
Use the search field in the Help Navigator to find information on Maple commands and features.
• Search for a known help topic, a command name, or a keyword or phrase.
• If you have any add-on products, you can restrict the search to Maple, MapleSim, or any combination of those
products and their add-ons.

40 • 1 Getting Started• You can search all of the help system or specific Resources such as Help Pages, Tasks, Math Apps, and Manuals
by selecting the Page Types drop-down menu.
Search results are displayed as a list in the Search Results tab of the left pane. Click the Table of Contents tab toview a structured list of all topics in the help system.
Note that some tutorials open in a Maple window instead of in the Help window.
In the left pane, the type of resource is indicated by an icon. Table 1.10 describes the icons.
Table 1.10: Help Page Icons
Icon

Description
A folder icon in the Table of Contents tab indicates that a topic can be expanded into subtopics.
Question mark icon indicates a help page and displays the associated help page in the right pane when selected.
WS icon indicates an example worksheet or tutorial. These worksheets open in a new tab in the Maple document.
D icon indicates a definition and displays the associated dictionary definition in the right pane when selected.
T icon indicates a Task template and displays the associated Task Template in the right pane when selected.

Viewing Help Pages as Documents
In the help system, examples are not executable.
The Maple help system allows you to open help pages as documents that you can execute.
To open a help page as a worksheet:• With the help page displayed in the right pane of the help system, from the View menu, select Open Page as
Worksheet. A new worksheet tab opens and displays the help page as an executable document.
Alternatively, in the help system toolbar, click the open current help page in a worksheet window icon.

Viewing Examples in 2-D Math
You can choose to view the examples in most help pages in either 2-D math or 1-D Math (Maple input) mode. The
default is 2-D Math.
To change the math mode:
In the Maple help system:• From the View menu, select or clear the Display Examples with 2D math input check box.
• Click the 2-D Math icon,.

Note: Some input in help pages displays as 1-D Math, no matter which option you have chosen. This is for Maple
procedures and other code that is best input in 1-D Math. For more information, refer to the helpnavigator help page.

Copying Examples
Instead of opening the entire page as a document, you can copy the Examples section only.
To copy examples:
1. With the help page displayed in the right pane of the help system, from the Edit menu, select Copy Examples.
2. Close or minimize the Help Navigator and return to your document.
3. In your document, place the cursor at the location where you want to paste the examples.

1.7 Available Resources • 41

4. From the Edit menu, select Paste. The Examples section of the help page is inserted as executable content in yourdocument.

1.7 Available ResourcesYour work with Maple is supported by numerous resources.

Resources Available through the Maple Help System
Help Pages
Use the help system to find information about a specific topic, command, package, or feature. For more information,
see The Maple Help System (page 38).
DictionaryMore than 5000 mathematical and engineering terms with over 300 figures and plots.
1. From the Help menu, select Maple Help.
2. Enter a search term. Dictionary entries that match your query are displayed in the left pane with a

icon.

Tutorials and the Maple Portal
The Maple Portal includes material designed for all Maple users, from new users to users who want more advanced
tutorials. The Maple Portal also includes specific sections for students and engineers. The Maple Portal includes:• How Do I... topics that give quick answers to essential questions.
• Tutorials that provide an overview of topics from getting started to plotting, data manipulation, and interactive application development.
• Navigation to portals with specialized information for students and engineers.
Access the portal in the Table of Contents under Getting Started.
Applications and Example Worksheets
Applications
Sample applications demonstrate how Maple can be used to find and document a solution to a specific problem. Someapplications allow for input or contain animations that you can run; however, their primary use is for demonstrations.
Topics include Bouncing Ball, Digital Filter Design, Frequency Domain System Identification, Harmonic Oscillator,
Image Processing, Radiator Design with CAD Systems, and Sunspot Periodicity.
ExamplesExample worksheets are executable documents covering topics that demonstrate syntax or invoke a user interface tomake complex problems easy to solve and visualize. You can copy and modify the examples as needed. Topics include
Algebra, Calculus, Connectivity, Discrete Mathematics, General Numerics and Symbolics, and Integral Transforms.
• Explore the available topics in the Table of Contents under Applications and Example Worksheets.
Manuals
You can access all of Maple's manuals from within Maple, including the Maple Programming Guide and this manual.
You can execute examples, copy content into other documents, and search the contents using the Maple Help System.
• Access the manuals in the Table of Contents under Manuals.
Maple's manuals are also available as PDFs on the Maplesoft website.

42 • 1 Getting Started

http://www.maplesoft.com/documentation_center
Task Templates
Set of commands with placeholders that you can use to quickly perform a task. For details, see Task Templates (page 28).
• From the Tools menu, select Tasks, and then Browse.

Quick Reference Card
The Quick Reference Card is a table of commands and information for new users that opens in a new window. It contains
hyperlinks to help pages for more information.
• From the Help menu, select Quick Reference. Alternatively, press Ctrl + F2 (Command + F2, for Mac).

Website Resources
Student Help Center
The Student Help Center offers a Maple student forum, online math Oracles, training videos, and a math homework
resource guide.
http://www.maplesoft.com/studentcenter
Teacher Resource Center
The Teacher Resource Center is designed to ensure you get the most out of your Maple teaching experience. It provides
sample applications, course material, training videos, white papers, and tips.
http://www.maplesoft.com/TeacherResource
Application Center
Maple website resource for free applications related to mathematics, education, science, engineering, computer science,statistics and data analysis, finance, communications, and graphics. Many applications are available in translations(French, Spanish, and German).
http://www.maplesoft.com/applications
Training
Maplesoft offers a comprehensive set of complementary training materials. From complete training videos to recorded
training seminars to downloadable documentation, you have many options to get familiar with Maplesoft products. In
addition, custom training sessions can be created to meet your needs.
http://www.maplesoft.com/support/training
MaplePrimes
A web community dedicated to sharing experiences, techniques, and opinions about Maple and related products, aswell as general interest topics in math and computing.
http://www.mapleprimes.com
Online Help
All of Maple's help pages are available online.
http://www.maplesoft.com/support/help

1.7 Available Resources • 43

Technical Support
A Maple website containing FAQs, downloads and service packs, links to discussion groups, and a form for requesting
technical support.
http://www.maplesoft.com/support
For a complete list of resources, refer to the MapleResources help page.

44 • 1 Getting Started

2 Document Mode
Using the Maple software, you can create powerful interactive documents. You can visualize and animate problems
in two and three dimensions. You can solve complex problems with simple point-and-click interfaces or easy-tomodify interactive documents. You can also devise custom solutions using the Maple programming language. While
you work, you can document your process, providing text descriptions.

2.1 In This Chapter
SectionIntroduction (page 45)

Topics• Comparison of Document and Worksheet Modes

Entering Expressions (page 46) - Overview of tools for creating • Palettes
complex mathematical expressions• Symbol Names• Mathematical Functions
Evaluating Expressions (page 48) - How to evaluate expressions • Displaying the Value Inline• Displaying the Value on the Following Line
• Updating a Single Computation

Editing Expressions and Updating Output (page 49) - How to
update expressions and regenerate results• Updating a Group of Computations• Updating All Computations in a Document• Computing with Palettes

Performing Computations (page 50)- Overview of tools for
performing computations and solving problems• Context Panel• Assistants and Tutors

2.2 Introduction
Maple has two modes: Document mode and Worksheet mode.
Document mode is designed for quickly performing calculations. You can enter a mathematical expression, and thenevaluate, manipulate, solve, or plot it with a few keystrokes or mouse clicks. This chapter provides an overview ofDocument mode.
Document mode sample:
Find the value of the derivative ofIntegrateover the interval

at

.

.

=
Worksheet mode is designed for interactive use through commands and programming using the Maple language. The
Worksheet mode supports the features available in Document mode described in this chapter. For information on using
Worksheet mode, see Chapter 3, Worksheet Mode (page 57). Note: To enter a Maple input prompt while in Documentmode, click in the Maple toolbar.
Important: In any Maple document, you can use Document mode and Worksheet mode.

45

46 • 2 Document Mode

Interactive document features include:• Embedded graphical interface components, like buttons, sliders, and check boxes• Automatic execution of marked regions when a file is opened• Tables• Character and paragraph formatting styles• Hyperlinks
These features are described in Chapter 7, Creating Mathematical Documents (page 227).
Note: This chapter and Chapter 1 were created using Document mode. All of the other chapters were created using
Worksheet mode.

2.3 Entering Expressions
Chapter 1 provided an introduction to entering simple expressions in 2-D Math (see Entering Expressions (page 14)).
It is also easy to enter mathematical expressions, such as:• Piecewise-continuous functions:• Limits:• Continued fractions:and more complex expressions.
Mathematical expressions can contain the following objects.
• Numbers: integers, rational numbers, complex numbers, floating-point values, finite field elements, ,• Operators:• Constants:

/,

, ...

...

...

• Mathematical functions:• Names (variables):

...
...

• Data structures: sets, lists, Arrays, Vectors, Matrices, ...
Maple contains over a thousand symbols. For some numbers, operators, and names, you can press the corresponding
key, for example, 9, =, >, or x. Most symbols are not available on the keyboard, but you can insert them easily using
two methods, palettes and symbol names.

Example 1 - Enter a Partial Derivative
To insert a symbol, you can use palettes or symbol names.

2.3 Entering Expressions • 47

Enter the partial derivative

using palettes.

Action1. In the Calculus palette, click the partial

Result in Document

differentiation item
. Maple inserts the partial
derivative. The variable placeholder is selected.
2. Enter t, and then press Tab. The expression
placeholder is selected.
3. Enter. Note: To enter the exponential e, use
the Expression palette or the Common Symbols
palette. Here, we use thetemplate from theExpression palette.
Click the template. The exponent placeholder isselected. Enter the exponent.

To evaluate the derivative and display the result inline, press Ctrl+= (Command+=, for Macintosh) or Enter. For
more information, see Computing with Palettes (page 50).

48 • 2 Document Mode

You can enter any expression using symbol names and the symbol completion list.
ActionResult in Document
1. Begin typing the name of the symbol,
diff, and press the symbol completion
key (see Shortcut Keys by
Platform (page xiii)).

2. Select the partial differentiation item,

3. Replace the placeholder with t. Use theright arrow to move out of thedenominator. Enterprevious example.

as in theExample 2 - Define a Mathematical Function
Define the function

which doubles its input.

Action1. In the Expression palette, click the single variable
function definition item,

Result in Document.

2. Replace the placeholder f with the function name,Press Tab to move to the next placeholder.
3. Replace the parameter placeholder, a, with theindependent variable
Press Tab.
4. Replace the output placeholder, y, with the desired
output,==Note: To insert the right arrow symbol
completion is automatic.
Important: The expression, you can also enter the characters -> in Math mode. In this case, symbol

is different from the function.

For more information on functions, see Functional Operators (page 274).

2.4 Evaluating Expressions
To evaluate a mathematical expression, place the cursor in the expression and press Ctrl + = (Command + =, forMacintosh). That is, press and hold the Ctrl (or Command) key, and then press the equal sign (=) key.
To the right of the expression, Maple inserts an equal sign and then the value of the expression.

2.5 Editing Expressions and Updating Output • 49=
In mathematical content, pressing Enter evaluates the expression and displays it centered on the following line. The
cursor moves to a new line below the output.

(2.1)

By default, Maple labels output that is generated by pressing Enter. For information on equation labels, see Equation
Labels (page 70). In this manual, labels are generally not displayed.
You can use the basic algebraic operators, such as
and, with most expressions, including polynomials—see
Polynomial Algebra (page 112) and matrices and vectors—see Matrix Arithmetic (page 126).
==
Tip: The Enter key has a number of uses.
• Pressing Enter with your cursor in a math expression executes it and evaluates it on a new line.
• Pressing Enter in text inserts a line break.
• Pressing Enter when at the beginning of a line (the Home position) inserts a new line above the current line.
For more information on these concepts, refer to the Using Document Blocks help page.
Tip: If you want to change an input/output expression from evaluate and display inline to evaluate and display on a
new line, with your cursor in the input expression, from the Evaluate menu or the Context Panel, clear the check box
beside Evaluate and Display Inline.

2.5 Editing Expressions and Updating Output
One important feature of Maple is that your documents are live. That is, you can edit expressions and quickly recalculate
results.
To update one computation:
1. Edit the expression.
2. Press Ctrl + = (Command + =, for Macintosh) or Enter.
The result is updated.
To update a group of computations:
1. Edit the expressions.
2. Select all edited expressions and the results to recalculate.
3. Click the Execute toolbar icon
All selected results are updated.

.

50 • 2 Document Mode

To update all output in a Maple document:• Click the Execute All toolbar icon.

All results in the document are updated.
Note: Be careful when you revisit a document and make changes, as it's possible to produce a document with worksheetcommands out of order (i.e. where a certain command won't work properly without a later one).

2.6 Performing Computations
Using the Document mode, you can access the power of the advanced Maple mathematical engine without learning
Maple syntax. In addition to solving problems, you can also easily plot expressions.
The primary tools for syntax-free computation are:
• Palettes• The Context Panel• Assistants and tutors
Note: The Document mode is designed for quick calculations, but it also supports Maple commands. For informationon commands, see Commands (page 59) in Chapter 3, Worksheet Mode (page 57).
Important: In Document mode, you can execute a statement only if you enter it in Math mode. To use a Maple command,
you must enter it in Math mode.

Computing with Palettes
As discussed in Entering Expressions (page 46), some palettes contain mathematical operations.
To perform a computation using a palette mathematical operation:
1. In a palette that contains operators, such as the Expression or Calculus palettes, click an operator item.
2. In the inserted item, specify values in the placeholders.
3. To execute the operation and display the result, press Ctrl+= (Command+=, for Macintosh) or Enter.
For example, to evaluate

inline:1. Using the Calculus palette, enter the partial derivative. See Example 1 - Enter a Partial Derivative (page 46).
2. Press Ctrl+= (Command+=, for Macintosh).
=Computing with the Context Panel
The context panel is a collection of tools and operations that are appropriate for a particular expression. The context
panel changes according to the expression, table, or region that you click on. See Figure 2.1.

2.6 Performing Computations • 51

Figure 2.1: Context Panel

To display the context panel:
1. Click the expression.
2. Move your mouse cursor over Pin Open Context Panel (), or click it to fix the context panel in place.

The context panel is displayed.

You can evaluate expressions using context panel options. The Evaluate and Display Inline operation (see Figure 2.1)
is equivalent to pressing Ctrl+= (Command+=, for Macintosh). That is, it inserts an equal sign (=) and then the valueof the expression.
Alternatively, press Enter to evaluate the expression and display the result centered on the following line.
For more information on evaluation, see Evaluating Expressions (page 48).

52 • 2 Document Mode

From the context panel, you can also select operations different from evaluation. To the right of the expression, Maple
inserts a right arrow symbol (→) and then the result.
For example, use the Approximate operation to approximate a fraction:
You can perform a sequence of operations by repeatedly using context panel options. For example, to compute thederivative ofuse the Differentiate operation on the expression, and then to evaluate the result at a point,
use the Evaluate at a Point operation on the output and enter 10:

Note: For the sequence of operations to make sense when being read from left to right, stale results are deleted before
new operations are performed.
For example:
Enter the expression.

Click on the expression and use the Differentiate option fromthe context panel to differentiate with respect to x.
Click on 2x and use the Integrate option from the context panel
to integrate with respect to x.
Click on 2x again and use the Differentiate option to differentiatewith respect to x.
Notice how the result of integration with respect to x has been
replaced with the result of differentiation with respect to x so thatthe sequence of operations makes sense.

The following subsections provide detailed instructions on performing a few of the numerous operations available using
context-sensitive operations in the context panel.
Approximating the Value of an Expression
To approximate a fraction numerically:
1. Enter a fraction.
2. Click the fraction to display the context panel. See Figure 2.2.
3. From the context panel, select Approximate, and then the number of significant digits to use: 5, 10, 20, 50, or 100.

2.6 Performing Computations • 53

Figure 2.2: Approximating the Value of a Fraction

You can replace the inserted right arrow with text or mathematical content.
To replace the right arrow ():

1. Select the arrow and text. Press Delete.
2. Enter the replacement text or mathematical content.
Note: To replace the right arrow with text, you must first press F5 to switch to Text mode.
For example, you can replace the arrow with the text "is approximately equal to" or the symbol ≈.

Solving an Equation
You can find an exact (symbolic) solution or an approximate (numeric) solution of an equation. For more information
on symbolic and numeric computations, see Symbolic and Numeric Computation (page 76).
To solve an equation:
1. Enter an equation.
2. Display the context panel. See Figure 2.3.
3. From the context panel, select Solve or Numerically Solve in the Solve menu item.

54 • 2 Document Mode

Figure 2.3: Finding the Approximate Solution to an Equation

For more information on solving equations, including solving inequations, differential equations, and other types ofequations, see Solving Equations (page 82).
Using Units
You can create expressions with units. To specify a unit for an expression, use the Units palette. See Figure 2.4.

Figure 2.4: Units Palette

To insert an expression with a unit:
1. Enter the expression.
2. In a unit palette, click a unit symbol.
Note: To include a reciprocal unit, divide by the unit.

2.6 Performing Computations • 55

To evaluate an expression that contains units:
1. Enter the expression using the units palettes to insert units.
2. Click the expression.
3. From the context panel, select the Simplify menu and then Simplify.
For example, compute the electric current passing through a wire that conducts 590 coulombs in 2.9 seconds.

For more information on using units, see Units (page 95).

Assistants and Tutors
Assistants and tutors provide point-and-click interfaces with buttons, text input regions, and sliders. For details on assistants and tutors, see Point-and-Click Interaction (page 24).
Assistants and tutors can be launched from the Tools menu or the Context Panel for an expression. For example, you
can use the Linear System Solving tutor to solve a linear system, specified by a matrix or a set of equations.
Example 3 - Using the Context Panel to Open the Linear System Solving Tutor
Use the Linear System Solving tutor to solve the following system of linear equations, written in matrix form:

ActionResult in Document
1. In a new document block, create the matrix or setof linear equations to be solved.

2. Load the Student[LinearAlgebra] package. From Loading Student:-LinearAlgebra
the Tools menu, select Load Package → Student
Linear Algebra. This makes the tutors in thatpackage available. For details, see Package
Commands (page 34).
3. Click the matrix and from the context panel selectStudent Linear Algebra → Tutors → Linear
System Solving.... The Linear System Solving
dialog appears, where you can choose the solving
method. Gaussian Elimination reduces the matrix
to row-echelon form, then performs
back-substitution to solve the system. Gauss
Jordan Elimination reduces the matrix to reduced
row-echelon form, where the equations are alreadysolved. For this example, choose Gaussian
Elimination.

56 • 2 Document Mode

ActionResult in Document
4. The Gaussian Elimination dialog opens. You canspecify the Gaussian elimination step-by-step, or
you can use the Next Step or All Steps buttons tohave Maple perform the steps for you.
5. Once the matrix is in row-echelon(upper-triangular) form, click the Solve Systembutton to move to the next step.

6. The Solve the system of equations in
Row-Echelon Form dialog appears. Click the
buttons on the right to calculate the solution: firstfind the Equations, then solve for each variable.
Click the Solution button to display the solution
in the tutor.

7. Click the Close button to return the solution to
your document.

For more information on linear systems and matrices, see Linear Algebra (page 118).

3 Worksheet Mode
The Worksheet mode of the Standard Worksheet interface is designed for:• Interactive use through Maple commands, which offers advanced functionality and customized control not available
using the context panel or other syntax-free methods• Programming using the powerful Maple language
Using Worksheet mode, you have access to all of the Maple features described in Chapter 1, and most of those describedin Chapter 2, including:• Math and Text modes• Palettes• The context panel• Assistants and tutors
For information on these features, see Chapter 1, Getting Started (page 1) and Chapter 2, Document Mode (page 45).
Note: Using a document block, you can use all Document mode features in Worksheet mode. For information on
document blocks, see Document Blocks (page 36).
Note: This chapter and the following chapters except Chapter 7 were created using Worksheet mode.

3.1 In This Chapter
SectionInput Prompt (page 58) - Where you enter input

Topics• The Input Prompt (>)• Suppressing Output• 2-D and 1-D Math Input• Input Separators

Commands (page 59)- Thousands of routines for performing
computations and other operations• The Maple Library• Top-Level Commands• Mathematical Functions• Package Commands• Lists of Common Commands and Packages• Using Palettes
Palettes (page 63) - Items that you can insert by clicking or
dragging• Using the Context Panel
The Context Panel (page 65)- Clickable access to common
operations
Assistants and Tutors (page 66)- Graphical interfaces with buttons • Launching Assistants and Tutors
and sliders
Task Templates (page 66) - Sets of commands with placeholders • Viewing Task Templates
that you can insert and use to perform a task
• Inserting a Task Template• Performing the Task
Text Regions (page 67) - Areas in the document in which you
can enter text

• Inserting a Text Region• Formatting Text57

58 • 3 Worksheet Mode

SectionTopicsNames (page 68) - References to the expressions you assign to • Assigning to Namesthem• Unassigning Names• Valid Names
Equation Labels (page 70) - Automatically generated labels that • Displaying Equation Labels
you can use to refer to expressions• Referring to a Previous Result• Execution Groups with Multiple Outputs• Label Numbering Schemes• Features of Equation Labels

3.2 Input Prompt
In Worksheet mode, you enter input at the Maple input prompt ( ). The default mode for input is Math mode (2-D
Math).
To evaluate input:• Press Enter.
Maple displays the result (output) below the input.
For example, to find the value of, enter the expression, and then press Enter.

>
(3.1)

For example, compute the sum of two fractions.
>(3.2)

A set of Maple input and its output are referred to as an execution group.
In the worksheet, the semicolon as a statement terminator is optional.

Suppressing Output
To suppress the output, enter a colon (:) at the end of the input.
>

1-D Math Input
You can also insert input using 1-D Math mode. The input is entered as a one-dimensional sequence of characters. 1D Math input is red.

3.3 Commands • 59

To enter input using 1-D Math:• At the input prompt, press F5 or click the Text button in the context bar,Math.

, to switch from 2-D Math to 1-D> 123^2 - 29857/120;

As with 2-D math, in 1-D math, if you use a colon, Maple suppresses the output.
>
To set the default input mode at a prompt to 1-D Math:
1. From the Tools menu, select Options. The Options dialog is displayed.
2. On the Display tab, in the Input display drop-down list, select Maple Notation.
3. Click Apply to Session (to set for only the current session) or Apply Globally (to set for all Maple sessions).
To convert between 2-D Math input and 1-D Math input:
1. Select the 2-D (or 1-D) Math input.
2. From the Format menu, select Convert To, and then 1-D Math Input (or 2-D Math Input).

Input Separators
In 1-D and 2-D Math input, you can use a semicolon or colon to separate multiple inputs in the same input line.
> sqrt(4.4); tan(3.2);

If you do not specify a semicolon or colon, Maple interprets it as a single input. This can either give unexpected results
or an error. Notice that the following example gives an error in 1-D math but in 2-D math this is interpreted as multiplication.
> sqrt(4.4) tan(3.2)
Error, missing operator or `;`>3.3 Commands
Maple contains a large set of commands and a powerful programming language. Most Maple commands are written
using the Maple programming language.
You can enter commands using 1-D or 2-D Math. 1-D Math input is recommended when programming in Maple. Basic
Programming (page 293) provides an introduction to Maple programming.
To learn how to use Maple commands, see the appropriate help page, or use task templates. For more information, see
The Maple Help System (page 38) and Task Templates (page 66).

60 • 3 Worksheet Mode

The Maple Library
Maple's commands are contained in the Maple library. There are two types of commands: top-level commands andpackage commands.
• The top-level commands include many of the most frequently used Maple commands, as well as an extensive listof mathematical functions.
• Packages contain related specialized commands in areas such as calculus, linear algebra, vector calculus, and code
generation.
For a complete list of packages and commands, refer to the index/help help pages. For information on the Maple Help
System, see The Maple Help System (page 38).

Top-Level Commands
To use a top-level command, enter its name followed by parentheses (( )) containing any parameters. This is referred
to as a calling sequence for the command.
command(arguments)

Note: In 1-D Math input, include a semicolon or colon at the end of the calling sequence.
For example, to differentiate an expression, use the diff command. The required parameters are the expression to differentiate, which must be specified first, and the independent variable.
>

Mathematical Functions
For a complete list of commands that implement mathematical functions, such as BesselI and AiryAi, available in thelibrary, refer to the initialfunctions help page.
>

For detailed information on the properties of a function, use the FunctionAdvisor command.
>

This definition is displayed using the typeset form of the BesselI function, the hypergeometric function (hypergeom)
and the Gamma function (GAMMA). To see the function names rather than the typeset form, use lprint:>[BesselI(a, z) = z^a*hypergeom([], [a+1], (1/4)*z^2)/(GAMMA(a+1)*2^a), `with no restrictions
on `(a, z)]

For detailed information on how to use a function in Maple, refer to its help page.

3.3 Commands • 61

For example:>
Another way to access help is to select the word for which you want help and use the shortcut key for context help, F2(Control + Shift + ?, for Mac).
Top Commands
Here are a few of the most frequently used Maple commands. A complete list of top-level commands is available on
the index/function help page.
Table 3.1: Top Commands
Command Nameplot and plot3d
solve
fsolveeval
evalf
dsolve
int
diff
limit
sum
assume/is
assuming
simplify
factorexpandnormalconverttype

seriesmap

Description
Create a two-dimensional and three-dimensional plot of functions.
Solve one or more equations or inequalities for their unknowns.
Solve one or more equations using floating-point arithmetic.
Evaluate an expression at a given point.
Numerically evaluate expressions.
Solve ordinary differential equations (ODEs).
Compute an indefinite or definite integral.
Compute an ordinary or partial derivative, as the context dictates.
Calculate the limiting value of a function.
For symbolic summation. It is used to compute a closed form for an indefinite or definite sum.
Set variable properties and relationships between variables. Similar functionality is provided by theassuming command.
Compute the value of an expression under assumptions.
Apply simplification rules to an expression.
Factor a polynomial.
Distribute products over sums.
Normalize a rational expression.
Convert an expression to a different type or form.
Type-checking command. In many contexts, it is not necessary to know the exact value of an
expression; it suffices to know that an expression belongs to a broad class, or group, of expressions
that share some common properties. These classes or groups are known as types.
Generalized series expansion.
Apply a procedure to each operand of an expression.

Package Commands
To use a package command, the calling sequence must include the package name, and the command name enclosed
in square brackets ([ ]).
package[command](arguments)

If you are frequently using the commands in a package, load the package.
To load a package:• Use the with command, specifying the package as an argument.
The with command displays a list of the package commands loaded (unless you suppress the output by entering a colonat the end of the calling sequence).

62 • 3 Worksheet Mode

After loading a package, you can use the short form names of its commands. That is, you can enter the commands
without specifying the package name.
For example, use the NLPSolve command from the Optimization package to find a local minimum of an expression
and the value of the independent variable at which the minimum occurs.
>>>

For more information on optimization, see Optimization (page 140).
To unload a package:• Use the unwith command, specifying the package as an argument.
>
Alternatively, use the restart command. The restart command clears Maple's internal memory. The effects include
unassigning all names and unloading all packages. For more information, refer to the restart help page.
Note: To execute the examples in this manual, you may be required to use the unassign or restart command between
examples.
Some packages contain commands that have the same name as a top-level command. For example, the plots package
contains a changecoords command. Maple also contains a top-level changecoords command.
>
After the plots package is loaded, the name changecoords refers to the plots[changecoords] command. To use the
top-level changecoords command, unload the package or use the restart command. (For alternative methods of accessing
the top-level command, see the rebound help page.)
Top Packages
Here are a few of the most frequently used Maple packages. A complete list of packages is available on the index/package help page.
Table 3.2: Top Packages
Package Name
CodeGeneration

LinearAlgebra

Description
The Code Generation package is a collection of commands and subpackages that enable thetranslation of Maple code to other programming languages, such as C, C#, Fortran, MATLAB®,
Visual Basic®, JavaTM, Julia, Perl, and Python®.
The Linear Algebra package contains commands to construct and manipulate Matrices andVectors, and solve linear algebra problems. LinearAlgebra routines operate on three principal
data structures: Matrices, Vectors, and scalars.

3.4 Palettes • 63

Package Name
Optimization

Physics
RealDomain
ScientificConstants

ScientificErrorAnalysis

Statistics

Student

Description
The Optimization package is a collection of commands for numerically solving optimization
problems, which involve finding the minimum or maximum of an objective function possibly
subject to constraints.
The Physics package implements computational representations and related operations for mostof the objects used in mathematical physics computations.
The Real Domain package provides an environment in which Maple assumes that the basic
underlying number system is the field of real numbers instead of the complex number field.
The Scientific Constants package provides access to the values of various physical constants,
for example, the velocity of light and the atomic weight of sodium. This package provides theunits for each of the constant values, allowing for greater understanding of an equation. The
package also provides units-matching for error checking of the solution.
The Scientific Error Analysis package provides representation and construction of numericalquantities that have a central value and an associated uncertainty (or error), which is a measureof the degree of precision to which the quantity's value is known. Various first-order calculationsof error analysis can be performed with these quantities.
The Statistics package is a collection of tools for mathematical statistics and data analysis. The
package supports a wide range of common statistical tasks such as quantitative and graphicaldata analysis, simulation, and curve fitting.
The Student package is a collection of subpackages designed to assist with teaching and learning
standard undergraduate mathematics. The many commands display functions, computations, andtheorems in various ways, including stepping through important computations.

The Student package contains the following subpackages:• Basics - fundamental math concepts• Calculus1 - single-variable calculus• LinearAlgebra - linear algebra• MultivariateCalculus - multivariate calculus• NumericalAnalysis - numerical analysis• Precalculus - precalculus• Statistics - statistics• VectorCalculus - multivariate vector calculus
Units

VectorCalculus

The Units package contains commands for unit conversion and provides environments for
performing calculations with units. It accepts approximately 300 distinct unit names (for example,
meters and grams) and over 550 units with various contexts (for example, standard miles andU.S. survey miles). Maple also contains two Units palettes that allow you to enter the unit foran expression quickly.
The Vector Calculus package is a collection of commands that perform multivariate and vector
calculus operations. A large set of predefined orthogonal coordinate systems is available. All
computations in the package can be performed in any of these coordinate systems. It contains afacility for adding a custom but orthogonal coordinate system and using that new coordinate
system for your computations.

3.4 Palettes
Palettes are collections of related items that you can insert by clicking or dragging. For example, see Figure 3.1.

64 • 3 Worksheet Mode

Figure 3.1: Calculus Palette

You can use palettes to enter input.

For example, evaluate a definite integral using the definite integration itemin the Calculus palette.

In 2-D Math, clicking the definite integration item inserts:>

1. Enter values in the placeholders. To move to the next placeholder, press Tab.
2. To evaluate the integral, press Enter.
>In 1-D Math, clicking the definite integration item inserts the corresponding command calling sequence.
> int(f,x=x[1]..x[2]);Specify the problem values (using the Tab to move to the next placeholder), and then press Enter. Note: If pressing
the Tab key inserts a tab, under the Format menu, toggle Tab Navigation. Then the Tab key will move the cursor to
the next placeholder.
> int(tanh(x), x = 0..1);

Note: Some palette items cannot be inserted into 1-D Math because they are not defined in the Maple language. Whenthe cursor is in 1-D Math input, unavailable palette items are dimmed.
For more information on viewing and using palettes, see Palettes (page 15) in Chapter 1.

3.5 The Context Panel • 65

3.5 The Context Panel
The context panel is a collection of tools and operations that are appropriate for a particular expression. The context
panel changes according to the expression, table, or region that you click on. See Figure 3.2.

Figure 3.2: Integer Context Panel

You can use the context panel to perform operations on 2-D Math, including output.
To use the context panel:
1. Click the expression.
2. Move your mouse cursor over Pin Open Context Panel (), or click it to fix the context panel in place.

3. From the context panel, select a tool or operation.
Maple inserts a new execution group containing:• The calling sequence that performs the operation• The result of the operation

Example - Using the Context Panel
Determine the rational expression (fraction) that approximates the floating-point number
Action1. Enter and execute the expression.

.

Result in Document

>
(3.3)

2. Click the output floating-point number.

3. From the context panel, select Conversions → Rational. The >inserted calling sequence includes an equation label reference
to the number you are converting.

Notice that an equation label reference has been used. For information on equation labels and equation label references,
see Equation Labels (page 70).

66 • 3 Worksheet Mode

For more information on the Context Panel, see Computing with the Context Panel (page 50) in Chapter 2.

3.6 Assistants and Tutors
Assistants and tutors provide point-and-click interfaces with buttons, text input regions, and sliders. See Figure 3.3.

Figure 3.3: ODE Analyzer AssistantLaunching an Assistant or Tutor
To launch an assistant or tutor:
1. Open the Tools menu.
2. Select Assistants or Tutors.
3. Navigate to and select one of the assistants or tutors.
For more information on assistants and tutors, see Assistants (page 24) in Chapter 1.

3.7 Task Templates
Maple can solve a diverse set of problems. The task template facility helps you quickly find and use the commands
required to perform common tasks.
After inserting a task template, specify the parameters of your problem in the placeholders, and then execute the commands, or click a button.
The Task Browser (Figure 3.4) organizes task templates by subject.
To launch the Task Browser:• From the Tools menu, select Tasks, and then Browse.
You can also browse the task templates in the Table of Contents of the Maple Help System.

3.8 Text Regions • 67

Figure 3.4: Task Browser

For details on inserting and using task templates, see Task Templates (page 28). You can also create your own task
templates for performing common tasks. For details, refer to the creatingtasks help page.

3.8 Text Regions
To add descriptive text in Worksheet mode, use a text region.
To insert a text region:• In the toolbar, click the Text region icon
The default mode in a text region is Text mode.

.

68 • 3 Worksheet Mode

In a text region, you can:
• Enter text with inline mathematical content by switching between Text and Math modes. To toggle between Text
mode and Math mode, press F5 or click the Math and Text toolbar icons,
Note: To change a math region to nonexecutable mathematical content, use Shift + F5.
• Insert any palette item. Palette items are inserted in Math mode (2-D Math). Note: After you insert a palette item,
you must press F5 or click the toolbar icon to return to Text mode.
You can format text in a text region. Features include:• Character styles• Paragraph styles• Sections and subsections• TablesFor more information on formatting documents, see Creating Mathematical Documents (page 227).

3.9 Names
Instead of re-entering an expression every time you need it, you can assign it to a name or add an equation label to it.
Then you can quickly refer to the expression using the name or an equation label reference. For information on labels,
see the following section, Equation Labels (page 70).
Note: Through the Variable Manager you can manage the top-level assigned variables currently active in your Maple
Session. For more information about the Variable Manager, see the Variable Manager help page. For Maple workbooks,
you can use the Variable Manager palette to return to the saved state of your variables.

Assigning to Names
You can assign any Maple expression to a name: numeric values, data structures, procedures (a type of Maple program),and other Maple objects.
Initially, the value of a name is itself.
>

The assignment operator (:=) associates an expression with a name.
>Recall that you can enterusing the following two methods.

• Use the Common Symbols palette.
• In 2-D Math enter pi, and then press the symbol completion shortcut key. See Shortcuts for Entering Mathematical
Expressions (page 5).

3.9 Names • 69

When Maple evaluates an expression that contains a name, it replaces the name with its value. For example:>

For information on Maple evaluation rules, see Evaluating Expressions (page 285).
Mathematical Functions
To define a function, assign it to a name.
For example, define a function that computes the cube of its argument.
>
For information on creating functions, see Example 2 - Define a Mathematical Function (page 48).
>

Note: To insert the right arrow, enter the characters ->. In 2-D Math, Maple replaces -> with the right arrow symbol
In 1-D Math, the characters are not replaced.
For example, define a function that squares its argument.
> square := x -> x^2:
> square(32);For more information on functions, see Functional Operators (page 274).
Protected Names
Protected names are valid names that are predefined or reserved.
If you attempt to assign to a protected name, Maple returns an error.
>
Error, attempting to assign to `sin` which is protected.
?protect for details.

Try declaring `local sin`; see

For more information, refer to the type/protected and protect help pages.

Unassigning Names
To unassign a name, reset the value of a name to itsef. Right single quotes (unevaluation quotes) prevent Maple from
evaluating the name.
>>
You can also use the unassign command. You must enclose the name in right single quotes (' ').

70 • 3 Worksheet Mode>>

For more information on the uses of unevaluation quotes, see Delaying Evaluation (page 291) or refer to the uneval
help page.
Unassigning all names:
The restart command clears Maple's internal memory. The effects include unassigning all names. For more information,refer to the restart help page.
Note: To execute the examples in this manual, you may be required to use the unassign or restart command between
examples.

Valid Names
A Maple name must be one of the following.
• A sequence of alphanumeric and underscore (_) characters that begins with an alphabetical character.
• A sequence of characters enclosed in left single quotes (` `).
Important: Do not begin a name with an underscore character. Maple reserves names that begin with an underscore
for use by the Maple library.
Examples of valid names:• a• a1• polynomial• polynomial1_divided_by_polynomial2• `2a`• `x y`3.10 Equation Labels
Maple marks the output of each execution group with a unique equation label.
Note: The equation label is displayed to the right of the output.
>(3.4)

Using equation labels, you can refer to the result in other computations.
>(3.5)

3.10 Equation Labels • 71

Displaying Equation Labels
Important: By default, equation labels are displayed. If equation label display is turned off, complete both of thefollowing operations.
• From the Format menu, select Equation Labels, and then ensure that Worksheet is selected.
• In the Options dialog (Tools→Options), on the Display tab, ensure that Show equation labels is selected.

Inserting Equation Labels
Instead of re-entering previous results in computations, you can use equation label references. Each time you need torefer to a previous result, insert an equation label reference.
You can insert equation labels by:• Positioning your cursor where you want to insert the equation label, then double-click on the equation label you
want to insert.
• Using the Label option from the Insert menu (or using the CTRL+L shortcut keys).
Insert an equation label reference using the double-click method:
1. Position your cursor where you want to insert the equation label.

2. Double-click on the equation label you want to insert into your expresion.

3. The equation label is inserted into the expression at the location you selected.

Insert an equation label reference using the Insert menu:
1. From the Insert menu, select Label. Alternatively, double-click on the equation label (to the far right side of theoutput) or press Ctrl+L; Command+L, Macintosh.

72 • 3 Worksheet Mode

2. In the Insert Label dialog (see Figure 3.5), enter the label value, and then click OK.

Figure 3.5: Insert Label Dialog

Maple inserts the reference.

To integrate the product of (3.4) and (3.5):
Action1. In the Expression palette, click the indefinite integration item
. The item is inserted and the integrand placeholder ishighlighted.
2. Press Ctrl+L (Command+L, for Macintosh).
3. In the Insert Label dialog, enter 3.4. Click OK.

4. Press *.
5. Press Ctrl+L (Command+L, for Macintosh).
6. In the Insert Label dialog, enter 3.5. Click OK.

Result in Document

3.10 Equation Labels • 73

Action
7. To move to the variable of integration placeholder, press Tab.

Result in Document>

8. Enter x.
9. To evaluate the integral, press Enter.

(3.6)

Execution Groups with Multiple Outputs
An equation label is associated with the last output within an execution group.
>

(3.7)

>
(3.8)

Label Numbering Schemes
You can number equation labels in two ways:• Flat - Each label is a single number, for example, 1, 2, or 3.
• Sections - Each label is numbered according to the section in which it occurs. For example, 2.1 is the first equationin the second section, and 1.3.2 is the second equation in the third subsection of the first section.
To change the equation label numbering scheme:• From the Format menu, select Equation Labels → Label Display. In the Format Labels dialog (Figure 3.6), selectone of the formats.
• Optionally, enter a prefix.

Figure 3.6: Format Labels Dialog: Adding a Prefix

Features of Equation Labels
Although equation labels are not descriptive names, labels offer other important features.

74 • 3 Worksheet Mode

• Each label is unique, whereas a name may be inadvertently assigned more than once for different purposes.
• Maple labels the output values sequentially. If you remove or insert an output, Maple automatically re-numbers all
equation labels and updates the label references.
• If you change the equation label format (see Label Numbering Schemes (page 73)), Maple automatically updates
all equation labels and label references.
For information on assigning to, using, and unassigning names, see Names (page 68).
For more information on equation labels, refer to the equationlabels help page.
The following chapters describe how to use Maple to perform tasks such as solving equations, producing plots andanimations, and creating mathematical documents. The chapters were created using Worksheet mode. Except where
noted, all features are available in both Worksheet mode and Document mode.

4 Basic Computations
This chapter discusses key concepts related to performing basic computations with Maple. It discusses important featuresthat are relevant to all Maple users. After learning about these concepts, you will learn how to use Maple to solve
problems in specific mathematical disciplines in the following chapter.

4.1 In This Chapter
SectionTopicsSymbolic and Numeric Computation (page 76)- An overview of • Exact Computations
exact and floating-point computation• Floating-Point Computations• Converting Exact Quantities to Floating-Point Values• Sources of Error
Integer Operations (page 78) - How to perform integer
computations• Important Integer Commands• Non-Base 10 Numbers• Finite Rings and Fields• Gaussian Integers

Solving Equations (page 82) - How to solve standard
mathematical equations• Equations and Inequations• Ordinary Differential Equations• Partial Differential Equations• Integer Equations• Integer Equations in a Finite Field• Linear Systems• Recurrence Relations

Units, Scientific Constants, and Uncertainty (page 95) - How to Units
construct and compute with expressions that have units, scientific• Conversions
constants, or uncertainty• Applying Units to an Expression• Performing Computations with Units• Changing the Current System of Units• Extensibility

Scientific Constants• Scientific Constants• Element and Isotope Properties• Value, Units, and Uncertainty• Performing Computations• Modification and Extensibility

Uncertainty Propagation• Quantities with Uncertainty• Performing Computations with Quantities with Uncertainty75

76 • 4 Basic Computations

SectionTopicsRestricting the Domain (page 105) - How to restrict the domain • Real Number Domain
for computations• Assumptions on Variables

4.2 Symbolic and Numeric Computation
Symbolic computation is the mathematical manipulation of expressions involving symbolic or abstract quantities, suchas variables, functions, and operators; and exact numbers, such as integers, rationals, , andThe goal of suchmanipulations may be to transform an expression to a simpler form or to relate the expression to other, better understoodformulas.
Numeric computation is the manipulation of expressions in the context of finite-precision arithmetic. Expressions involving exact numbers, for example,
are replaced by close approximations using floating-point numbers, forexample 1.41421. These computations generally involve some error. Understanding and controlling this error is often
of as much importance as the computed result.
In Maple, numeric computation is normally performed if you use floating-point numbers (numbers containing adecimal point) or the evalf command. The plot command (see Plots and Animations (page 187)) uses numeric computation, while commands such as int, limit, and gcd (see Integer Operations (page 78) and Mathematical Problem
Solving (page 111)) generally use only symbolic computation to achieve their results.

Exact Computations
In Maple, integers, rational numbers, mathematical constants such as

and ∞, and mathematical structures such as

matrices with these as entries are treated as exact quantities. Names, such as
and mathematical
functions, such as
andare symbolic objects. Names can be assigned exact quantities as
their values, and functions can be evaluated at symbolic or exact arguments.
>

Important: Unless requested to do otherwise (see the following section), Maple evaluates expressions containing exact
quantities to exact results, as you would do if you were performing the calculation by hand, and not to numeric approximations, as you normally obtain from a standard hand-held calculator.
>>>

4.2 Symbolic and Numeric Computation • 77

Floating-Point Computations
In some situations, a numeric approximation of an exact quantity is required. For example, the plot command requires
the expression it is plotting to evaluate to numeric values that can be rendered on the screen:butpoint:

cannot be so rendered,can be. Maple distinguishes approximate from exact quantities by the presence or absence of a decimal
is approximate, while

is exact.

Note: An alternative representation of floating-point numbers, called e-notation, may not include an explicit decimal
point: 1e5, 3e-2.
In the presence of a floating-point (approximate) quantity in an expression, Maple generally computes using numeric
approximations. Arithmetic involving mixed exact and floating-point quantities results in a floating-point result.
>

If a mathematical function is passed a floating-point argument, it normally attempts to produce a floating-point approximation of the result.
>Converting Exact Quantities to Floating-Point Values
To convert an exact quantity to a numeric approximation of that quantity, use the evalf command or the Approximate
context panel operation (see Approximating the Value of an Expression (page 52)).
>

By default, Maple computes such approximations using 10 digit arithmetic. You can modify this in one of two ways:• Locally, you can pass the precision as an index to the evalf call.
>• Globally, you can set the value of the Digits environment variable.
>>• Set the value back to the default Digits level:78 • 4 Basic Computations>
For more information, see the evalf and Digits help pages.
Note: When appropriate, Maple performs floating-point computations directly using your computer's underlying
hardware.

Sources of Error
By its nature, floating-point computation normally involves some error. Controlling the effect of this error is the subjectof active research in Numerical Analysis. Some sources of error are:
• An exact quantity may not be exactly representable in decimal form:

andare examples.

• Small errors can accumulate after many arithmetic operations.
• Subtraction of nearly equal quantities can result in essentially no useful information. For example, consider thecomputationfor>

No correct digits remain. If, however, you use Maple to analyze this expression, and replace this form with a representation that is more accurate for small values ofa fully accurate 10-digit result can be obtained.
>>

For information on evaluating an expression at a point, see Substituting a Value for a Subexpression (page 285). For
information on creating a series approximation, see Series (page 136). For more information on floating-point numbers,
refer to the float and type/float help pages.

4.3 Integer Operations
In addition to the basic arithmetic operators, Maple has many specialized commands for performing more complicatedinteger computations, such as factoring an integer, testing whether an integer is a prime number, and determining thegreatest common divisor (GCD) of a pair of integers.
Note: Many integer operations are available as task templates (Tools→Tasks→Browse, under Integers).
You can quickly perform many integer operations using the context panel. Clicking on an integer displays the context
panel with integer commands. For example, the context-sensitive operation Integer Factors applies the ifactor command
to compute the prime factorization of the given integer. See Figure 4.1.

4.3 Integer Operations • 79

Figure 4.1: Context Panel for an Integer

The result of applying Integer Factors is shown:
>
(4.1)

>
(4.2)

Maple inserts the command ifactor, using an equation label reference to the integer 946929. For more information onequation labels, see Equation Labels (page 70).
For more information on using context-sensitive operations in Worksheet mode, see The Context Panel (page 65). For
information on using context-sensitive operations in Document mode, see Computing with the Context Panel (page 50).
Maple has many other integer commands, including those listed in Table 4.1.
Table 4.1: Select Integer Commands
Commandabs

Description

factorial

factorial (displays in 2-D math as)prime factorization
greatest common divisor
quotient of integer division
remainder of integer division
integer approximation of nth root
test primality
integer approximation of square root
maximum and minimum of a set
modular arithmetic (See Finite Rings and Fields (page 80).)set of positive divisors

ifactor
igcd
iquo
irem
iroot
isprimeisqrt
max, minmod
NumberTheory[Divisors]absolute value (displays in 2-D math as)80 • 4 Basic Computations

>

>

>

>

For information on finding integer solutions to equations, see Integer Equations (page 94).

Non-Base 10 Numbers and Other Number Systems
Maple supports:• Non-base 10 numbers• Finite ring and field arithmetic• Gaussian integers
Non-Base 10 Numbers
To represent an expression in another base, use the convert command.
>>

For information on enclosing keywords in right single quotes ('), see Delaying Evaluation (page 291).
You can also use the convert/base command.
>

Note: The convert/base command returns a list of digit values in order of increasing significance.
Finite Rings and Fields
Maple supports computations over the integers modulo m.
The mod operator evaluates an expression over the integers modulo m.

4.3 Integer Operations • 81>

By default, the mod operator uses positive representation (modp command). Symmetric representation is available
using the mods command.
>>

For information on setting symmetric representation as the default, refer to the mod help page.
The modular arithmetic operators are listed in Table 4.2.
Table 4.2: Modular Arithmetic Operators
Operation
Addition

Operator+

Subtraction-

Multiplication (displays in 2-D Math as)Multiplicative inverse (displays in 2-D Math as asuperscript)

Division (displays in 2-D Math as

Exponentiation1)

Example

>

>

>

^(-1)

/

&^

>

>

>

1

To enter a caret (^) in 2-D Math, enter a backslash character followed by a caret, that is, \^.

For information on solving an equation modulo an integer, see Integer Equations in a Finite Field (page 94).
The mod operator also supports polynomial and matrix arithmetic over finite rings and fields. For more information,refer to the mod help page.
Gaussian Integers
Gaussian integers are complex numbers in which the real and imaginary parts are integers.
The GaussInt package contains commands that perform Gaussian integer operations.
The GIfactor command returns the Gaussian integer factorization.

82 • 4 Basic Computations>

In Maple, complex numbers are represented as a+b I, where the uppercase I represents the imaginary unit.

You can also enter the imaginary unit using the following two methods.
• In the Common Symbols palette, click the ,oritem. See Palettes (page 15).

• Enter i or j, and then press the symbol completion key. See Symbol Names (page 21).
Note that the output will still be displayed with I, no matter what symbol was used for input. You can customize Maple's
settings to use a different symbol for. For more information on entering complex numbers, including how tocustomize this setting, refer to the HowDoI/EnterAComplexNumber help page.
The GIsqrt command approximates the square root in the Gaussian integers.
>

For more information on Gaussian integers including a list of GaussInt package commands, refer to the GaussInt
help page.

4.4 Solving Equations
You can solve a variety of equation types, including those described in Table 4.3.
Table 4.3: Overview of Solution Methods for Important Equation Types
Equation TypeEquations and inequations
Ordinary differential equations
Partial differential equations
Integer equations
Integer equations in a finite field
Linear integral equations
Linear systems
Recurrence relations

Solution Method
solve and fsolve commands
ODE Analyzer Assistant (and dsolve command)
pdsolve command
isolve command
msolve command
intsolve command
LinearAlgebra[LinearSolve] command
rsolve command

Note: Many solve operations are available in the context panel and as task templates (Tools→Tasks→Browse). Mostof this section focuses on other methods.

Solving Equations and Inequations
Using Maple, you can symbolically solve equations and inequations. You can also solve equations numerically.
To solve an equation or set of equations using the context panel:
1. Click the equation.
2. From the context panel, select Solve (or Solve Numerically). See Figure 4.2.

4.4 Solving Equations • 83

Figure 4.2: Context Panel for an Equation

In Worksheet mode, Maple inserts a calling sequence that solves the equation followed by the solutions.
If you select Solve, Maple computes exact solutions.
>
(4.3)

>
(4.4)

If you select Solve Numerically, Maple computes floating-point solutions.
>
(4.5)

>
(4.6)

84 • 4 Basic Computations

For information on solving equations and inequations symbolically using the solve command, see the following section.
For information on solving equations numerically using the fsolve command, see Numerically Solving
Equations (page 86).
Symbolically Solving Equations and Inequations
The solve command is a general solver that determines exact symbolic solutions to equations or inequations. The
solutions to a single equation or inequation are returned as an expression sequence. For details, see Creating and Using
Data Structures (page 269). If Maple does not find any solutions, the solve command returns the empty expression sequence.
>

In general, solve computes solutions in the field of complex numbers. To restrict the problem to only real solutions,
see Restricting the Domain (page 105).
It is recommended that you verify the solutions returned by the solve command. For details, see Working with
Solutions (page 87).
To return the solutions as a list, enclose the calling sequence in brackets ([ ]).
>Expressions: You can specify expressions instead of equations. The solve command automatically equates them tozero.
>(In this case, the solution involves the LambertW function.)
Multiple Equations: To solve multiple equations or inequations, specify them as a list or set. For an introduction toboth lists and sets, see Creating and Using Data Structures (page 269).
>>

Solving for Specific Unknowns: By default, the solve command returns solutions for all unknowns. You can specify
the unknowns for which to solve.

4.4 Solving Equations • 85>

To solve for multiple unknowns, specify them as a list.
>

Transcendental Equations: In general, the solve command returns one solution to transcendental equations.
>>

To produce all solutions, use the allsolutions option.
>

Maple uses variables of the form _ZN~, where N is a positive integer, to represent arbitrary integers. The tilde (~) indicates that it is a quantity with an assumption. For information about names with assumptions, see Assumptions on
Variables (page 106).
RootOf Structure: The solve command may return solutions, for example, to higher order polynomial equations, in
an implicit form using RootOf structures.
>

(4.7)

These RootOf structures are placeholders for the roots of the equation
meter numbers and orders the four solutions.

The index para-

Like any symbolic expression, you can convert RootOf structures to a floating-point value using the evalf command.
>

Some equations are difficult to solve symbolically. For example, polynomial equations of order five and greater do
not in general have a solution in terms of radicals. If the solve command does not find any solutions, it is recommended

86 • 4 Basic Computations

that you use the Maple numerical solver, fsolve. For information, see the following section, Numerically Solving
Equations.
For more information on the solve command, including how to solve equations defined as procedures and how to findparametric solutions, refer to the solve/details help page.
For information on verifying and using solutions returned by the solve command, see Working with Solutions (page 87).
Numerically Solving Equations
The fsolve command solves equations numerically. The behavior of the fsolve command is similar to that of the solvecommand.
>>(4.8)

Note: You can also numerically solve equations using the context panel. See Solving Equations andInequations (page 82).
It is recommended that you verify the solutions returned by the fsolve command. For details, see Working with
Solutions (page 87).
Multiple Equations: To solve multiple equations, specify them as a set. For more information, see Creating and Using
Data Structures (page 269). The fsolve command solves for all unknowns.
>

Univariate Polynomial Equations: In general, the fsolve command finds one real solution. However, for a univariate
polynomial equation, the fsolve command returns all real roots.
>>

Controlling the Number of Solutions: To limit the number of roots returned, specify the maxsols option.
>

To find additional solutions to a general equation, use the avoid option to ignore known solutions.
>

Complex Solutions: To search for a complex solution or find all complex and real roots for a univariate polynomial,
specify the complex option for the fsolve command.

4.4 Solving Equations • 87>

If the fsolve command does not find any solutions, it is recommended that you specify a range in which to search forsolutions, or specify an initial value.
Range: To search for a solution in a range, specify the range in the calling sequence. The range can be real or complex.
>

The syntax for specifying a region in the complex plane is lower-left point..upper-right point.
>

Initial Values: You can specify a value for each unknown. The fsolve command uses these as initial values for the
unknowns in the numerical method.
>(4.9)

For more information and examples, refer to the fsolve/details help page.
For information on verifying and using solutions returned by the fsolve command, see the following section, Working
with Solutions.
Working with Solutions
Verifying: It is recommended that you always verify solutions (that the solve and fsolve commands return) using theeval command.
>>(4.10)>(4.11)>

88 • 4 Basic Computations>(4.12)>(4.13)For more information, see Substituting a Value for a Subexpression (page 285).
Assigning the Value of a Solution to a Variable: To assign the value of a solution to the corresponding variable as
an expression, you can use the assign command, which can turn an equation such as the numeric solution in (4.9),, into an assignment.
>>

A word of caution, if you do this,it. The way to do that is

now has a value so you cannot afterwards treat it as an unknown unless you unassign>
For more information on unassigning names, see Unassigning Names (page 69).
Creating a Function from a Solution: The assign command assigns a value as an expression to a name. It does notdefine a function. To convert a solution to a function, use the unapply command.
Consider one of the solutions for q to the equation

.

>

>

Here, solutions[1] selects the first element of the list of solutions. For more information on selecting elements, see
Accessing Elements (page 269).
You can evaluate this function at symbolic or numeric values.

4.4 Solving Equations • 89

>

>

>

For more information on defining and using functions, see Functional Operators (page 274).

Other Specialized Solvers
In addition to equations and inequations, Maple can solve other equations including:• Ordinary differential equations (ODEs)• Partial differential equations (PDEs)• Integer equations• Integer equations in a finite field• Linear systems• Recurrence relations
Ordinary Differential Equations (ODEs)
Maple can solve ODEs and ODE systems, including initial value and boundary value problems, symbolically and numerically.
ODE Analyzer Assistant The ODE Analyzer Assistant is a point-and-click interface to the Maple ODE solving
routines.
To open the ODE Analyzer:• From the Tools menu, select Tutors, Differential Equations, and then ODE Analyzer.
Maple inserts the dsolve[interactive]() calling sequence in the document. The ODE Analyzer Assistant (Figure 4.3)
is displayed.

90 • 4 Basic Computations

Figure 4.3: ODE Analyzer AssistantIn the main ODE Analyzer Assistant window, you can define ODEs, initial or boundary value conditions, and parameters. To define derivatives, use the diff command. For example, diff(x(t), t) corresponds todiff(x(t), t, t) corresponds toandFor more information on the diff command, see The diff

Command (page 133).
After defining an ODE, you can solve it numerically or symbolically.
To solve a system numerically using the ODE Analyzer Assistant:
1. Ensure that the conditions guarantee uniqueness of the solution.
2. Ensure that all parameters have fixed values.
3. Click the Solve Numerically button.
4. In the Solve Numerically window (Figure 4.4), you can specify the numeric method and relevant parameters anderror tolerances to use for solving the problem.
5. To compute solution values at a point, click the Solve button.

4.4 Solving Equations • 91

Figure 4.4: ODE Analyzer Assistant: Solve Numerically Dialog

To solve a system symbolically using the ODE Analyzer Assistant:
1. Click the Solve Symbolically button.
2. In the Solve Symbolically window (Figure 4.5), you can specify the method and relevant method-specific options
to use for solving the problem.
3. To compute the solution, click the Solve button.

92 • 4 Basic Computations

Figure 4.5: ODE Analyzer Assistant: Solve Symbolically Dialog

When solving numerically or symbolically, you can view a plot of the solution by clicking the Plot button.
• To plot the solution to a symbolic problem, all conditions and parameters must be set.
• To customize the plot, click the Plot Options button to open the Plot Options window.
To view the corresponding Maple commands as you solve the problem or plot the solution, select the Show Maple
commands check box.
You can control the return value of the ODE Analyzer using the On Quit, Return drop-down list. You can select toreturn nothing, the displayed plot, the computed numeric procedure (for numeric solutions), the solution (for symbolic
solutions), or the Maple commands needed to produce the solution values and the displayed plot.
For more information, refer to the ODEAnalyzer help page.
The dsolve Command
The ODE Analyzer provides a point-and-click interface to the Maple dsolve command.
For ODEs or systems of ODEs, the dsolve command can find:• Closed form solutions• Numerical solutions

4.4 Solving Equations • 93

• Series solutions
In addition, the dsolve command can find:• Formal power series solutions to linear ODEs with polynomial coefficients• Formal solutions to linear ODEs with polynomial coefficientsTo access all available functionality, use the dsolve command directly. For more information, refer to the dsolve help
page.
Partial Differential Equations (PDEs)
To solve a PDE or PDE system symbolically or numerically, use the pdsolve command. PDE systems can contain
ODEs, algebraic equations, and inequations.
For example, solve the following PDE symbolically. For help entering a partial derivative, see Example 1 - Enter a
Partial Derivative (page 46).
>>
(4.14)>The solution is an arbitrary univariate function applied to.

Maple generally prints only the return value, errors, and warnings during a computation. To print information about
the techniques Maple uses, increase the infolevel setting for the command.
To return all information, set infolevel to 5.
>>
Checking arguments ...
First set of solution methods (general or quasi general solution)-> trying characteristic strip method for first order PDEs<- characteristic strip method for first order PDEs successful<- First set of solution methods successful<- Returning a *general* solution

For more information on solving PDEs, including numeric solutions and solving PDE systems, refer to the pdsolve
help page.

94 • 4 Basic Computations

Integer Equations
To find only integer solutions to an equation, use the isolve command. The isolve command finds solutions for all
variables. For more information, refer to the isolve help page.
>

Integer Equations in a Finite Field
To solve an equation modulo an integer, use the msolve command. The msolve command finds solutions for all variables.
For more information, refer to the msolve help page.
>

Solving Linear Systems
To solve a linear system, use the LinearAlgebra[LinearSolve] command. The LinearSolve command returns thevector x that satisfies A . x = B. For more information, refer to the LinearAlgebra[LinearSolve] help page.
For example, construct an augmented matrix using the Matrix palette (see Creating Matrices and Vectors (page 118))
in which the first four columns contain the entries of A and the final column contains the entries of B.

>>

For more information on using Maple to solve linear algebra problems, see Linear Algebra (page 118).
Solving Recurrence Relations
To solve a recurrence relation, use the rsolve command. The rsolve command finds the general term of the function.
For more information, refer to the rsolve help page.

4.5 Units, Scientific Constants, and Uncertainty • 95>

4.5 Units, Scientific Constants, and Uncertainty
In addition to manipulating exact symbolic and numeric quantities, Maple can perform computations with units anduncertainties.
Maple supports hundreds of units, for example, miles, coulombs, and bars, and provides facilities for adding custom
units.
Maple has a library of hundreds of scientific constants with units, including element and isotope properties.
To support computations with uncertainties, Maple propagates errors through computations.

Units
The Units package in Maple provides a library of units, and facilities for using units in computations. It is fully extensible
so that you can add units and unit systems as required.
Note: Some unit operations are available as task templates (see Tools→Tasks→Browse) and through the context
panel.
Overview of Units
A dimension is a measurable quantity, for example, length or force. The set of dimensions that are fundamental andindependent are known as base dimensions.
In Maple, the base dimensions include length, mass, time, electric current, thermodynamic temperature, amount of
substance, luminous intensity, information, and currency. For a complete list, enter and execute Units[GetDimensions]().
Complex dimensions (or composite dimensions) measure other quantities in terms of a combination of base dimensions.
For example, the complex dimension force is a measurement ofEach dimension, base or complex, has associated units. (Base units measure a base dimension. Complex units measure
a complex dimension.) Maple supports over 40 units of length, including feet, miles, meters, angstroms, microns, andastronomical units. A length must be measured in terms of a unit, for example, a length of 2 parsecs.
Table 4.4 lists some dimensions, their corresponding base dimensions, and example units.
Table 4.4: Sample Dimensions
Dimension
Time
EnergyElectric potential

Base Dimensions
time

Example Unitssecond, minute, hour, day, week, month, year,
millennium, blink, lune
joule, electron volt, erg, watt hour, calorie,
Calorie, British thermal unit
volt, abvolt, statvolt

For the complete list of units (and their contexts and symbols) available for a dimension, refer to the corresponding
help page, for example, the Units/length help page for the units of length.

96 • 4 Basic Computations

Each unit has a context. The context differentiates between different definitions of the unit. For example, the standard
and US survey miles are different units of length, and the second is a unit of time and of angle. You can specify thecontext for a unit by appending the context as an index to the unit, for example, mile[US_survey]. If you do not specify
a context, Maple uses the default context.
Units are collected into systems, for example, the foot-pound-second (FPS) system and international system, or systèmeinternational, (SI). Each system has a default set of units used for measurements. In the FPS system, the foot, pound,and second are used to measure the dimensions of length, mass, and time. The unit of speed is the foot/second. In SI,
the meter, kilogram, and second are used to measure the dimensions of length, mass, and time. The units of speed,magnetic flux, and power are the meter/second, weber, and watt, respectively.
Unit Conversions
To convert a value measured in a unit to the corresponding value in a different unit, use the Units Converter.
• From the Tools→Assistants menu, select Units Converter.
The Units Converter application (Figure 4.6) opens.

Figure 4.6: Units Converter AssistantTo perform a conversion:
1. In the Convert text field, enter the numeric value to convert.
2. In the Dimension drop-down list, select the dimensions of the unit.
3. In the From and To drop-down lists, select the original unit and the unit to which to convert.
4. Click Perform Unit Conversion.
The same conversion can be done with the convert/units command.
>

Using the Units Converter, you can convert temperatures and temperature changes.
• To perform a temperature conversion, in the Dimension drop-down list, select temperature(absolute).
• To perform a temperature change conversion, in the Dimension drop-down list, select temperature(relative).
To convert temperature changes, the Units Converter uses the convert/units command. For example, an increase of
32 degrees Fahrenheit corresponds to an increase of almost 18 degrees Celsius.

4.5 Units, Scientific Constants, and Uncertainty • 97>

To convert absolute temperatures, the Unit Converter uses the convert/temperature command. For example, 32 degrees
Fahrenheit corresponds to 0 degrees Celsius.
>

Applying Units to an Expression
To insert a unit, use the Units palette . See Figure 4.7.

Figure 4.7: Units Palette

To insert a unit:• In the Units palette, select a unit dimension, then click the desired unit symbol.
>

To insert a unit that is unavailable in the palettes:
1. In the Units palette, click the unit symbol. Maple inserts a Unit object with the placeholder selected.

2. In the placeholder, enter the unit name (or symbol). Note that you see double brackets around the unit when you
are editing it.
For example, to enterstandard (the default context) miles, you can specify the unit name, mile, or symbol, mi.

As you edit, the unit is enclosed in double brackets:>

The context of a unit is displayed only if it is not the default context.
Alternative ways to enter units:• Enter Unit, and then press the symbol completion key (see Symbol Names (page 21)) and then enter the unit.
• Use the shortcut key Ctrl + Shift + U (Command + Shift + U, on Mac) and then enter the unit.

98 • 4 Basic Computations• Use the Unit command. Note that to write a quantity with a unit using this command, write multiplication between
them; this is especially evident in 1-D math:
Important: In 1-D Math input, the quantity and unit (entered using the top-level Unit command) are a product, not asingle entity. The following calling sequences define different expressions.
> 1 Unit(m)/(2 Unit(s));> 1 Unit(m)/2 Unit(s);Some units support prefixes. For example, SI units support prefixes to names and symbols. You can specify 1000
meters using kilometer or km. For more information, refer to the Units/prefixes help page.
>

Performing Computations with Units
In the default Maple environment, you cannot perform computations with quantities that have units. You can perform
only unit conversions. For more information about the default environment, refer to the Units/Default help page.
To compute with expressions that have units, you must load a Units environment: Simple, Standard, or Natural. It is
recommended that you use the Simple environment, and that environment is loaded by default when you load theUnits package:>
Automatically loading the Units[Simple] subpackage

In the Simple Units environment, commands that support expressions with units return results with the correct units.
>>(4.15)>(4.16)>For information on differentiation and integration, see Calculus (page 131).

4.5 Units, Scientific Constants, and Uncertainty • 99

Changing the Current System of Units
If a computation includes multiple units, all units are expressed using units from the current system of units.
>(4.17)

By default, Maple uses the SI system of units, in which length is measured in meters and time is measured in seconds.
>

To view the name of the default system of units, use the Units[UsingSystem] command or view the current selection
for Choose System, under the Convert Output Units section of the context panel.
>
Automatically loading the Units[Simple] subpackage>

To change the system of units, use the Units[UseSystem] command or click the output and then select the desired
system of units in the Choose System list, under the Convert Output Units section of the context panel.
>>

Extensibility
You can extend the set of:• Base dimensions and units• Complex dimensions• Complex units• Systems of units
For more information, refer to the Units[AddBaseUnit], Units[AddDimension], Units[AddUnit], andUnits[AddSystem] help pages.
For more information about units, refer to the Units help page.

Scientific Constants and Element Properties
Computations often require not only units (see Units (page 95)), but also the values of scientific constants, including
properties of elements and their isotopes. Maple supports computations with scientific constants. You can use the builtin constants and add custom constants.

100 • 4 Basic Computations

Overview of Scientific Constants and Element Properties
The ScientificConstants package provides the values of constant physical quantities, for example, the velocity of lightand the atomic weight of sodium. The ScientificConstants package also provides the units for the constant values,
allowing for greater understanding of the equation as well as unit-matching for error checking of the solution.
The quantities available in the ScientificConstants package are divided into two distinct categories.
• Physical constants• Chemical element (and isotope) properties
Scientific Constants
List of Scientific Constants
You have access to scientific constants important in engineering, physics, chemistry, and other fields. Table 4.5 lists
some of the supported constants. For a complete list of scientific constants, refer to the ScientificConstants/PhysicalConstants help page.
Table 4.5: Scientific Constants
Name
Newtonian_constant_of_gravitation
Planck_constantelementary_charge
Bohr_radiusdeuteron_magnetic_moment
Avogadro_constant
Faraday_constantSymbol
G
h
e
a[0]
mu[d]
N[A]
F

You can specify a constant using either its name or symbol.
Accessing Constant Definition
The GetConstant command in the ScientificConstants package returns the complete definition of a constant.
To view the definition of the Newtonian gravitational constant, specify the symbol G (or its name) in a call to the
GetConstant command.
>>

For information on accessing a constant's value, units, or uncertainty, see Value, Units, and Uncertainty (page 101).
Element Properties
Maple also contains element properties and isotope properties.

4.5 Units, Scientific Constants, and Uncertainty • 101

Elements
Maple supports all 117 elements of the periodic table. Each element has a unique name, atomic number, and chemical
symbol. You can specify an element using any of these labels. For a complete list of supported elements, refer to the
ScientificConstants/elements help page.
Maple supports key element properties, including atomic weight (atomicweight), electron affinity (electronaffinity),and density. For a complete list of element properties, refer to the ScientificConstants/properties help page.
Isotopes
Isotopes, variant forms of an element that contain the same number of protons but a different number of neutrons, exist
for many elements.
To see the list of supported isotopes for an element, use the GetIsotopes command.
>

Maple supports isotopes and has a distinct set of properties for isotopes, including abundance, binding energy(bindingenergy), and mass excess (massexcess). For a complete list of isotope properties, refer to the ScientificConstants/properties help page.
Accessing an Element or Isotope Property Definition
The GetElement command in the ScientificConstants package returns the complete definition of an element or isotope.
>>

Value, Units, and Uncertainty
To use constants or element properties, you must first construct a ScientificConstants object.
To construct a scientific constant, use the Constant command.
>
To construct an element (or isotope) property, use the Element command.

102 • 4 Basic Computations

>

Value
To obtain the value of a ScientificConstants object, use the evalf command.
>>

Note: The value returned depends on the current system of units.
Units
To obtain the units for a ScientificConstants object, use the GetUnit command.
>>

For information on changing the default system of units, for example, from SI to foot-pound-second, see Changing
the Current System of Units (page 99).
Value and Units
If you are performing computations with units, you can access the value and units for a ScientificConstants object byspecifying the units option when constructing the object, and then evaluating the object.
>>

Uncertainty
The value of a constant is often determined by direct measurement or derived from measured values. Hence, it has an
associated uncertainty. To obtain the uncertainty in the value of a ScientificConstants object, use the GetError
command.

4.5 Units, Scientific Constants, and Uncertainty • 103>>

Performing Computations
You can use constant values in any computation. To use constant values with units, use a Units environment as describedin Performing Computations with Units (page 98). For information on computing with quantities that have an uncertainty,
see the following section.
Modification and Extensibility
You can change the definition of a scientific constant or element (or isotope) property.
For more information, refer to the ScientificConstants[ModifyConstant] and ScientificConstants[ModifyElement]
help pages.
You can extend the set of:• Constants• Elements (and isotopes)• Element (or isotope) properties
For more information, refer to the ScientificConstants[AddConstant], ScientificConstants[AddElement], and ScientificConstants[AddProperty] help pages.
For more information about constants, refer to the ScientificConstants help page.

Uncertainty Propagation
Some computations involve uncertainties (or errors). Using the ScientificErrorAnalysis package, you can propagate
the uncertainty in these values through the computation to indicate the possible error in the final result.
The ScientificErrorAnalysis package does not perform interval arithmetic. That is, the error of an object does not
represent an interval in which possible values must be contained. (To perform interval arithmetic, use the Tolerances
package. For more information, refer to the Tolerances help page..) The quantities represent unknown values with acentral tendency. For more information on central tendency, refer to any text on error analysis for the physical sciences
or engineering.
Quantities with Uncertainty
Creating: To construct quantities with uncertainty, use the Quantity command. You must specify the value and uncertainty. The uncertainty can be defined absolutely, relatively, or in units of the last digit. For more information on
uncertainty specification, refer to the ScientificErrorAnalysis[Quantity] help page.
The output displays the value and uncertainty of the quantity.
>>

104 • 4 Basic Computations>>(4.18)To specify the error in units of the last digit, the value must be of floating-point type.
>

To access the value and uncertainty of a quantity with uncertainty, use the evalf and ScientificErrorAnalysis[GetError]
commands.
>>

Rounding: To round the error of a quantity with uncertainty, use the ApplyRule command. For a description of thepredefined rounding rules, refer to the ScientificErrorAnalysis/rules help page.
>

Units: Quantities with errors can have units. For example, the scientific constants and element (and isotope) properties
in the ScientificConstants packages are quantities with errors and units.
To construct a new quantity with units and an uncertainty, include units in the Quantity calling sequence.
For an absolute error, you must specify the units in both the value and error.
>>

For a relative error, you can specify the units in only the value.
>

For information on the correlation between, variance of, and covariance between quantities with uncertainty, refer tothe ScientificErrorAnalysis help page.
Performing Computations with Quantities with Uncertainty
Many Maple commands support quantities with uncertainty.
>

4.6 Restricting the Domain • 105>
Compute the value of the derivative of

at

>

>
To convert the solution to a single quantity with uncertainty, use the combine/errors command.
>
The value of the result is:>

The uncertainty of the result is:>

Additional Information
For information on topics including:• Creating new rounding rules,• Setting the default rounding rule, and• Creating a new interface to quantities with uncertainty,
refer to the ScientificErrorAnalysis help page.

4.6 Restricting the Domain
By default, Maple computes in the complex number system. Most computations are performed without any restrictions
or assumptions on the variables. Maple often returns results that are extraneous or unsimplified when computing in
the field of complex numbers. Using restrictions, you can more easily and efficiently perform computations in asmaller domain.
Maple has facilities for performing computations in the real number system and for applying assumptions to variables.

Real Number Domain
To force Maple to perform computations in the field of real numbers, use the RealDomain package.
The RealDomain package contains a small subset of Maple commands related to basic precalculus and calculus
mathematics, for example, arccos, limit, and log, and the symbolic manipulation of expressions and formulae, for example, expand, eval, and solve. For a complete list of commands, refer to the RealDomain help page.
After you load the RealDomain package, Maple assumes that all variables are real. Commands return simplified results
appropriate to the field of real numbers.

106 • 4 Basic Computations

Table 4.6: Restricting to Real Numbers
Without Loading RealDomain

After Loading RealDomain

In Maple's default environment, without loading
After loading RealDomain, the answers are simplified.
RealDomain, the answers are correct for the entire complex>
field.
>>(4.22)(4.19)>>(4.23)(4.20)>>(4.24)(4.21)

Complex return values are excluded or replaced byundefined.
>
>
>

>

After loading the RealDomain package, you can also use the context-sensitive items for simplify and solve to perform
computations in the field of real numbers. For example, using the context panel item Simplify > Simplify,

Assumptions on Variables
To simplify problem solving, it is recommended that you always apply any known assumptions to variables. You can
impose assumptions using the assume command. To apply assumptions for a single computation, use the assuming
command.
Note: The assume and assuming commands are not supported by the RealDomain package.
The assume Command
You can use the assume command to set variable properties, for example, x::real, and relationships between variables,for example, x < 0 or x < y. For information on valid properties, refer to the assume help page. For information on the
double colon (::) operator, refer to the type help page.
The assume command allows improved simplification of symbolic expressions, especially multiple-valued functions,for example, computing the square root.
To assume that x is a positive real number, use the following calling sequence. Then compute the square root of.

4.6 Restricting the Domain • 107>

The trailing tilde (~) on the name x indicates that it carries assumptions.
When you use the assume command to place another assumption on x, all previous assumptions are removed.
>

Displaying Assumptions: To view the assumptions on an expression, use the about command.
>
Originally x, renamed x~:
is assumed to be: RealRange(-infinity,Open(0))

Imposing Multiple Assumptions: To simultaneously impose multiple conditions on an expression, specify multiple
arguments in the assume calling sequence.
>
To specify additional assumptions without replacing previous assumptions, use the additionally command. The syntaxof the additionally calling sequence is the same as that of the assume command.
>
Originally x, renamed x~:
is assumed to be: 1

The only integer in the open interval (0, 2) is 1.
Testing Properties: To test whether an expression always satisfies a condition, use the is command.
>

The following test returns false because there are values of x and y (x = 0, y = 10) that satisfy the assumptions, but donot satisfy the relation in the is calling sequence.
>

To test whether an expression can satisfy a condition, use the coulditbe command.
>

Removing Assumptions: To remove all assumptions on a variable, unassign its name.
>108 • 4 Basic Computations

For more information, see Unassigning Names (page 69).
For more information on the assume command, refer to the assume help page.
The assuming Command
To perform a single evaluation under assumptions on the names in an expression, use the assuming command.
The syntax of the assuming command is <expression> assuming <property or relation>. Properties and relations are
introduced in The assume Command (page 106).
The frac command returns the fractional part of an expression.
>

Using the assuming command is equivalent to imposing assumptions with the assume command, evaluating the expression, and then removing the assumptions.
>x:nothing known about this object

If you do not specify the names to which to apply a property, it is applied to all names.
>

Assumptions placed on names using the assume command are ignored by the assuming command, unless you include
the additionally option.
>>>

The assuming command does not affect variables inside procedures. (For information on procedures, see
Procedures (page 303).) You must use the assume command.

4.6 Restricting the Domain • 109> f := proc(x) sqrt(a^2) + x end proc;>>

For more information on the assuming command, refer to the assuming help page.

110 • 4 Basic Computations

5 Mathematical Problem Solving
This chapter focuses on solving problems in specific mathematical disciplines. The areas described below are not allthat Maple provides, but represent the most commonly used packages. Examples are provided to teach you how to use
the different methods of calculation available in Maple, including tutors, assistants, commands, task templates, plotting,and context-sensitive operations.
The examples in this chapter assume knowledge of entering commands and mathematical symbols. For information,
see Entering Expressions (page 14). For information on basic computations, including integer operations and solving
equations, see Basic Computations (page 75).

5.1 In This Chapter
SectionAlgebra (page 111) - Performing algebra computations

Topics• Polynomial AlgebraLinear Algebra (page 118) - Performing linear algebra
computations• Creating Matrices and Vectors• Accessing Entries in Matrices and Vectors• Linear Algebra Computations• Student LinearAlgebra Package

Calculus (page 131) - Performing calculus computations• Limits• Differentiation• Series• Integration• Differential Equations• Calculus Packages

Optimization (page 140) - Performing optimization computations • Point-and-Click Interface
using the Optimization package• Efficient Computation• MPS(X) File Support
Statistics (page 144) - Performing statistics computations using • Probability Distributions and Random Variables
the Statistics package• Statistical Computations• Plotting
Teaching and Learning with Maple (page 148) - Student andInstructor resources for using Maple in an academic setting• Student Packages and Tutors• Study Guides• Step by Step Solutions• More Student and Instructor Resources

Clickable MathTM (page 160) - Solve math problems using some • Step-by-Step examplesof the interactive methods available in Maple

5.2 Algebra
Maple contains a variety of commands that perform integer operations, such as factoring and modular arithmetic, as
described in Integer Operations (page 78). The following section describes Maple's support of polynomial algebra.
For information on matrix and vector algebra, see Linear Algebra (page 118).
For information directed to students of algebra or precalculus, see Teaching and Learning with Maple (page 148).

111

112 • 5 Mathematical Problem Solving

Polynomial Algebra
A Maple polynomial is an expression in powers of an unknown. Univariate polynomials are polynomials in one unknown,
Multivariate polynomials are polynomials in multiple unknowns, such as

for example,

The coefficients can be integers, rational numbers, irrational numbers, floating-point numbers, complex numbers,variables, or a combination of these types.
>

Arithmetic
The polynomial arithmetic operators are the standard Maple arithmetic operators excluding the division operator (/).
(The division operator accepts polynomial arguments, but does not perform polynomial division.)
Polynomial division is an important operation. The quo and rem commands find the quotient and remainder of apolynomial division. See Table 5.1. (The iquo and irem commands find the quotient and remainder of an integer division.
For more information, see Integer Operations (page 78).)
Table 5.1: Polynomial Arithmetic Operators
Operation
Addition

Operator Example>

Subtraction>

Multiplication1*>

Division: Quotient andRemainder

quo

>

rem

>

Exponentiation2^>

5.2 Algebra • 113

Operation

Operator Example

1

You can specify multiplication explicitly by entering *, which displays in 2-D Math as . In 2-D
Math, you can also implicitly multiply by placing a space character between two expressions. In
some cases, the space character is optional. For example, Maple interprets a number followed by aname as an implicit multiplication.
2

In 2-D Math, exponents display as superscripts.

To expand a polynomial, use the expand command.
>

If you need to determine whether one polynomial divides another, but do not need the quotient, use the divide command.
The divide command tests for exact polynomial division.
>

Important: You must insert a space character or a multiplication operator (Otherwise, they are interpreted as a single variable.
For example, without a space,is considered a single variable, and) between adjacent variables names.

does not divide the single variable

>

But,

divides the product of

and>For information on polynomial arithmetic over finite rings and fields, refer to the mod help page.
Sorting Terms
To sort the terms of a polynomial, use the sort command.
>>

Note: The sort command returns the sorted polynomial, and updates the order of the terms in the polynomial.
The terms of p1 are sorted.

114 • 5 Mathematical Problem Solving>

To specify the unknowns of the polynomial and their ordering, include a list of names.
>>

By default, the sort command sorts a polynomial by decreasing total degree of the terms.
>>

The first term has total degree 4. The other two terms have total degree 3. The order of the final two terms is determinedby the order of their names in the list.
To sort the terms by pure lexicographic order, that is, first by decreasing order of the first unknown in the list option,and then by decreasing order of the next unknown in the list option, specify the 'plex' option.
>

For information on enclosing keywords in right single quotes ('), see Delaying Evaluation (page 291).
The first term contains

to the power 3; the second,to the power 2; and the third,

to the power 0.

Using context-sensitive operations, you can perform operations, such as sorting, for polynomials and many other Maple
objects.
To sort a polynomial:
1. Select the polynomial.
2. From the Context Panel, under the Sorts menu, select:• Single-variable, and then the unknown, or,• Two-variable (or Three-variable), Pure Lexical or Total Degree, and then the sort priority of the unknowns.
See Figure 5.1.

5.2 Algebra • 115

Figure 5.1: Sorting a Polynomial Using the Context Panel

Maple sorts the polynomial.
In Worksheet mode, Maple inserts the calling sequence that performs the sort followed by the sorted polynomial. For
this example, choose Sorts > Two-variable > Pure Lexical > y,x.
>
(5.1)

>
(5.2)

116 • 5 Mathematical Problem Solving

You can use the Context Panel to perform context-sensitive operations on 2-D Math content including output. For
more information, see Computing with the Context Panel (page 50) (for Document mode) or The Context
Panel (page 65) (for Worksheet mode).
Collecting Terms
To collect the terms of polynomial, use the collect command.
>

Coefficients and Degrees
Maple has several commands that return coefficient and degree values for a polynomial. See Table 5.2.
Table 5.2: Polynomial Coefficient and Degree Commands
Commandcoeff

Description
Coefficient of specified degree term

ExamplelcoeffLeading coefficienttcoeffTrailing coefficient

coeffsSequence of all coefficients, in one-to-one>
correspondence with the terms

>

>

>

Note: It does not return zero coefficientsdegree(Highest) degree

ldegreeLowest degree term with a non-zerocoefficient>>

Factorization
To express a polynomial in fully factored form, use the factor command.

5.2 Algebra • 117>

The factor command factors the polynomial over the ring implied by the coefficients, for example, integers. You canspecify an algebraic number field over which to factor the polynomial. For more information, refer to the factor help
page. (The ifactor command factors an integer. For more information, see Integer Operations (page 78).)
To solve for the roots of a polynomial, use the solve command. For information on the solve command, see Solving
Equations and Inequations (page 82). (The isolve command solves an equation for integer solutions. For more information, see Integer Equations (page 94).)
Other Commands
Table 5.3 lists other commands available for polynomial operations.
Table 5.3: Select Other Polynomial Commands
Commandcontent
compoly
discrimgcd
gcdex
CurveFitting[PolynomialInterpolation]

Description
Content (multivariate polynomial)Decomposition
DiscriminantGreatest common divisor (of two polynomials)
Extended Euclidean algorithm (for two polynomials)
Interpolating polynomial (for list of points)

See also the CurveFitting Assistant (Tools → Tutors →Statistics → Curve Fitting)
lcm
norm
prem
primpart
randpoly
PolynomialTools[IsSelfReciprocal]
resultantroots
sqrfree

Least common multiple (of two polynomials)
Norm
Pseudo-remainder (of two multivariate polynomials)
Primitive part (multivariate polynomial)Random polynomial
Determine whether self-reciprocal
Resultant (of two polynomials)
Exact roots (over algebraic number field)
Square-free factorization (multivariate polynomial)

Additional Information
Table 5.4: Additional Polynomial Help
Topic
General polynomial information
PolynomialTools package
Algebraic manipulation of numeric polynomials
Polynomial information and commands

Resource
polynom help page
PolynomialTools package overview help page
SNAP (Symbolic-Numeric Algorithms for Polynomials) package
overview help page
Maple Help System Table of Contents:
Mathematics→Algebra→Polynomials section

118 • 5 Mathematical Problem Solving

5.3 Linear AlgebraLinear algebra operations act on Matrix and Vector data structures.
You can perform many linear algebra operations using task templates. In the Task Browser (Tools → Tasks →Browse), expand the Linear Algebra folder.

Creating Matrices and Vectors
Creating Matrices
You can create a Matrix using• The Matrix command• The angle bracket shortcut notation• The Matrix palette (see Figure 5.2).
When creating a Matrix using the Matrix command, there are several input formats available. For example, enter a listof lists. The dimensions of the matrix are inferred from the number of entries given.
>

Alternatively, use the angle bracket shortcut, <>. Separate items in a column with commas, and separate columns withvertical bars, |.
>For information on the Matrix command options, see Creating Matrices and Vectors with Specific Properties (page 122).

5.3 Linear Algebra • 119

Use the Matrix palette to interactively create a matrix without commands:

Figure 5.2: Matrix Palette

In the Matrix palette, you can specify the matrix size (see Figure 5.3) and properties. To insert a matrix, click the Insert
Matrix button.

Figure 5.3: Matrix Palette: Choosing the Size

After inserting the matrix:
1. Enter the values of the entries. To move to the next entry placeholder, press Tab.
2. After specifying all entries, press Enter.

120 • 5 Mathematical Problem Solving>

Creating Vectors
You can create a Vector using angle brackets (< >).
To create a column vector, specify a comma-delimited sequence, <a, b, c>. The number of elements is inferred fromthe number of expressions.
>

To create a row vector, specify a vertical-bar-delimited (|) sequence, <a | b | c>. The number of elements is inferredfrom the number of expressions.
>

For information on the Vector command options, refer to the Vector help page.
You can also create vectors using the Matrix palette. If either the number of rows or number of columns specified is
1, then you have the option of inserting a matrix, or inserting a vector of the appropriate type. See Figure 5.4.

Figure 5.4: Insert Matrix or Insert Vector

Viewing Large Matrices and Vectors
Matricesand smaller, and vectors with 10 or fewer elements, display in the document. For larger matrices
or vectors, a portion is shown inline.

5.3 Linear Algebra • 121

For example, insert amatrix.

In the Matrix palette:
1. Specify the dimensions: 30 rows and 30 columns.
2. In the Type drop-down list, select a matrix type, for example, Random.
3. Click Insert Matrix. The command is inserted; execute it to see the result.
>

Note the output shows ellipses indicating the data continues and the output is scrollable meaning that you can explore
the values directly within the worksheet, using your trackpad or mouse wheel.To view the entire matrix or vector,
double-click the summary placeholder. This launches the Matrix Browser. See Figure 5.5.

122 • 5 Mathematical Problem Solving

Figure 5.5: Matrix Browser

To modify the entries using the Matrix Browser:
1. Select the Table tab.
2. Double-click an entry, and then edit its value. Press Enter.
3. Repeat for each entry to edit.
4. When you have finished updating entries, click Done.
You can view the matrix or vector as a table or as an image, which can be inserted into the document. For more information, refer to the MatrixBrowser help page.
To set the maximum dimension of matrices and vectors displayed inline:• Use the interface command with the rtablesize option.
For example, interface(rtablesize = 15).
For more information, refer to the interface help page.
Creating Matrices and Vectors with Specific Properties
By default, matrices and vectors can store any values. To increase the efficiency of linear algebra computations, create
matrices and vectors with properties. You must specify the properties, for example, the matrix shape or data type, whendefining the object.
The Matrix palette (Figure 5.2) supports several properties.
To specify the matrix type:• Use the Shape and Type drop-down lists.

5.3 Linear Algebra • 123

To specify the data type:• Use the Data type drop-down list.
For example, define a diagonal matrix with small integer coefficients.
In the Matrix palette:
1. Specify the size of the matrix, for example,.

2. In the Shapes drop-down list, select Diagonal.
3. In the Data type drop-down list, select integer[1].
4. Click the Insert Matrix button.
5. Enter the values in the diagonal entries.

>

You cannot specify properties when defining vectors using the angle-bracket notation. You must use the Vector constructor.
To define a column vector using the Vector constructor, specify:• The number of elements. If you explicitly specify all element values, this argument is not required.
• A list of expressions that define the element values.
• Parameters such as shape, datatype, and fill that set properties of the vector.
The following two calling sequences are equivalent.
>>

To create a row vector using the Vector constructor, include row as an index.

124 • 5 Mathematical Problem Solving>>

The Matrix palette does not support some properties. To set all properties, use the Matrix constructor.
To define a matrix using the Matrix constructor, specify:• The number of rows and columns. If you explicitly specify all element values, these arguments are not required.
• A list of lists that define the element values row-wise.
• Parameters such as shape, datatype, and fill that set properties of the matrix.
For example:>

The Matrix palette cannot fill the matrix with an arbitrary value. Use the fill parameter.
>

For more information on the constructors, including other calling sequence syntaxes and parameters, refer to the storage,
Matrix, and Vector help pages.
See also Numeric Computations (page 131).

Accessing Entries in Matrices and Vectors
Matrices
To select an entry in a Matrix, enter the matrix name with a sequence of two non-zero integer indices, row first.

5.3 Linear Algebra • 125>>

To select an entire row, enter a single index; to select an entire column, enter first the entire range of rows,
the column index.
>>

Similarly, you can access submatrices. Enter the indices as a list or range.
>

Vectors
To select an entry in a vector, enter the vector name with a non-zero integer index.
>>

Negative integers select entries from the end of the vector.

then126 • 5 Mathematical Problem Solving>

To create a Vector consisting of multiple entries, specify a list or range of integers in the index. For more information,refer to the set and range help pages.
>>

Linear Algebra Computations
Maple has extensive support for linear algebra. You can perform many matrix and vector computations using contextsensitive operations. Matrix operations such as multiplication and inverses can be done with the basic matrix arithmetic
operators. The LinearAlgebra package provides the full range of Maple commands for linear algebra and vector spacecomputations, queries, and linear system solving.
Matrix Arithmetic
The matrix and vector arithmetic operators are the standard Maple arithmetic operators up to the following two differences.
• The scalar multiplication operator is the asterisk (*), which displays in 2-D Math asand vector multiplication operator is the period (.).

. The noncommutative matrix• There is no division operator (/) for matrix algebra. (You can construct the inverse of a matrix using the exponent.)
Table 5.5 lists the basic matrix operators.

>

Table 5.5: Matrix and Vector Arithmetic Operators
Operation
Addition

Operator

Example>5.3 Linear Algebra • 127

Operation
Subtraction

Operator

ExampleMultiplication.

>

Scalar Multiplication1

*

>

>

>

Exponentiation2

^

>

>

1

You can specify scalar multiplication explicitly by entering *, which displays in 2-D Math as .
In 2-D Math, you can also implicitly multiply a scalar and a matrix or vector by placing a spacecharacter between them. In some cases, the space character is optional. For example, Maple interprets
a number followed by a name as an implicit multiplication.
2

In 2-D Math, exponents display as superscripts.

A few additional matrix and vector operators are listed in Table 5.6.
Define two column vectors.
>
Table 5.6: Select Matrix and Vector Operators
Operation
Transpose

Operator
1^%T

Example>128 • 5 Mathematical Problem Solving

Operation
Hermitian Transpose

Operator

Example1^%H>

Cross Product&x2(3-D vectors only)>>

1

Exponential operators display in 2-D Math as superscripts.

2

After loading the LinearAlgebra package, the cross product operator is available as the infix
operator &x . Otherwise, it is available as the LinearAlgebra[CrossProduct] command.

For information on matrix arithmetic over finite rings and fields, refer to the mod help page.
Point-and-Click Interaction
Using the Context Panel, you can perform many matrix and vector operations.
Matrix operations available in the Context Panel include the following.
• Perform standard operations: determinant, inverse, norm (1, Euclidean, infinity, or Frobenius), transpose, and trace• Compute eigenvalues, eigenvectors, and singular values• Compute the dimension or rank
• Convert to the Jordan form, or other forms• Perform Cholesky decomposition and other decompositions

5.3 Linear Algebra • 129

For example, compute the infinity norm of a matrix. See Figure 5.6.

Figure 5.6: Computing the Infinity Norm of a Matrix

In Document mode, Maple inserts a right arrow and the name of the computation performed, followed by the norm.

Vector operations available in the Context Panel include the following.
• Compute the dimension• Compute the norm (1, Euclidean, and infinity)• Compute the transpose• Select an element
For more information on context-sensitive operations, see Computing with the Context Panel (page 50) (for Documentmode) or The Context Panel (page 65) (for Worksheet mode).
LinearAlgebra Package Commands
The LinearAlgebra package contains commands that construct and manipulate matrices and vectors, compute standard
operations, perform queries, and solve linear algebra problems.
Table 5.7 lists some LinearAlgebra package commands. For a complete list, refer to the LinearAlgebra/Details help
page.

130 • 5 Mathematical Problem Solving

Table 5.7: Select LinearAlgebra Package Commands
Command
Basis
CrossProduct
DeleteRow
Dimension
Eigenvalues
Eigenvectors
FrobeniusForm
GaussianElimination
HessenbergForm
HilbertMatrix
IsOrthogonal
LeastSquares
LinearSolve
MatrixInverse
QRDecomposition
RandomMatrix
SylvesterMatrix

Description
Return a basis for a vector space
Compute the cross product of two vectors
Delete a row or rows of a matrix
Determine the dimension of a matrix or a vector
Compute the eigenvalues of a matrix
Compute the eigenvectors of a matrix
Reduce a matrix to Frobenius form
Perform Gaussian elimination on a matrix
Reduce a square matrix to Hessenberg form
Construct a generalized Hilbert matrix
Test if a matrix is orthogonal
Compute the least-squares approximation to A . x = b
Solve the linear system A . x = b
Compute the inverse of a square matrix or pseudo-inverse of a non-square matrix
Compute the QR factorization of a matrix
Construct a random matrix
Construct the Sylvester matrix of two polynomials

For information on arithmetic operations, see Matrix Arithmetic (page 126).
For information on selecting entries, subvectors, and submatrices, see Accessing Entries in Matrices andVectors (page 124).
Example: Determine a basis for the space spanned by the set of vectors {(2, 13, -15), (7, -2, 13), (5, -4, 9)}. Express
the vector (25, -4, 9) with respect to this basis.
>>
Find a basis for the vector space spanned by these vectors, and then construct a matrix from the basis vectors.
>

To express (25, -4, 9) in this basis, use the LinearSolve command.

5.4 Calculus • 131>

Numeric Computations
You can very efficiently perform computations on large matrices and vectors that contain floating-point data using thebuilt-in library of numeric linear algebra routines. Some of these routines are provided by the Numerical Algorithms
Group (NAG®). Maple also contains portions of the CLAPACK and optimized ATLAS libraries.
For information on performing efficient numeric computations using the LinearAlgebra package, refer to the EfficientLinearAlgebra help page.
See also Creating Matrices and Vectors with Specific Properties (page 122) and Reading from Files (page 327).

Student LinearAlgebra Package
The Student package contains subpackages that help instructors teach concepts and allow students to visualize andexplore ideas. These subpackages also contain computational commands.
In the Student[LinearAlgebra] subpackage, the environment differs from that of the LinearAlgebra package in thatfloating-point computations are generally performed using software precision, instead of hardware precision, andsymbols are generally assumed to represent real, rather than complex, quantities. These defaults, and others, can becontrolled using the SetDefault command. For more information, refer to the Student[SetDefault] help page.
For information on using Maple as a teaching and learning tool, see Teaching and Learning with Maple (page 148).

5.4 Calculus
This section describes the key Maple calculus commands. Many of these commands are also available in the Context
Panel for an expression.
For a complete list of calculus commands, refer to the Mathematics (including Calculus, Differential Equations,Power Series, and Vector Calculus subfolders) and Education >Student Package sections of the Maple Help System
Table of Contents.
The Task Browser (Tools→Tasks→Browse) contains numerous calculus task templates.
For more about resources for teaching or learning calculus, see Teaching and Learning with Maple (page 148).

LimitsTo compute the limit of an expression as the independent variable approaches a value:
1. In the Calculus palette, click the limit item.

2. Specify the independent variable, limit point, and expression, and then evaluate it. Press Tab to move to the next
placeholder.

132 • 5 Mathematical Problem Solving

For example:>

The limit Command
By default, Maple searches for the real bidirectional limit (unless the limit point is ∞ or -∞). To specify a direction,
include one of the options left, right, real, or complex in a call to the limit command. See Table 5.8.
Table 5.8: Limits
Limit

Command Syntax>

Outputundefined>>
Using the limit command, you can also compute multidimensional limits.
>

For more information on multidimensional limits, refer to the limit/multi help page.
Numerically Computing a Limit
To numerically compute a limit:• Use the evalf(Limit(arguments)) calling sequence.
Important: Use the inertLimit command, not the limit command. For more information, refer to the limit help page.
The Limit command accepts the same arguments as the limit command.
For example:>

For information on the evalf command, see Numerical Approximation (page 287).
The Limit command does not compute the limit. It returns an unevaluated limit.
>

5.4 Calculus • 133

For more information on the Limit command, refer to the Limit help page.

Differentiation
Maple can perform symbolic and numeric differentiation.
To differentiate an expression:
1. In the Calculus palette, click the differentiation itemor the partial differentiation item.

2. Specify the expression and independent variable, and then evaluate it.
For example, to differentiatewith respect to:>>

You can also differentiate using the Context Panel. For more information, see The Context Panel (page 27).
To calculate a higher order or partial derivative, edit the derivative symbol inserted. For example, to calculate thesecond derivative ofwith respect to:>

To calculate the mixed partial derivative of:>Note: To enter anothersymbol, you can copy and paste the existing symbol, or enter d and use symbol completion.

The diff Command
Maple computes derivatives using the diff command. To directly use the diff command, specify the expression to differentiate and the variable.
>
(5.3)

>
(5.4)

For information on equation labels such as (5.3), see Equation Labels (page 70).
You can calculate a higher order derivative by specifying a sequence of differentiation variables. Maple recursively
calls the diff command.

134 • 5 Mathematical Problem Solving

>
(5.5)

To calculate a partial derivative, use the same syntax. Maple assumes that the derivatives commute.
>

To enter higher order derivatives, it is convenient to use the syntax diff(f, x$n). This syntax can also be used to computethe symbolic nth order derivative.
For example:>

Differentiating an Operator
You can also specify a mathematical function as a functional operator (a mapping). For a comparison of operators andother expressions, see Distinction between Functional Operators and Other Expressions (page 275).
To find the derivative of a functional operator:• Use the D operator.
The D operator returns a functional operator.
For example, find the derivative of an operator that represents the mathematical function
First, define the operator F.
1. In the Expression palette, click the single-variable function definition item.

2. Enter placeholder values.
• To move to the next placeholder, press the Tab key. Note: If pressing the Tab key inserts a tab, click the Tab iconin the toolbar.
>
Now, define the operator, G, that maps

to the derivative of>F and G evaluated atreturn the expected values.

5.4 Calculus • 135>

For more information on the D operator, refer to the D help page. For a comparison of the diff command and D operator, refer to the diffVersusD help page.
Directional Derivative
To compute and plot a directional derivative, use the Directional Derivative Tutor. The tutor computes a floatingpoint value for the directional derivative.
To launch the tutor:• From the Tools menu, select Tutors, Calculus - Multivariate, and then Directional Derivatives. Maple launches
the Directional Derivative Tutor. See Figure 5.7.

Figure 5.7: Directional Derivative Tutor

To compute a symbolic value for the directional derivative, use the Student[MultivariateCalculus][DirectionalDerivative] command. The first list of numbers specifies the point at which to compute the derivative. The second list of
numbers specifies the direction in which to compute the derivative.

136 • 5 Mathematical Problem Solving

For example, at the point
the gradient ofpoints in the direction
which is the direction ofgreatest increase. The directional derivative in the orthogonal directionis zero.
>>>SeriesTo generate the Taylor series expansion of a function about a point, use the taylor command.
>

Note: If a Taylor series does not exist, use the series command to find a general series expansion.
For example, the cosine integral function does not have a taylor series expansion about 0. For more information, referto the Ci help page.
>
Error, does not have a taylor expansion, try series()

To generate a truncated series expansion of a function about a point, use the series command.
>

By default, Maple performs series calculations up to order 6. To use a different order, specify a non-negative integer
third argument.
>

To set the order for all computations, use the Order environment variable. For information about the Order variable
and theterm, refer to the Order help page.

The expansion is of type series. Some commands do not accept arguments of type series. To use the expansion, youmust convert it to a polynomial. You can do this by using the convert/polynom command on the series, or by computing
the series with the option oterm=false.

5.4 Calculus • 137>

For information on Maple types and type conversions, see Maple Expressions (page 269).
For information on plotting, see Plots and Animations (page 187).

Integration
Maple can perform symbolic and numeric integration.
To compute the indefinite integral of an expression:
1. In the Calculus palette, click the indefinite integration item.

2. Specify the integrand and variable of integration, and then evaluate it.
For example, to integratewith respect to x:>

Recall that you can also enter symbols, including

andusing symbol completion.

• Enter the symbol name (or part of the name), for example, int or d, and then press the completion shortcut key.
For more information, see Symbol Names (page 21).

138 • 5 Mathematical Problem Solving

You can also compute an indefinite integral using the Context Panel. For more information, see The Context
Panel (page 27).
To compute the definite integral of an expression:

1. In the Calculus palette, click the definite integration item.

2. Specify the endpoints of the interval of integration, integrand expression, and variable of integration, and thenevaluate it.
For example, to integrate

over the interval (0,):>

Maple treats the parameter a as a complex number. As described in Assumptions on Variables (page 106), you cancompute under the assumption that a is a positive, real number using the assuming command.
>

To compute iterated integrals, line integrals, and surface integrals, use the task templates (Tools → Tasks → Browse)
in the Multivariate and Vector Calculus folders.
The int Commandanduse the int command. To use the int command directly, specify the following arguments.

• Expression to integrate• Variable of integration
>
(5.6)

>
(5.7)

For a definite integration, set the variable of integration equal to the interval of integration.
>(5.8)

5.4 Calculus • 139

Numeric Integration
To perform numeric integration:• Use the evalf(Int(arguments)) calling sequence.
Important: Use the inertInt command, not the int command. For more information, refer to the int help page.
In addition to the arguments accepted by the int command, you can include optional arguments such as method, which
specifies the numeric integration method.
>

For information on the evalf command, see Numerical Approximation (page 287).
For information on numeric integration, including iterated integration and controlling the algorithm, refer to the evalf/Int
help page.

Calculus Packages
In addition to top-level calculus commands, Maple contains calculus packages.
VectorCalculus Package
The VectorCalculus package contains commands that perform multivariate and vector calculus operations on VectorCalculus vectors (vectors with an additional coordinate system attribute) and vector fields (vectors with additional
coordinate system and vectorfield attributes), for example, Curl, Flux, and Torsion.
>>>>

Note: For information on changing the display format in the VectorCalculus package, see the VectorCalculus[BasisFormat] help page.
Find the curl of VectorField1.
>

Find the flux of VectorField1 through a sphere of radius r at the origin.

140 • 5 Mathematical Problem Solving>

Compute the torsion of a space curve. The curve must be a vector with parametric function components.
>

For information on the assuming command, see The assuming Command (page 108).
For more information on the VectorCalculus package, including a complete list of commands, refer to the VectorCalculus help page.
To find other calculus packages, such as VariationalCalculus, refer to the index/package help page.
Student Calculus Packages
The Student package contains subpackages that help instructors teach concepts and allow students to visualize andexplore ideas. These subpackages also contain computational commands. The Student calculus subpackages include
Calculus1, MultivariateCalculus, and VectorCalculus. The Student[VectorCalculus] package provides a simple
interface to a subset of the functionality available in the VectorCalculus package.
For information on using Maple as a teaching and learning tool, including the comprehensive interactive Study Guides,
see Teaching and Learning with Maple (page 148).

Differential Equations
Maple has a powerful set of solvers for ordinary differential equations (ODEs) and partial differential equations (PDEs),and systems of ODEs and PDEs.
For information on solving ODEs and PDEs, see Other Specialized Solvers (page 89).
Student ODEs Package
The Student subpackage for ODEs has commands for computation, visualization, and step-by-step solutions, designed
to support a first year course in ordinary differential equations.

5.5 Optimization
Using the Optimization package, you can numerically solve optimization problems. The package uses fast Numerical
Algorithms Group (NAG) algorithms to minimize or maximize an objective function.
The Optimization package solves constrained and unconstrained problems.
• Linear programs• Quadratic programs• Nonlinear programs• Linear and nonlinear least-squares problems
The Optimization package contains local solvers. In addition, for univariate finitely-bounded nonlinear programs withno other constraints, you can compute global solutions using the NLPSolve command. To find global solutions generally,5.5 Optimization • 141

purchase the Global Optimization Toolbox. For more information, visit
http://www.maplesoft.com/products/toolboxes.

Point-and-Click Interface
The primary method for solving optimization problems is the Optimization Assistant.
To launch the Optimization Assistant:• From the Tools menu, select Tutors, Optimization, and then Optimization.
Maple launches the Optimization Assistant. See Figure 5.8.

Figure 5.8: Optimization Assistant

To solve a problem:
1. Enter the objective function, constraints, and bounds.
2. Select the Minimize or Maximize radio button.
3. Click the Solve button. The solution is displayed in the Solution text box.
You can also enter the problem (objective function, constraints, and bounds) in the calling sequence of the Optimization[Interactive] command.
For example, find the maximum value of

subject to the constraints>• When the Optimization Assistant opens, select Maximize, then Solve.

.

142 • 5 Mathematical Problem Solving

After finding a solution, you can plot it. To plot a solution:• In the Optimization Assistant window, click the Plot button. The Optimization Plotter window is displayed. See
Figure 5.9.
Note: When you close the Optimization Assistant, you can choose to return the solution, problem, command used,
plot, or nothing, using the drop-down in the bottom right corner of the assistant window.

Figure 5.9: Optimization Assistant Plotter Window

For information on the algorithms used to solve optimization problems, refer to the Optimization/Methods help page.

Large Optimization Problems
The Optimization Assistant accepts input in an algebraic form. You can specify input in other forms, described in
the Optimization/InputForms help page, in command calling sequences.
The Matrix form, described in the Optimization/MatrixForm help page, is more complex but offers greater flexibility
and efficiency.
For example, solve the linear program:
Maximizesubject to, where1. Define the column vector, c, of the linear objective function.

is the vector of problem variables.

5.5 Optimization • 143>>>
2. Define the matrix A, the coefficient matrix for the linear inequality constraints.
>
3. Define the column vector b, the linear inequality constraints.
>
4. The QPSolve command solves quadratic programs.
>

This example uses a random data set to demonstrate the problem. You could also read data from an external file asMatrices, and use that data. For details and an example, see Reading from Files (page 327).
Note: For information on creating matrices and vectors (including how to use the Matrix palette to easily create
matrices), see Linear Algebra (page 118).
For additional information on performing efficient computations, refer to the Optimization/Computation help page.

MPS(X) File Support
To import linear programs from a standard MPS(X) data file, use the ImportMPS command.

Optimization Package Commands
Each Optimization package command solves the problem using a different optimization method. These are describedin Table 5.9, along with the general input form for each command.

144 • 5 Mathematical Problem Solving

Table 5.9: Optimization Package Commands
Command
LPSolve
LSSolve

Description
Solve a linear program (LP), which involves computing the minimum (or maximum) of a linear
objective function subject to linear constraints; input is in equation or Matrix form
Solve a least-squares (LS) problem, which involves computing the minimum of a real-valued
objective function having the form

Maximize
Minimize
NLPSolve

QPSolve

whereis a vector

of problem variables, possibly subject to constraints; input is in equation or Matrix form
Compute a local maximum of an objective function, possibly subject to constraints
Compute a local minimum of an objective function, possibly subject to constraints
Solve a non-linear program (NLP), which involves computing the minimum (or maximum) ofa real-valued objective function, possibly subject to constraints; input is in equation or Matrix
form
Solve a quadratic program (QP), which involves computing the minimum (or maximum) of aquadratic objective function, possibly subject to linear constraints; input is in equation or Matrix
form

For a complete list of commands and other Optimization package information, refer to the Optimization help page.

5.6 Statistics
The Statistics package provides tools for mathematical statistics and data analysis. The package supports a wide rangeof common statistical tasks including quantitative and graphical data analysis, simulation, and curve fitting.
In addition to standard data analysis tools, the Statistics package provides a wide range of symbolic and numeric tools
for computing with random variables. The package supports over 35 major probability distributions and can be extended
to include new distributions.

Probability Distributions and Random Variables
The Statistics package supports:• Continuous distributions, which are defined along the real line by probability density functions. Maple supports
many continuous distributions, including the normal, Student-t, Laplace, and logistic distributions.
• Discrete distributions, which have nonzero probability only at discrete points. A discrete distribution is defined bya probability function. Maple supports many discrete distributions, including the Bernoulli, geometric, and Poisson
distributions.
For a complete list of distributions, refer to the Statistics/Distributions help page.
You can define random variables by specifying a distribution in a call to the RandomVariable command.
>>
Find the probability distribution function for X. (For information on statistics computations, see StatisticalComputations (page 145).)>

5.6 Statistics • 145

Adding Custom Distributions
To add a new distribution, specify a probability distribution in a call to the Distribution command.

>

To construct a piecewise-continuous function in 1-D Math, use the piecewise command, for example, t ->piecewise(t < 0, 0, t < 3, 1/3, 0).
Define a new random variable with this distribution.
>

Calculate the mean value of the random variable.
>

Statistical Computations
In addition to basic functions, like mean, median, standard deviation, and percentile, the Statistics package contains
commands that compute, for example, the interquartile range and hazard rate.
Example 1 - Interquartile Range
Compute the average absolute range from the interquartile of the Rayleigh distribution with scale parameter 3.
>

To compute the result numerically:• Specify the 'numeric' option.
>

Example 2 - Hazard Rate
Compute the hazard rate of the Cauchy distribution with location and scale parameters a and b at an arbitrary pointt.

146 • 5 Mathematical Problem Solving>>

You can specify a value for the point t.
>

You can also specify that Maple compute the result numerically.
>

For more information, refer to the Statistics/DescriptiveStatistics help page.

Plotting
You can generate statistical plots using the visualization commands in the Statistics package. Available plots include:• Bar chart• Frequency plot
• Histogram• Pie chart• Scatter plot
For example, create a scatter plot for a distribution of points that vary fromby a normally distributed sample.
>
>
>
>
>

by a small value determined5.6 Statistics • 147>>

To fit a curve to the data points, include the optional fit equation parameter.
Using the plots[display] command, create a plot that contains:• a scatter plot of the data points• a quartic polynomial fitted to the data points:• the function>>

148 • 5 Mathematical Problem Solving>

For more information on statistical plots, refer to the Statistics/Visualization help page.
For an overview of plotting, see Plots and Animations (page 187).

Student Statistics Package
The Student[Statistics] package helps instructors teach concepts and allows students to understand and explore concepts
in an introductory statistics course. The Student[Statistics] package provides a simple interface to a limited subset ofthe functionality available in the Statistics package, as well as some additional resources. You can create and explore
random distributions, perform hypothesis testing, and more.
The Student Statistics Example worksheet provides some starting examples.

Additional Information
For more information on the Statistics package, including regression analysis, estimation, data manipulation, and datasmoothing, refer to the Statistics help page.

5.7 Teaching and Learning with Maple
Table 5.10 lists the available resources for instructors and students. For additional resources, see Available
Resources (page 41).

5.7 Teaching and Learning with Maple • 149

Table 5.10: Student and Instructor Resources
Resource
Student Packages and Tutors

Study Guides

Description
The Student package contains computational and visualization (plotting andanimation) functionality, and point-and-click interfaces for explaining and exploring
concepts (Tools→Tutors). For more information, refer to the Student help page.
Study guides - Complete lessons with interactive examples for academic courses.
Maple includes these study guides:• Precalculus Study Guide contains worked problems, each solved as in a standard
textbook, using Maple commands and custom Maplet graphical interfaces.
• Calculus Study Guide contains worked problems, each solved as in a standard
textbook, using Maple commands and custom Maplet graphical interfaces.
• Multivariate Calculus Study Guide contains worked problems, each solved
as in a standard textbook, using Maple commands and custom Maplet graphicalinterfaces.

Teacher Resource Center

The Maple Teacher Resource Center contains resources and tips for teachers using
Maplesoft products to help in the classroom. Available resources include:• Classroom content for subjects including Precalculus, Calculus, and Engineering• Training videos• E-books

Maple Portal(http://www.maplesoft.com/TeacherResource)
The Maple Portal includes material designed for all Maple users as well as a specificportal for students. The Maple Portal includes:• How Do I... topics that give quick answers to essential questions• Tutorials that provide an overview of topics from getting started to plotting andworking with matrices• Navigation to portals with specialized information for students and engineers

Mathematics and Engineering Dictionary

Maple Application Center

Student Help Center

Access the portal the table of contents in the Maple Help System, under Getting
Started.
The Maple Help System has an integrated dictionary of over 5000 mathematics
and engineering terms. You can search the dictionary by entering a term in the Help
System search field.
The Maple Application Center contains tutorials and applications that help
instructors begin using Maple and use Maple in the classroom. Browse the many
resources by category or search for a topic.
(http://www.maplesoft.com/applications)
The Maple Student Help Center contains tutorials and applications that help students
learn how to use Maple, explore mathematical concepts, and solve problems.
Available resources include:• Free course lessons for many subjects including precalculus to vector calculus;
high school, abstract, and linear algebra; engineering; physics; differential
equations; cryptography; and classical mechanics.
• Applications for students, written by students, providing examples in many
subject areas.
• Student FAQs with answers from experts.
(https://www.maplesoft.com/studentcenter/index.aspx)

150 • 5 Mathematical Problem Solving

Student Packages and Tutors
The Student package is a collection of subpackages for teaching and learning mathematics and related subjects. The
Student package contains packages for a variety of subjects, including precalculus, calculus, and linear algebra.
Instructors can:• Teach concepts without being distracted by the mechanics of the computations.
• Create examples and quickly update them during a lesson to demonstrate different cases or show the effect of thevariation of a parameter.
• Create plots and animations to visually explain concepts, for example, the geometric relationship between a mathematical function and its derivatives (Tools→Tutors→Calculus - Single Variable→Derivatives). See Figure 5.10.

Figure 5.10: Calculus 1 Derivatives Tutor

Students can:• Perform step-by-step computations, for example, compute a derivative by applying differentiation rules using commands or a tutor (Tools→Tutors→Calculus - Single Variable→Differentiation Methods). See Figure 5.11.
• Perform computations.
• Visually explore concepts.

5.7 Teaching and Learning with Maple • 151

Figure 5.11: Calculus 1 Differentiation Methods Tutor

Tutors provide point-and-click interfaces to the Student package functionality.
To launch a tutor:
1. From the Tools menu, select Tutors.
2. Select a subject, for example, Calculus - Multivariate.
3. Select a tutor, for example, Gradients.
Maple inserts the Student[MultivariateCalculus][GradientTutor]() calling sequence (in Worksheet mode), and launches
the Multivariate Calculus Gradient Tutor.
By rotating the three-dimensional plot, you can show that the gradient points in the direction of greatest increase of
the surface (see Figure 5.12) and show the direction of the gradient vector in the x-y plane by rotating the plot (seeFigure 5.13).

152 • 5 Mathematical Problem Solving

Figure 5.12: Multivariate Calculus Gradient Tutor

Figure 5.13: Multivariate Calculus Gradient Tutor Showing x-y Plane

5.7 Teaching and Learning with Maple • 153

When you close the tutor, Maple inserts the 3-D plot.
>

Many Student package commands can return a value, mathematical expression, plot, or animation. This allows you
to compute the final answer, see the general formula applied to a specific problem, or visualize the underlying concepts.
For example, the Student[VectorCalculus][LineInt] (line integral) command can return the following.
• Plot that visually indicates the vector field, path of integration, and tangent vectors to the path
• Unevaluated line integral• Numeric value of the line integral>

154 • 5 Mathematical Problem Solving

>

>
(5.9)

To evaluate the integral returned by the output = integral calling sequence, use the value command.
>(5.10)

By default, the LineInt command returns the value of the integral.
>

For more information on the Student package, refer to the Student help page.

Calculus Problem Solving Examples
Maple is a powerful application with many resources to guide you. The following examples provide you with scenarios
to learn about using Maple resources and the Maple program.
When using Maple to solve a problem, consider the following process.
1. Formulate your problem.
2. Obtain Maple resources that allow you to solve it.

5.7 Teaching and Learning with Maple • 155

Problem
Scenario A:
Your company is designing a bottle for its new spring water product. The bottle
must contain 18 ounces of water and the height is fixed. The design includes anundulating curved surface. You know the amplitude and equation of the curve,
but you must find the radius. You require the Volume of Revolution.

Scenario B:
You want to teach your students the concept of a Volume of Revolution.
Specifically, you want to plot and compute the volume of a solid generated byrotating, about an axis or a line parallel to an axis.

Figure 5.14: Flowchart of solving a problem

Check for Existing Tools: Tutor
Begin by examining the Tools menu for a Tutor to a Volume of Revolution problem.
To access a Tutor for the Volume of Revolution:
1. From the Tools menu, select Tutors, and then Calculus-Single Variable. Notice that a Volume of Revolution tutor
exists.
2. Click the Volume of Revolution menu item. The following Maple command is entered in your document.

156 • 5 Mathematical Problem Solving>

The Volume of Revolution Tutor is displayed. See Figure 5.15. Use this tutor to enter a function and an interval,
view and manipulate the corresponding plot, and view the full Maple command associated with your entries and selections.

5.7 Teaching and Learning with Maple • 157

Figure 5.15: Volume of Revolution Tutor

After you Close the tutor, the plot is inserted into your worksheet.
Check for Existing Tools: Task Template
1. From the Tools menu, select Tasks, and then Browse. The Browse Tasks dialog opens, displaying a list of tasks
in the left pane. The tasks are sorted by subject to help you quickly find the desired task.
2. Expand the Calculus - Integral→ Applications → Solids of Revolution folder.
3. From the displayed list, select Volume. The Volume of Revolution task is displayed in the right pane of the Browse
Tasks dialog.
4. Select the Insert into New Worksheet check box.
Click Insert Default Content. Before inserting a task, Maple checks whether the task variables have assigned values
in your worksheet. If any task variable is assigned, the Task Variables dialog opens allowing you to modify the names.
Maple uses the edited variable names for all variable instances in the inserted task. The content is inserted into yourdocument. See Figure 5.16.

158 • 5 Mathematical Problem Solving

Figure 5.16: Inserted Task Template

6. When a Task Template is inserted, parameters are marked as placeholders, denoted by purple font. To navigate
between placeholders, press the Tab key. After updating any parameters, execute the command by pressing Enter.
Check for Instructions: Help Page and Example Worksheet
The help system provides command syntax information.
To access a help page:
1. From the Help menu, select Maple Help.
2. In the search field, enter volume of revolution and click Search. The search results include the command help
page, the dictionary definition, and the associated tutor help page.
3. Review the calling sequence, parameters, and description in the Student[Calculus1][VolumeOfRevolution] help
page.
4. Copy the examples into your worksheet: from the help system Edit menu, select Copy Examples.
5. Close the Help Navigator.
6. In your document, from the Edit menu, select Paste. The examples are pasted into your document.
7. Execute the examples and examine the results.
To access an example worksheet:
1. In the worksheet, enter examples/index. The Examples and Applications Index opens.
2. Expand the Calculus topic.
3. Click the examples/Calculus1IntApps link. The Calculus1: Applications of Integration worksheet opens. See
Figure 5.17.
4. Expand the Volume of Revolution topic.
5. Examine and execute the examples.

5.7 Teaching and Learning with Maple • 159

Figure 5.17: Example Worksheet

Check for Other Ready-To-Use Resources: Application Center
The Maple Application Center contains free user-contributed applications related to mathematics, education, science,engineering, computer science, statistics and data analysis, finance, communications, graphics, and more.
To access a free application for volume of revolution:
1. Go to the Maplesoft website, http://www.maplesoft.com.
2. In the menu of the main webpage, click Support & Resources, and then Maple Application Center.
3. In the Application Search section, enter Volume of Revolution in the Keyword or phrase field.

4. Click Search.
5. From the search results page, under Displaying applications, click the Click here link.
6. From the list of archived applications, select any of the Maple document you want to view.
7. Click on the Download Maple Document link to download the .mw file.

160 • 5 Mathematical Problem Solving

8. Execute the worksheet and examine the results.

TM

5.8 Clickable MathFor years, Maple has led the way in making math software easy to use. With its collection of Clickable MathTM tools,
including palettes, interactive assistants, context-sensitive operations, tutors, and more, Maple has set the standard formaking it easy to learn, teach, and do mathematics.
The Study Guides are a core feature of our Clickable Math resources. These are described in Teaching and Learningwith Maple (page 148).
In addition, two key features of the Clickable Math tool collection are Smart Popups and Drag-to-SolveTM.

Smart Popups
Smart Popups are interactive popup options that are invoked when you select certain types of equations, expressions
or subexpressions.
With Smart Popups you can:• Select operations to apply to just one part of your equation or mathematical expression, leaving the rest unchanged.
• Preview the result of the operation before going ahead.
• Explore your expression to deepen your understanding of the problem.
• Easily determine if your subexpression can be factored, what its plot looks like, what mathematical identities could
be applied, and more.
Smart popups, if any, are shown at the top of the Context Panel. For more information on Smart Popups, as well as
examples, see the Clickable Math: Smart Popups help page.

Drag-to-Solve
The Drag-to-Solve feature enables you to solve your equations step-by-step by dragging terms to where you want them
to be.
With Drag-to-Solve you can:• Easily take complete control over each individual step of your calculation.
• Let Maple apply the appropriate addition, subtraction, division, or multiplication operation to both sides of yourequation, to avoid mechanical errors.
• Keep the full record of steps produced by Maple to document your work.
For more information on Drag-to-Solve, as well as examples, see the Clickable Math: Drag-to-Solve help page.

5.8 Clickable MathTM • 161

ExamplesThis chapter is designed to show several ways to solve the same problem in Maple. Throughout these examples, youwill need to insert new document block regions. This is done using the Create document block icon ( ) on the toolbar
or through the Edit menu, by selecting Document Blocks>Create Document Block. Also, these examples only give
the keyboard keys needed for a Windows operating system. Refer to Shortcut Keys by Platform (page xiii) for the keys
needed for your operating system.
Example 1 - Graph a Function and its Derivatives
On the interval, graph

,

, and

for

.

We solve this problem using the following methods:• Solution by Context-Sensitive Operations (page 161)
• Solution by Tutor (page 163)
• Access the Tutor from a Task Template (page 165)
Solution by Context-Sensitive Operations
Action1. Enter the expression

Result in Document.

Make a copy of the expression and calculate the derivative:
2. Insert a new document block region by selecting from theFormat menu Create Document Block.
3. Highlight the original expression. Ctrl + drag the expression
to the new document block.
4. Select the expression and, from the Context Panel selectDifferentiate → With Respect To → x.
Make a copy of the derivative and calculate the second
derivative:
5. Insert a new document block, and Ctrl + drag the derivative
to the document block.
6. From the Context Panel for the derivative, selectDifferentiate → With Respect To → x.

162 • 5 Mathematical Problem Solving

ActionPlot the original expression:
7. Insert a new document block, and Ctrl + drag the original
expression to the new block.
8. From the Context Panel for the expression, select Plots →2-D Plot.
9. Modify the plot through the Context Panel: select Axes →Properties.
10. In the Axis Properties dialog, de-select Use data extents
and change the range to -3.14 to 3.14. Click OK.

Add the first and second derivatives to the plot:
11. Select and then Ctrl + drag the derivative of the expression
onto the plot region. Do the same for the second derivative.

Result in Document

5.8 Clickable MathTM • 163

ActionEnhance the plot by adding a legend:

Result in Document

12. From the Context Panel for the plot region, select Legend→ Show Legend.
13. In the legend, double-click Curve 1. Notice that the Text
icon is selected in the toolbar,. Delete the text andselect the Math icon in the toolbar,. This allows
you to enter 2-D Math in a text region. Enter the original
expression,
14. Repeat for Curve 2 and Curve 3.
Add a title:
15. From the Context Panel, select Title → Add Title.
Replace the text New title with the text "Plot the expression".
16. Click the Math icon, and enter the expression
Click the Text icon once again and enter " and its
derivatives".

.

Solution by Tutor
The Student Calculus 1 package contains a tutor called Derivatives, which displays a plot of the expression alongwith its derivatives. In this example, we solve the same problem as previously, using this tutor
Action1. Load the Student Calculus 1 package. From theTools menu, select Load Package → Student
Calculus 1.
2. Ctrl + drag the expression
document block region.

to a blank

Result in Document
Loading Student:-Calculus1

164 • 5 Mathematical Problem Solving

ActionResult in Document
3. From the Context Panel for the expression, selectStudent Calculus 1 → Tutors → Derivatives. Note:
The Student Calculus 1 menu is now available in
the Context Panel because we loaded the package instep 1.
In the Derivative Tutor, the color swatch shown besidethe original expression is the color used for the curve inthe plot region. Similarly for
and.
4. Change the lower endpoint to -Pi. Select the checkbox to display
in the plot. Click Display tomake these changes take effect.

5. You can change the expression and modify plot
options from within this tutor. For each change made,click Display to view the altered plot. When complete,
click Close to display the resulting plot in the
document.

5.8 Clickable MathTM • 165

Access the Tutor from a Task Template
Maple also comes with a Task Template to solve this problem without using any commands.
Action1. Launch the Task Template Browser by selecting Tools →Tasks → Browse.
2. In the table of contents of the Task Browser dialog, selectCalculus -Differential→ Derivatives → Graph
its Derivatives.

and

3. Click Insert Minimal Content at the top of the dialog to insert
the task template into the current document.

4. Enter the new expression
5. Enter the intervalin the f(x) region.
. To insert the symbol for pi, you

can use command completion or selectSymbols palette.

from the Common

Result in Document

166 • 5 Mathematical Problem Solving

ActionResult in Document
6. Click Launch Differentiation Tutor to launch the same tutor
as in the previous solution.
7. When complete, click Close. A plot of the expression and its
derivatives displays in the plot region of the inserted task
template.

Example 2 - Solve for x in a Quadratic Equation
Solve forin the equation.

We solve this problem using the following methods:• Solution through Equation Manipulator (page 166)
• Instant Solution (page 168)
• Step-by-step Interactive Solution (page 168)
• Graphical Solution (page 169)
• Graphical Solution Using Smart Popups (page 171)
Solution through Equation Manipulator
Maple provides a dialog that allows you to single-step through the process of manipulating an expression. This manipulator is available from the Context Panel.

5.8 Clickable MathTM • 167

Action1. Enter the equation
in a newdocument block region.
2. From the Context Panel for this equation, select Manipulate
Equation. The Manipulate Equation dialog displays.

Group all of the terms to the left:
3. In the Addition region, the Group terms row allows you togroup terms on a specified side. With the left side alreadyselected, click Do.

Expand the left side of the equation:
4. In the Miscellaneous Operations region, we can manipulate
the equation by applying a command from the drop-downmenus. Since we want to expand the left side of the equation
only, click the first drop-down menu in the second row andselect expand. Click Do. Note: This example is carried out
with no assumptions. You can assume the solution to be real,positive, nonnegative or integer from the drop-down menu.

Result in Document

168 • 5 Mathematical Problem Solving

ActionFactor the equation:

Result in Document

5. From the same drop-down menu, select factor and click Do.
6. Click Return Steps to close the dialog and return all of thesteps to the Maple document.

7. Ctrl + drag the factored form of the original equation to a new
document block region.
8. From the Context Panel, select Solve → Obtain Solutions
for → x.
Or,
Alternatively, click on the output from step 6 and select Solve→ Obtain Solutions for → x in the Context Panel.

Instant Solution
To apply an instant solution to this problem, use the Context Panel.
Action
1. Ctrl + drag the equation

Result in Document

to a newdocument block region.
2. From the Context Panel for the expression, select Solve →Obtain Solutions for → x.

Step-by-step Interactive Solution
This equation can also be solved interactively in the document, by applying context-sensitive operations or commands
one step at a time.
Action
1. Ctrl + drag the equation

Result in Document
to a blankdocument block region.
Group all terms on the right:
2. From the Context Panel for this equation, select Move to
Right.

Expand the expression on the right-hand side:
3. From the Context Panel for this output (or Ctrl + drag theequation to a blank document block region), select Right-handside.
4. From the Context Panel for this result, select Expand.

(5.11)

5.8 Clickable MathTM • 169

ActionResult in Document
Use Maple's factor command on the resulting right-hand side:
5. From the Context Panel for the result, select Right-hand Side.
6. From the Context Panel for the result, select Factor.
Solve for x:
7. From the Context Panel for the result, select Solve → Obtain
Solutions for → x.

Graphical Solution
Now that we have seen several methods to solve this problem, we can check the answer by plotting the expression.
Action
1. Ctrl + drag the equation

Result in Document
to a newdocument block region and press Enter.

First, manipulate the equation to become an expression:
2. Select the output and from the Context Panel select Move to
Left.
Note the difference in the alignment when using context-sensitive
operations on output rather than input. The result is centered in
the document with the self-documenting arrow positioned at theleft.

170 • 5 Mathematical Problem Solving

ActionResult in Document
3. Select the output and from the Context Panel select Left-handSide.

4. Select the output and from the Context Panel select Expand.

Now that the equation is in its simplest form, plot the result:
5. Ctrl + drag the output to a new document block.
6. From the Context Panel for thee expression select Plots →2-D Plot.
Or,
Right-click the output from step 4 and select Plots → 2-D Plot.

5.8 Clickable MathTM • 171

ActionChange theResult in Document- and- axis ranges using the Context Panel:

7. By default, the plot uses a range chosen to fit the key featuresof the graph. To better see the -intercepts, change the range:from the Context Panel, select Axes → Properties. In the
Horizontal tab of the Axes Properties dialog, clear the Usedata extents check box and change the Range min and Range
max to 0 and 5, respectively.
Click the Vertical tab and clear the Use data extents checkbox. Change the Range min and Range max to -5 and 10,
respectively.
8. Click OK to apply the changes and return to the plot.
The interception points of this graph with the -axis are 1 and3, the same solutions that we found previously.

Graphical Solution Using Smart Popups

Use Smart Popup menu options to find a graphical solution.
Copy the equation
to a newdocument block region and press Enter.

(5.12)

Highlight the right-hand side of the output expression. Smart
popups are shown in the top of the Context Panel.

Select the Subtract menu option.

The results of the calculation are displayed in the document.
(5.13)(5.14)

Select the left side of the equation. A smart popup window isdisplayed.

172 • 5 Mathematical Problem Solving

Select normal. The results of the calculation are displayed in the
document.
(5.15)(5.16)(5.17)

Once again, select the left side of the equation. A smart popup
window is displayed. Select 2D plot.
The resulting plot is displayed in the document.
(5.18)(5.19)(5.20)

You can also solve the equation using smart popups. Highlightthe simplified equation and from the Smart Popup menu, selectsolve.

5.8 Clickable MathTM • 173

The solution to the equation is displayed.

(5.21)

Example 3 - Solve a Quadratic Trig Equation
Find all of the solutions to the equationin the interval

We solve this problem using the following methods:• Graphical Solution (page 173)
• Solution by Task Template (page 175)
• Analytic Solution (page 175)
Graphical Solution
ActionResult in Document

1. Ctrl + drag the equationa blank document block.

to

2. From the Context Panel for the equation, select Left-handSide.
3. Click the output and select Plot Builder in the Context Panel.
A plot appears. In the Plot Builder panel, in the plot type list,
the initally selected plot type is 2-D plot.

4. Modify the plot range to

to

.

.

174 • 5 Mathematical Problem Solving

Action5. Click Plot to display the plot in the document.
6. From the graph, we can see all of the solutions within theinterval. To approximate the values, click the plot,
select the type of coordinates that you want to view from theselection menu () in the toolbar, and then use the pointprobe tool to view the coordinates of the mouse pointer.

Result in Document

5.8 Clickable MathTM • 175

Solution by Task Template
Action1. From the Tools menu, select Tasks → Browse.
Expand the Algebra folder and select Solve
Analytically in a Specified Interval.

Result in Document

2. Click Insert Minimal Content.

3. Replace the current equation with the one from thisexample,, and thenexecute the commands. Notice that equation labels areused to reference the results.

Analytic Solution
Action
1. Ctrl + drag the equationa blank document block region.

Result in Document
to

2. From the Context Panel, select Left-hand Side.

3. From the Context Panel, select Factor.
4. Click the new factored output and select Solve → Solve in theContext Panel.

Alternatively, you can select each factor, Ctrl + drag theexpressions to separate document block regions and for each one
select Solve → Solve.

=

176 • 5 Mathematical Problem Solving

Example 4 - Find the Inverse Function
If, find and graph the rule for, its functional inverse.

We solve this problem using the following methods:• Implement the Definition Graphically (page 176)
• Solution by Tutor (page 179)
Implement the Definition Graphically
The graph of the inverse function is the set of ordered pairs formed by interchanging the ordinates and abscissas.
ActionResult in Document

1. In a blank document block, enter
Enter.

and press

2. Click the output and select Plot Builder in the Context
Panel. In the Plot Builder panel select 2-D plot
(parametric) for the plot type.
The plot appears.

3. Adjust the domain forto the interval.

5.8 Clickable MathTM • 177

Action4. Copy and paste the expression

Result in Document
onto this graph.

Notice that the axis ranges alter.

5. Copy and paste the expression
resulting graph shows,

onto this graph. The, and the line.

178 • 5 Mathematical Problem Solving

ActionAdjust the

Result in Document

andaxis ranges:

6. Select the plot and from the Plot menu, select Axes →Properties.
7. In the Axis Properties dialog, de-select Use data extents
and change the range to 0 to 2.
8. Click the Vertical tab and repeat step 9. Click OK to
apply these settings and close the dialog.

5.8 Clickable MathTM • 179

ActionResult in Document

Solution by Tutor
ActionResult in Document
1. Load the Student Calculus 1 package. From the Tools Loading Student:-Calculus1
menu, select Load Package → Student Calculus 1.
2. Enter the expression

in a blank document block.

3. From the Context Panel, select Student Calculus 1 →Tutors → Function Inverse. The Function Inverse
Tutor displays.
4. Adjust the domain to.

180 • 5 Mathematical Problem Solving

Action5. When you are finished, click Close. The plot of thefunction, its inverse, and the line
is returned tothe document.

Result in Document

Example 5 - Methods of Integration - Trig Substitution
Evaluate the integral

by making the substitution.

We solve this problem using the following methods:• Immediate Evaluation of the Integral (page 180)
• Solution by Integration Methods Tutor (page 181)
• Solution by First Principles (page 182)
Immediate Evaluation of the Integral
Action1. Enter the integral

Result in Document
in a blank document block

region.
2. From the Context Panel for the expression and select Evaluate
and Display Inline.

=5.8 Clickable MathTM • 181

Solution by Integration Methods Tutor
ActionResult in Document

Loading Student:-Calculus1
1. Load the Student Calculus
1 package. From the Tools
menu, select Load Package→ Student Calculus 1.

2. Ctrl + drag the integrandto a blankdocument block region.
3. From the Context Panel,select Student Calculus 1 →Tutors → Integration
Methods. The Integration
Methods Tutor displays.

4. Perform a change of variables
by selecting Change andentering x = 2*sin(u).

182 • 5 Mathematical Problem Solving

Action5. Apply the constant rule byclicking Constant.

Result in Document

6. To revert back to the originalvariable, click Revert.

7. Now that the integral has
been evaluated, click Closeto close the tutor and returnthe evaluated integral to the
document.

(5.22)

Solution by First Principles
Action
1. Ctrl + drag the integrandResult in Document
to a blank document

block region and press Enter.

Perform trig substitution:
2. From the Context Panel for the output, select Evaluate at apoint. In the dialog that displays, enter 2*sin(u).
3. From the Context Panel for the output, select Simplify →Symbolic.
(5.23)

5.8 Clickable MathTM • 183

ActionCalculate

Result in Document:

4. In a blank document block, enter the substitution equation:and press Enter.
5. From the Context Panel for the output, select Differentiate→ Implicitly. In the dialog that displays, change theDependent Variable to x and change Differentiate withrespect to to u.
Calculate the integral in terms of(5.24):

6. Referencing the results by their equation labels, multiply theoriginal simplified expression by this derivative.

(5.25)

7. Integrate the resulting expression.
(5.26)

Revert the substitution:
8. Place the equation
in a blank document block.
Delete and insert the equation label for the previous result,the value of the integral in terms of
Press Enter.
9. From the Context Panel for the output, select Solve → Solvefor Variable → u.
The solution is.

Example 6 - Initial Value Problem
Solve and plot the solution of the initial value problem

184 • 5 Mathematical Problem Solving

Solution by ODE Analyzer Assistant
The ODE Analyzer Assistant lets you solve ODEs numerically or symbolically and displays a plot of the solution.
ActionResult in Document
1. Enter the ODE in a blankdocument block region.
2. Select the equation andfrom the Context Panel,select Solve DE
Interactively. The ODE
Analyzer Assistantdisplays with the ODE
automatically inserted.

To insert the initialconditions:
3. In the Conditions region,
click Edit. The Edit
Conditions dialog opens.

4. In the Add Condition
region, with y selected in
the drop-down menu,
enter 0 in the first text
field to the right and 2 inthe second text field. Click
Add. Your entry shouldmatch the one shown to
the right.

5.8 Clickable MathTM • 185

ActionResult in Document
5. To enter the initialcondition for , select y'from the drop-down menu.
In the text fields, enter 0
and -1. Click Add.
Click Done to close this
dialog and return to the main
dialog. Notice that the initialconditions are in theConditions section.
6. Click Solve Numerically.
A new dialog appears.

7. Click Solve to solve theinitial value problem.
8. Click Plot to plot thesolution of the DE.

9. Click the Plot Options
button to modify thedefault graph, if desired.
10. Click Quit to close the
ODE Analyzer and return
a plot of the solution to the
document.

186 • 5 Mathematical Problem Solving

6 Plots and Animations
Maple can generate many forms of plots, allowing you to visualize a problem and further understand concepts.
• Maple accepts explicit, implicit, and parametric forms to display 2-D and 3-D plots and animations.
• Maple recognizes many coordinate systems.
• All plot regions in Maple are active; therefore, you can drag expressions to and from a plot region.
• Maple offers numerous plot options, such as axis styles, title, colors, shading options, surface styles, and axis ranges,
which give you complete control to customize your plots.
For a reference to the types of plots available in Maple, see the Plotting Guide.

6.1 In This Chapter
SectionTopicsCreating Plots (page 187) - Interactive and command-driven methods • Interactive Plot Builder
to display 2-D and 3-D plots• Context Panel• The plot and plot3d Commands• The plots Package• Multiple Plots in the Same Plot Region
Customizing Plots (page 209) - Methods for applying plot options
before and after a plot displays• Interactive Plot Builder Options• Context Panel Options• The plot and plot3d Command Options• Point Probe

Analyzing Plots (page 215) - Plot analyzing tools• Rotate• Pan• ZoomRepresenting Data (page 216) - Templates for visual representation • The Live Data Plots Paletteof your data
Creating Animations (page 216) - Interactive and command-driven • Interactive Plot Builder
methods to display animations• The plots[animate] Command• The plot3d[viewpoint] Command• Animation Context Bar

Playing Animations (page 221) - Tools to run animations

Customizing Animations (page 222) - Methods for applying plot options • Interactive Plot Builder Animation Options
before and after an animation displays• Context Menu Options• The animate Command Options• Saving Plots to File Formats

Exporting (page 224) - Methods for exporting plots

6.2 Creating Plots
Maple offers several methods to easily plot an expression. These methods include:• The Interactive Plot Builder• The context panel• Commands

187

188 • 6 Plots and Animations

Each method offers a unique set of advantages. The method you use depends on the type of plot to display, as well as
your personal preferences.

Interactive Plot Builder
The Interactive Plot Builder is a point-and-click interface to Maple plotting functionality . The interface displays plot
types based on the expression you specify. Depending on the plot type you select, you can create a:• 2-D / 3-D plot
• 2-D polar plot
• 2-D / 3-D contour plot
• 2-D / 3-D conformal plot of a complex-valued function• 2-D / 3-D complex plot
• 2-D / 3-D parametric plot
• 2-D density plot
• 2-D / 3-D implicit plot
• 2-D inequality plot
• 3-D spacecurve• 2-D animated curve• 2-D / 3-D plot of multiple expressions• 2-D / 3-D exploration of a plot with one or more interactive parameters (sliders)6.2 Creating Plots • 189

Launching the PlotBuilder
Context Panel Access
The Plot Builder can be launched using the context panel for an expression.
Click on the expression you'd like to plot and from the context panel select Plot Builder. In this case, the Plot Builder
Panel opens.

190 • 6 Plots and Animations

This is equivalent to calling the PlotBuilder command on the expression.
Assistants Access
The Plot Builder can also be accessed from the Standard Menu Bar, under Tools -> Assistants.
When launched in this way, an interactive dialog is displayed where you can enter the expression to be plotted. Thisis equivalent to calling the PlotBuilder command with no arguments.
Note: The Tools menu also offers tutors to easily generate plots in several academic subjects. For more information,
see Teaching and Learning with Maple (page 148).

Example 1 - Display a plot of a single variable expression

Maple can display two-dimensional graphs and offers numerous plot options such as color, title, and axis styles tocustomize the plot.
Enter an expression:
1. Type the expression sin(x)/x.

6.2 Creating Plots • 191

From the Context Panel, select the Plot Builder:
2. From the Context Panel for the expression, select Plot Builder. The Plot Builder inserts plot component, with a plotof the expression, into the worksheet, and the Context Panel shows the Plot Builder options.

3. The automatically selected plot type for this expression is 2-D plot, and the panel is now populated with the available
plotting options for a 2-D plot.

4. Ensure that the x-axis range is from.

When you return focus to your worksheet, you'll no longer see the Plot Builder controls. To make further modifications,click the output region of the displayed plot in the worksheet to again view the plot builder controls on the right.
Note: You can toggle the show command option to view the Maple syntax used to generate this plot.
Example 2 - Display a plot of multiple expressions in 1 variable
Maple can display multiple expressions in the same plot region to compare and contrast. The Interactive Plot Builder
accepts multiple expressions.
Launch the Interactive Plot Builder and enter the expressions:
If the PlotBuilder is passed a list, set, or sequence containing multiple expressions then the context panel becomes
automatically populated with a thumbnail view. The common plot type for expressions in a single unknown is a 2-D
curve, and for expressions in two unknowns it is a 3-D surface plot.
As an example, use the PlotBuilder to plotand.

192 • 6 Plots and Animations>
Notice in the PlotBuilder window, from the thumbnail view you can change the common plot type for all expressions
using the ListBox menu. You can select any individual thumbnail plot to change its associated properties or its own
plot type in the PlotBuilder's usual individual plot view.
By default, Maple displays each plot in a plot region using a different color. You can also apply a line style such as
solid, dashed, or dotted for each expression in the graph. For more information, refer to the plot/options help page.
To see the Maple syntax used to generate this plot, see Maple commands from Creating Plots: Interactive Plot
Builder (page 195)
Example 3 - Display a plot of a multivariate expression
Maple can display three-dimensional plots and offers numerous plot options such as light models, surface styles, andshadings to allow you to customize the plot.
Enter an expression, then launch the Interactive Plot Builder from the context panel:
1. Enter the expression (1+sin(x*y))/(x^2+y^2).
2. Launch the Plot Builder from the context panel.
In the Select Plot Type list:
3. Notice the available plot types for an expression with 2 variables, as well as the plot objects for each type. For thisexample, select 3-D plot.
4. Select Basic Options from the list of option types.
Restricting how much of the plot axes to display:
5. For the view option, select axis[3] to adjust how much of the z-axis to display. Enter the range values in the twoboxes. You can repeat this for the y-axis (axis[2]) and x-axis (axis[1]) as well.
Style and color changes:
6. From the Style combo box, select surface.
7. From the shading and color list box select shading, then select z (grayscale) from the color list box.
8. Select the Axes and Text menu.
9. In the text box next to label, enter z.
10. Select the 3-D Options menu
11. In the text box beside grid size, enter 40,40.
Note: You can toggle the show command option to view the Maple syntax used to generate this plot.
Example 4 - Display a conformal plot
Maple can display a conformal plot of a complex expression mapped onto a two-dimensional grid or plotted on the
Riemann sphere in 3-D.
Enter an expression, then launch the Interactive Plot Builder from the context panel:
1. Enter the expression z^3.
2. Launch the Plot Builder from the context panel.
3. Select 2-D conformal plot as the plot type.
4. Change the range of the z parameter to 0 .. 2+2*I.

6.2 Creating Plots • 193

5. From the axes style box, ensure normal is selected.
6. Select 2-D Options from the plot options list box, then enter [30,30] as the grid size.
Example 5 - Display a plot in polar coordinates
Cartesian (ordinary) coordinates is the Maple default. Maple also supports numerous other coordinate systems, including
hyperbolic, inverse elliptic, logarithmic, parabolic, polar, and rose in two-dimensions, and bipolar cylindrical, bispherical, cylindrical, inverse elliptical cylindrical, logarithmic cosh cylindrical, Maxwell cylindrical, tangent sphere, andtoroidal in three-dimensional plots. For a complete list of supported coordinate systems, refer to the coords help page.
Enter an expression, then launch the Interactive Plot Builder from the context panel:
1. Enter the expression 1+4*cos(4*theta).
2. Launch the Plot Builder from the context panel.
Select the plot type and change the x-axis range:
3. Select 2-D polar plot as the plot type.
4. Change the angle of theta to 0 .. 8*Pi.
Change the plot color:
5. From the color group box, select magenta.
Note: You can toggle the show command option to view the Maple syntax used to generate this plot.
Example 6 - Interactive plotting
In this example, we'll make an animation of, as t goes from 1 to 10.

Enter an expression, then launch the Interactive Plot Builder from the context panel:
1. Enter the expression x+3*sin(x*t).
2. Launch the Plot Builder from the context panel.
Select animation.
3. Select the toggle button for animation.
4. The animation parameter is given under the animation toggle button. By default, this will animate as t goes from 1
to 10. (Note, if you wanted to animate over another variable, use this to specify that.
5. Set the x range to 0 to 5.
6. Click Build Animation.
Play the animation.
7 To play the animation, click the plot and the from the Animation Toolbar, select Play ( ). For information on
playing the animation, see Playing Animations (page 221).
Alternatively, you can use the exploration option in the Plot Builder to build an interactive plot with a parameter thatyou operate with a slider. For more about explorations, see Exploration Assistant (page 30).

Context Panel
The context panel is a collection of tools and operations that are appropriate for a particular expression. The plotting
options in the context panel change according to the expression, table, or region that you click on.

194 • 6 Plots and Animations

One advantage of using the context panel is the simplicity of creating an expression using the tools and operations in
the panel. By using this method, you do not need any knowledge of plot command syntax.
1. Enter and evaluate an expression, for example,
2. Click the expression.
3. From the context panel, select Plots → 3-D Plot → x,y.
>

(6.1)

Figure 6.1: Plot an Expression Using the Context Panel

For information on customizing plots using the context menu, see Context Panel Options (page 210).

The plot and plot3d Commands
The final method for creating plots is entering plotting commands.
The main advantages of using plotting commands are the availability of all Maple plot structures and the greater control
over the plot output. Plot options are discussed in Customizing Plots (page 209).
Table 6.1: The plot and plot3d Commands
plot(plotexpression, x=a..b, ...)
plot3d(plotexpression, x=a..b, y=a..b, ...)• plotexpression - expression to be plotted• x=a..b - name and horizontal range• y=a..b - name and vertical range
Note: It's possible to not specify the ranges for the variables, in which case Maple determines a reasonable domain.

6.2 Creating Plots • 195

Maple commands from Creating Plots: Interactive Plot Builder
Example 1 - Display a plot of a single variable expression>

Example 2 - Display a plot of multiple expressions in 1 variable
To display multiple expressions in a plot, include the expressions in a list. To enter
the Expression palette. For more information, see Palettes (page 15).

and

use

196 • 6 Plots and Animations>

6.2 Creating Plots • 197

Example 3 - Display a plot of a multivariable expression>

Example 4 - Display a conformal plot
A collection of specialized plotting routines is available in the plots package. For access to a single command in a
package, use the long form of the command.

198 • 6 Plots and Animations>

6.2 Creating Plots • 199

Example 5 - Display a plot in polar coordinates>200 • 6 Plots and Animations

Example 6 - Interactive Plotting>

To play the animation, click the plot and the from the Animation Toolbar, select Play ( ). For information on playing
the animation, see Playing Animations (page 221).
For more information on the plot options used in this section, refer to the plot/options and plot3d/options help pages.
Display a Parametric Plot
Some graphs cannot be specified explicitly. In other words, you cannot write the dependent variable as a function of
the independent variable,
One solution is to make both the x-coordinate and the y-coordinate depend on aparameter.

6.2 Creating Plots • 201>

Display a 3-D Plot
Maple can plot an expression of two variables as a surface in three-dimensional space. To customize the plot, include
plot3d options in the calling sequence. For a list of plot options, see The plot and plot3d Options (page 213).

202 • 6 Plots and Animations>

The plots Package
The plots package contains numerous plot commands for specialized plotting. This package includes: animate, contourplot, densityplot, fieldplot, odeplot, matrixplot, spacecurve, textplot, tubeplot, and more. For details about
this package, refer to the plots help page.
>The pointplot Command
To plot numeric data, use the pointplot command in the plots package with the data organized in a list of lists structureof the form
By default, Maple does not connect the points. To draw a line throughthe points, use the style = line option. For further analysis of data points, use the Curve Fitting Assistant(Tools→Assistants→CurveFitting), which fits and plots a curve through the points. For more information, refer tothe CurveFitting[Interactive] help page.

6.2 Creating Plots • 203>

The matrixplot Command
The matrixplot command plots the values of a plot object of type Matrix. The matrixplot command accepts options
such as heights and gap to control the appearance of the plot. For more information on Matrices, see Linear
Algebra (page 118).
>

204 • 6 Plots and Animations

>

>

>

6.2 Creating Plots • 205

The contourplot Command
The contourplot command generates a topographical map for an expression or function. To create a smoother andmore precise plot, increase the number of points using the numpoints option.

206 • 6 Plots and Animations>

Place your pointer over the graph to see the contour labels.

Multiple Plots in the Same Plot Region
Dragging to a Plot Region
To add an additional curve to an existing plot region, use the drag-and-drop method.
Advantages of the drag-and-drop method include the ease of adding and removing plots and the independence fromplotting command syntax.
Example:1. Enter the commandin an input region.

2. Execute.
3. Enter the expression

in an input region.

4. Drag the expression onto the plot of. When dragging an expression to a plot region, you can either make a copy of theexpression from the input region or you can cut the expression, thereby removing it from the input region. To make a copy ofthe expression, select the full expression in the input region and press Ctrl (Command, Macintosh) while you drag the expression
to the plot region. To cut the expression and paste it in the plot region, highlight the expression and drag it to the plot region.
4. Repeat steps 3 and 4 using the following expressions:and.

6.2 Creating Plots • 207

Tip: To remove an expression from the plot region, drag-and-drop the expression plot from the plot region to a Maple input region.

List of Expressions
To display multiple expressions in the same plot region, enter the expressions in a list data structure. To distinguishthe surfaces, apply different shading options, styles, or colors to each surface.

208 • 6 Plots and Animations>

The display Command
To display different types of plots in the same plot region, use the display command in the plots package.
This example plots a curve over a hill with the shadow of the curve projected onto the hill.
>>>>
Maple can draw curves in three-dimensional space.
>>>6.3 Customizing Plots • 209>

6.3 Customizing Plots
Maple provides many plot options to display the most aesthetically pleasing, illustrative results. Plot options include
line styles, colors, shadings, axis styles, and titles where applicable. Plot options are applied using the Interactive Plot
Builder, the context menus, or as options in the command syntax.

Interactive Plot Builder Options
The Interactive Plot Builder offers most of the plot options available in Maple in an easy-to-use interface.
Example:Enter the expression, then launch the Plot Builder from the context panel:
1. Enter the expression 2*x^5-10*x^3+6*x-1.
2. Launch the Plot Builder from the context panel. For information on interacting with the Interactive Plot Builder, see Example
1 - Display a plot of a single variable expression (page 190).
Set the x-axis range:
3. Select 2-D Plot as the plot type.
4. Change the x-axis range to -2 .. 2.

210 • 6 Plots and Animations

In the Basic Options window:
5. From the line style list box, select dot.
6. From the color list box, select blue.
7. From the axes style list box, select frame.
In the Axes and Text window:
8. In the text field beside title, enter My Plot.

Context Panel Options
Using the options in the context panel, you can alter a plot by clicking the plot output. You can also access a large
subset of plot options using the Plot toolbar and Plot menu options. These menus display when a plot region is selected.
Regardless of the method used to insert a plot into Maple, you can use the context menu to apply different plot options.
For a list of options available when plotting in two and three dimensions, see The plot and plot3d Options (page 213).
2-D Plot Options
Consider this example:>

There is a singularity at x = 1. What are the and -intercepts? It's hard to see in the current view. If you change therange, the locations of the intercepts are easier to see.

6.3 Customizing Plots • 211

Alter the y-axis range:
1. Click the plot region. From the context panel, select Axes, and then Properties.
2. In the Axes Properties dialog, click the Vertical tab.
3. Clear the Use data extents check box and enter -2 and 5 in the Range min and Range max text regions, respectively.
4. Click Apply to view the changes, or OK to return to the document.
Change the color:
5. Click on the curve. Note: The curve is selected when it becomes highlighted.
6. Select Color, and then Green.
Note: The Niagara colors listed form the default color palette in Maple.
Change the line style:
7. Select Line, and then Dash.

The-intercept is at x=-2, and the-intercept is at y=2. This can be verified using the equation.

3-D Plot Options
By default, Maple displays the graph as a shaded surface with a wireframe and scales the plot to fit the window. To
change these options, use the context menu.

212 • 6 Plots and Animations>

Maple has many preselected light source configurations.
Change the style:
1. Click the plot region. From the context panel select Style → Surface. The wireframe is removed.
Apply a light scheme:
2. Select Lighting → Light 1.
Change the axes style:
3. Select Axes → Boxed.

6.3 Customizing Plots • 213

Alter the glossiness:
4. Select Glossiness and then select Set.... Using the slider, adjust the level of glossiness.

The plot and plot3d Options
If you are using commands to insert a plot, you can specify plot options as arguments at the end of the calling sequence.
You can specify the options in any order. Applying plot options in the command syntax offers a few more options andgreater control than what is available in the Interactive Plot Builder and the context panel.
Table 6.2: Common Plot Options
Optionaxes
captioncolor
font
glossiness (3-D)
gridlines (2-D)
lightmodel (3-D)
linestylelegend (2-D)
numpoints
scaling

Description
Defines the type of axes, one of: boxed, frame, none, or normal
Defines the caption for the plot
Defines a color for the curves to be plotted
Defines the font for text objects in the plot
Controls the amount of light reflected from the surface
Defines gridlines in the plot
Controls the light model to illuminate the plot, one of: none, light1, light2, light3, or light4
Defines the dash pattern used to render lines in the plot, one of: dot, dash, dashdot, longdash, solid,
spacedash, and spacedot
Defines a legend for the plot
Controls the minimum total number of points generated
Controls the scaling of the graph, one of: constrained or unconstrained214 • 6 Plots and Animations

Optionshading (3-D)
size (2-D)
stylesymboltitle
thicknesstransparency (3-D)
view

Description
Defines how the surface is colored, one of: xyz, xy, z, zgrayscale, zhue, or none
Specifies the size (or ratio) of the plot window
Defines how the surface is to be drawn, one of: line, point, pointline, polygon, or polygonoutline
for 2-D plots; contour, point, pointline, surface, surfacecontour, surfacewireframe, wireframe,or wireframeopaque for 3-D plots
Defines the symbol for points in the plot, one of: asterisk, box, circle, cross, diagonalcross, diamond,point, solidbox, solidcircle, or soliddiamond for 2-D plots; asterisk, box, circle, cross,diagonalcross, diamond, point, solidsphere, or sphere for 3-D plots
Defines a title for the plot
Defines the thickness of lines in the plot
Controls the transparency of the plot surface
Defines the minimum and maximum coordinate values of the axes displayed on the screen

For a complete list of plot options, refer to the plot/options and plot3d/options help pages.
>

To create a smoother or more precise plot, calculate more points using the numpoints option.

6.4 Analyzing Plots • 215>

6.4 Analyzing Plots
Point Probe, Rotate, Pan, and Zoom Tools
To gain further insight into a plot, Maple offers various tools to analyze plot regions. These tools are available in the
Plot menu, Context Bar, and in the context menu (under Manipulator and Probe Info) when the plot region is selected).
Table 6.3: Plot Context Bar Analysis Options
Name
Point probe
Selection Tool

Rotate
(3-D)
Pan

Icon

Description
Select a curve. For 2-D plots, select a coordinate type from the Selection Tool menu to display
coordinates.
Use the Selection Tool to select the information displayed in the point probe tool tooltip. You
can choose to display coordinates derived from converted pixel coordinates or data points derived
from the original data points.
Rotate a three-dimensional plot to see it from a different point of view.

Pan the plot by changing the view ranges for 2-D plots; plots are redrawn to reflect the new view.
Change the position of the plot in the plot region for 3-D plots.

216 • 6 Plots and Animations

Name
Zoom in

Icon

Zoom out
Reset view

Description
Zoom into the plot; plots are redrawn to reflect the new view. Also, scale the plot by placing thepointer over the plot and then rotating the wheel button.
Zoom into a selected region by using a click-and-drag operation to select a rectangle.
Zoom out of the plot; plots are redrawn to reflect the new view. Also, scale the plot by placing
the pointer over the plot and then rotating the wheel button.
Reset the view to the default view of the plot.

6.5 Representing Data
The Live Data Plots palette has templates that allow you to represent your data in many different ways including:• Area chart• Bar chart• Box plot
• Bubble plot
• Histogram• Line chart• Pie chart• Scatter plot
After you select a type of plot, an interactive environment allows you to change a number of options to refine the lookof your plot. As you refine your plot, Maple automatically updates the plot command with your options.
If the Live Data Plots palette is not displayed in the palette dock, right-click on the palette pane, and select Show
Palette, and then Live Data Plots.

6.6 Creating Animations
Animations allow you to emphasize certain graphical behavior, such as the deformation of a bouncing ball, more clearly
than in a static plot. A Maple animation is a number of plot frames displayed in sequence, similar to the action of movie
frames. To create an animation, use the Interactive Plot Builder or commands.

Interactive Plot Builder
Creating Animations Using the Interactive Plot Builder:Enter the expression, then launch the Plot Builder from the context panel:
1. Enter the expression sin(i*sqrt(x^2+y^2)/10).
2. Select Plot Builder from the context panel.
In the Basic Options window:
3. Select the Animation radio button.
4. The default x Axis range is -2*Pi .. 2*Pi. Change the x Axis range to -6 .. 6.
5. The default y Axis range is -2*Pi .. 2*Pi. Change the y Axis range to -6 .. 6.
6. Select i as the animation parameter from the drop-down list and the range to 1 .. 30.
7. From the Style group box, select surface.
8. From the Color group box, in the Shading drop-down menu, select z (grayscale).

6.6 Creating Animations • 217

In the 3-D Options window:
9. In the Scaling drop-down list, select constrained.
Build the Animation:
10. Click Build Animation
11. Click on the plot in the worksheet.
12. From the animation toolbar, click Start/Resume playing the animation.

For information on playing the animation, see Playing Animations (page 221). To see the Maple syntax used to generate
this plot, see Maple Syntax for Creating Animations: Interactive Plot Builder Example (page 217).

The plots[animate] Command
You can also use the animate command, in the plots package, to generate animations.
Table 6.4: The animate Command
animate(plotcommand, plotarguments, t=a..b, ...)
animate(plotcommand, plotarguments, t=L, ...)• plotcommand - Maple procedure that generates a 2-D or 3-D plot
• plotarguments - arguments to the plot command• t=a..b - name and range of the animation parameter• t=L - name and list of real or complex constants

To access the command, use the short form name after invoking the with(plots) command.
>
Maple Syntax for Creating Animations: Interactive Plot Builder Example
The following example shows the plotting command returned by the example in Interactive Plot Builder (page 216).

218 • 6 Plots and Animations>

6.6 Creating Animations • 219

Animate a 2-D plot>

For more information on the animate command, refer to the plots[animate] help page.

The plot3d(...,viewpoint) Option
You can use the viewpoint option to create an animation in which the position from which you view a 3-D plot moves
in all directions and in various angles around the plot surface based on coordinates and parameters you specify. This
type of animation creates the effect of flying through, around, beside, towards, and away from a plot surface in threedimensional space.
The moveable position from which you view the surface is called the camera. You can specify the orientation of thecamera to view different sides of a surface, the path along which the camera moves throughout and around a surface,
and the location of the camera in 3-D space in each animation frame. For example, you can specify coordinates tomove the camera to specific points beside a surface; a pre-defined camera path to move the camera in a circle aroundthe surface; and the range of view to move the camera close to or away from the surface. Refer to the viewpoint help
page for more information.
To animate the following examples, click the plot object and then click the play button ( ) in the Animation context
bar.
Example 1: Moving the Camera Around a 3-D PlotIn the following example, a pre-defined path circleleft moves the camera in a counter-clockwise circle around the plot
surface.

220 • 6 Plots and Animations>

Example 2: Specifying a Path to Move the Camera Towards and Around a 3-D PlotIn the following example, a camera path is specified to zoom into and view different sides of the plot surface.

6.7 Playing Animations • 221>

6.7 Playing Animations
Animation Context Bar
To run the animation, click the plot to display the Animate context bar.
Table 6.5: Animation Options
Name
Previous Frame

Icon

Description
View the previous frame in the animation.

Stop

Stop the animation.

Play

Play the selected animation.

Next Frame

View the next frame in the animation.

Current Frame

Slider control for viewing individual frames ofan animated plot.
Forward - Play the animation forward.

ForwardOscillate
Backward

Oscillate - Play the animation forward andbackward.
Backward - Play the animation backward.

222 • 6 Plots and Animations

Name
SingleIcon

Continuous

Frames per
secondPoint probe

Execute click anddrag code (2-D)
Pan
Zoom in

Zoom out

Reset view
Selection Tool
(2-D)

Rotate (3-D)

Description
Single - Run the animation in single cycle mode.
The animation is displayed only once.
Continuous - Run the animation in continuous
mode. The animation repeats until you stop it.
Set the animation to play at a faster or slower
speed.
Select a curve. For 2-D plots, select a coordinate
type from the Selection Tool menu to display
coordinates.
In an embedded plot window, use this probe to
execute the specified click and drag code, if any.
Pan the plot by changing the view ranges.
Zoom into the plot. Also, scale the plot by placing
the pointer over the plot and then rotating thewheel button.
Zoom out of the plot. Also, scale the plot byplacing the pointer over the plot and then rotating
the wheel button.
Reset the view to the default view of the 2-D plot.
Use the Selection Tool to select the information
displayed in the point probe tool tooltip. You canchoose to display coordinates derived fromconverted pixel coordinates or data points derived
from the original data points. To copy thecoordinate data into the clipboard, from thecontext panel select Probe Info → Copy data.
Rotate a three-dimensional plot to see it from adifferent point of view.

You can also run the animation using the context menu or the Plot menu.

6.8 Customizing Animations
The display options that are available for static plots are also available for Maple animations.

Interactive Plot Builder Animation Options
Using the Interactive Plot Builder, you can apply various plot options within the Plot Options window. See Interactive
Plot Builder (page 216).

Context Panel Options
As with static plots, you can apply plot options to the animation by clicking the animation output.

6.8 Customizing Animations • 223

Customize the animation using the context panel:
1. To change the line style, click the plot region. Select Style → Point.
2. To remove the axes, select Axes → None.

The animate Command Options
The animate command offers a few options that are not available for static plots. Refer to the animate help page for
information on these additional options. By default, a two-dimensional animation consists of sixteen plots (frames)
and a three-dimensional animation consists of eight plots (frames). To create a smoother animation, increase thenumber of frames using the frames option.
Note: Computing more frames increases time and memory requirements.
>>

224 • 6 Plots and Animations>

6.9 Exporting
You can export a generated plot or animation to an image in various file formats, including DXF and X3D (for 3-D
plots), EPS, GIF, JPEG/JPG, POV, and Windows BMP. Exporting an animation to GIF produces an animated image
file. The exported images can be included in presentations, web pages, Microsoft Word, or other software.

6.9 Exporting • 225

To export an image:
1. Click the plot region.
2. From the context panel, select Export and the file format.
Alternatively:
1. Click the plot.
2. From the Plot menu, select Export, and then the file format.
Maple has various plot drivers. By setting the plotdevice, a file can be automatically created without returning theimage to the document. For more information, refer to the plot,device help page.

226 • 6 Plots and Animations

7 Creating Mathematical Documents
Maple allows you to create powerful documents as business and education tools, technical reports, presentations, assignments, and handouts.
You can:• Copy, cut, and paste information• Format text for reports or course material• Add headers and footers• Insert images, tables, and symbols• Generate 2-D and 3-D plots and animations• Sketch in the document or on a plot
• Insert hyperlinks to other Maple files, websites, or email addresses• Place instructions and equations side by side
• Bookmark specific areas• Easily update, revise, and distribute your documents
In this chapter, we will create a document that demonstrates many of Maple's documentation features. For further examples, note that this guide was written using Maple.

7.1 In This Chapter
SectionTopicsDocument Formatting (page 228) - Add various text • Copy and Paste
formatting elements• Quick Character Formatting• Quick Paragraph Formatting• Character and Paragraph Styles• Sections• Headers and Footers• Show or Hide Worksheet Content• Indentation and the Tab Key
Commands in Documents (page 241) - Format and • Document Blocks
display or hide commands in a document• Typesetting• Auto-Execute
Tables (page 245) - Create tables and modify their • Creating a table
attributes• Cell contents• Navigating table cells• Modifying Structural Layout• Modifying Physical Dimensions• Modifying Appearance• Printing Options• Execution Order227

228 • 7 Creating Mathematical Documents

SectionTopicsDrawing Canvas (page 254) - Sketch an idea in the • Insert a Drawing Canvas
document by inserting a drawing canvas• Drawing• Drawing Canvas Style• Inserting Images
Hyperlinks (page 258) and Bookmarks - Add
hyperlinks to various sources• Inserting a Hyperlink in the Document• Linking to an Email Address, Dictionary Topic, Help Page, Maplet
Application, Webpage, or Document• Bookmarks

Embedded Components (page 263) - Insert buttons, • Overview of available components
sliders, and more in your document• Example using a task template
Spell Checking (page 265) - Verify text with the
Maple spell checking utility• How to Use the Spellcheck Utility• Selecting a Suggestion• User Dictionary

7.2 Document Formatting
To begin, create a new Maple document. From the File menu, select New → Document Mode. For this example, you
can copy and paste text from any file. The example text below is from a Maple help page, plot, but the formatting has
been removed for demonstration purposes.

Copy and Paste
You can cut, copy, and paste content within Maple documents, and from other sources.
To copy an expression, or part of an expression, to another location on the document:
1. Select the expression, or part of the expression, to copy. Alternatively, right-click and select Copy.
2. From the Edit menu, select Copy.
3. Place the cursor at the insertion point.
4. From the Edit menu, select Paste. Alternatively, right-click and select Paste.
Result:7.2 Document Formatting • 229

If you paste into a math input region, Maple interprets all the pasted content as input. If you paste into a text region,
Maple interprets all the pasted content as text. However, note that 2-D Math retains its format in both input and text
regions.
When you copy and paste to another application, in general, Maple retains the original structure.

Quick Character Formatting
The Format→Character menu provides access to the following quick formatting features: Bold, Italic, Underline,
Superscript, Subscript, Font Color, and Highlight Color.
To modify text:
1. In the document, select the text to modify.
2. From the Format menu, select Character, and then the appropriate feature. Alternatively, select Format
acter from the context panel.

Char-

3. Select the quick formatting feature you want to apply (for example, bold or italic font).

Alternatively, use the context bar icons. For example, to apply a color to the parameters "f, x=x0..x1":• Font Color Context Bar Icon
• Highlight Color Context Icon
For font and highlight colors, you can select from Swatches, a color wheel, RGB values, or choose a color using theeye dropper tool. See Figure 7.1.

Figure 7.1: Select Color Dialog

In this example, choose a dark purple color, as in the help pages.
To format this text as bold, click the Bold toolbar icon,. Also, select the text "Calling Sequence" and format as bold.

230 • 7 Creating Mathematical Documents

Result:Attributes Submenu: Setting Fonts, Character Size, and Attributes
You can also change various character attributes such as font, character size, style, and color in one dialog.
To modify text:
1. In the document, select text to modify.
2. From the Format menu, select Character, and then Attributes. The Character Style dialog opens. See Figure 7.2.

Figure 7.2: Character Style Dialog

7.2 Document Formatting • 231

Quick Paragraph Formatting
The Format→Paragraph menu provides access to the following quick alignment features: Align Left, Center, andAlign Right.
To modify a paragraph:
1. In the document, select the paragraph to modify.
2. From the Format menu, select Paragraph, and then the appropriate feature.
Attributes Submenu: Spacing, Indent, Alignment, Bullets, Line Break, and Page BreakYou can change various paragraph attributes in one dialog.
• From the Format menu, select Paragraph, and then Attributes. The Paragraph Style dialog opens. See Figure 7.3.
• When changing spacing, you must indicate units (inches, centimeters, or points) in the Units drop-down list.

Figure 7.3: Paragraph Style Dialog

For example, in the pasted text, select all of the items under "Parameters", then open the Paragraph Style dialog.
Notice that the spacing has already been set.
In the Indent section, change the Left Margin indent to 10.0 pt.
In the Bullets and Numbering section, click the Style drop-down and select Dash. Click OK to close the dialog andapply the styles.
Result:232 • 7 Creating Mathematical Documents

For more information, refer to the paragraphmenu help page.

Character and Paragraph Styles
Maple has predefined styles for characters and paragraphs. A style is a set of formatting characteristics that you canapply to text in your document to change the appearance of that text. When you apply a style, you apply a group offormats in one action.
• A character style controls text font, size, color, and attributes such as bold and italic. To override the character style
within a paragraph style, you must apply a character style or character formatting.
• A paragraph style controls all aspects of a paragraph's appearance, such as text alignment, line spacing, and indentation. In Maple, each paragraph style includes a character style.

Figure 7.4: Style Management Dialog

Applying Character Styles
By using the drop-down list in the document context bar, you can apply:• Existing Maple character styles.
• New styles that you have created through the Style Management (Figure 7.4) and Character Style (Figure 7.5)
dialogs.

7.2 Document Formatting • 233

To apply a character style to text in your document:
1. Select the text to modify.
2. In the styles drop-down list in the context bar of your document, select an appropriate character style. All characterstyles are preceded by the letter C. The selected text now reflects the attributes of the character style you havechosen.

3. (Optional) If necessary, you can remove this style. From the Edit menu, select Undo.
Creating and Modifying Character Styles
You can create custom character styles to apply to text, or change existing character styles. New styles are automatically
added to the styles drop-down list in the context bar of your document.
1. From the Format menu, select Styles. The Style Management dialog opens. See Figure 7.4.
To create a character style:• Click Create Character Style. The Character Style dialog opens. See Figure 7.5.
• In the first row of the dialog, enter a style name in the blank text region.
To modify a character style:• From the style list, select the character style to modify. Recall that all character styles are preceded by the letter C,
while paragraph styles are preceded by the letter P.
• Click Modify. The Character Style dialog opens with the current attributes displayed. See Figure 7.5.
For either action, continue:
2. Select the properties for the new character style, such as font, size, attributes, and color. In the font attributes, theSuperscript and Subscript check boxes are mutually exclusive. When you select one of the two check boxes, theother is disabled. You must clear one before selecting the other.
Note: A preview of the style is displayed in the last row of the Character Style dialog.
3. To save the style, click OK or to abandon, click Cancel. If you have modified a style, all text in your documentthat uses the altered style is updated to reflect the changes.

234 • 7 Creating Mathematical Documents

Figure 7.5: Defining a Character Style

For example, in the pasted text, suppose we want to create a character style for the bold, purple parameter.
• From the Format menu, select Styles, then click Create Character Style.
• Enter the style name, "Placeholder", and then select the character attributes. In this case, click the Bold check box.
Then click the Color button and choose a dark purple. Click OK to create the character style.
Now you can apply the style to any text. Under Calling Sequences, select each list of parameters inside the command.
To apply the style, from the Styles drop-down menu in the toolbar, select Parameter.

Result:7.2 Document Formatting • 235

Applying Paragraph Styles
By using the drop-down list in the document context bar, you can apply:• Existing Maple paragraph styles.
• New styles that you have created through the Style Management (Figure 7.4) and Defining a Paragraph Style(Figure 7.6) dialogs.
To apply a Maple paragraph style to text in your document:
1. Select the text to modify.
2. In the styles drop-down list in the context bar of your document, select an appropriate paragraph style. All Maple
paragraph styles are preceded by the letter P. The selected text now reflects the attributes of the paragraph style you
have chosen.

For example, to format the title of the pasted text as a title, first select the line: "plot - create a two-dimensional plot".
In the Styles drop-down, select Title.
Result:236 • 7 Creating Mathematical Documents

3. (Optional) If necessary, you can remove this style. From the Edit menu, select Undo.
Creating and Modifying Paragraph Styles
You can create custom paragraph styles to apply to text, or change existing paragraph styles. New styles are automatically added to the styles drop-down list in the context bar of your document.
1. From the Format menu, select Styles. The Style Management dialog opens. See Figure 7.4.
To create a paragraph style:• Click Create Paragraph Style. The Paragraph Style dialog opens. See Figure 7.6.
• In the first row of the dialog, enter a style name in the blank text field.
To modify a paragraph style:• Select a paragraph style to modify. Recall that all paragraph styles are preceded by the letter P.
• Click Modify. The Paragraph Style dialog opens with the current attributes displayed.
For either action, continue:
4. In the Units drop-down menu, select the units used to determine spacing and indentation. Select from inches (in),centimeters (cm), or points (pt).
5. Select the properties to use for this paragraph style, such as Spacing, Indent, Alignment, Bullets and Numbering,
Page Break Before, and Linebreak.
6. To add or modify a font style, click Font. The Character Style dialog opens. For detailed instructions, see Creatingand Modifying Character Styles (page 233).
7. To save the style, click OK, or to abandon, click Cancel. If you are modifying an existing style, all text in yourdocument that uses the altered style is updated to reflect the changes.

7.2 Document Formatting • 237

Figure 7.6: Defining a Paragraph Style

Style Set Management: Saving Styles for Future Use
You can use the style set of a particular document as the default style for all documents.

Figure 7.7: Style Set Management Dialog

For information on creating and managing style sets, see the worksheet/documenting/styles help page.

Sections
You can organize your document into sections, either before or after the text has been entered.

238 • 7 Creating Mathematical Documents

Using the Insert Menu to Add Sections
1. Place the cursor in the paragraph or execution group above the location at which you want to insert a new section.
• If the cursor is inside a section, Maple inserts the new section after the current section.
• If the cursor is in an execution group, Maple inserts the new section after the execution group.
2. From the Insert menu, select Section. An arrow marks the start of the section.
3. Move the cursor to the text area beside the arrow. Enter the section heading.
4. Move the cursor to the body of the section. Enter the content.
Tips for Adding Sections and Subsections• If you are in a section and select Insert→Section, a subsection is created.
• To insert a subsection immediately after the current subsection, use Edit→Split or Join→Split Section. The newly
created section is at the same indentation level as the existing section.
• To outdent, use Edit→Remove Section. This decreases the indentation of a worksheet element by one level by removing one subsection that encloses the worksheet element.
Using the Indent and Outdent Toolbar Icons
You can shift sections to create or remove subsections.
Enclose the selection in a section or subsection
Outdent the selection to the next section level, if possible.

For example, to create two sections containing the two categories of information in the pasted text:
1. Select "Parameters" and all of the items under it.
2. Click the Indent toolbar item.
3. Cut and paste "Parameters" from inside the section to its title.
4. Similarly, create a section with the title "Calling Sequence", containing the items under that heading.

7.2 Document Formatting • 239

Result:Note: The section titles are automatically formatted as section titles, but you can change the formatting through theParagraph Style dialog.

Headers and Footers
You can add headers and footers to your document that will appear at the top and bottom of each page when you print
the document.
To add or edit headers and footers:
From the Insert menu, select Header Footer. The Header Footer dialog appears. See Figure 7.8.

Figure 7.8: Header and Footer Dialog - Custom Header

The available elements include the current date, page number, number of pages, an image, the filename, or any plain
text. These elements can be placed in the left or right corner or the center of the page.
You can choose one of the predefined header or footer styles in the Predefined Header and Footer tab, or create yourown by clicking the Custom Header or Custom Footer tab.
For more information on header and footer options, refer to the headerfooter help page.

Show or Hide Worksheet Content
You can hide document elements of a specific type so that they are not visible. This does not delete them, but hides
them from view. Hidden elements are not printed or exported, but they can be copied and pasted.

240 • 7 Creating Mathematical Documents

In a document, use the Show Contents dialog to hide all spreadsheets, input, output, or graphics, plus markers for
section boundaries, execution group boundaries, hidden table borders on mouse pointer roll over, and annotations. The
dialog is accessed from the View→Show/Hide Contents menu.
Using the Show Contents Dialog
A check mark beside the item indicates that all document elements of that type are displayed for the current document.
See Figure 7.9.

Figure 7.9: Show Contents Dialog

1. From the View menu, select Show/Hide Contents. The Show Contents dialog opens with all items selected for
display.
2. Clear the check box associated with the document components or markers to hide them.
Note: By clearing the Input check box, Maple Input (1-D Math) and 2-D Math input are hidden. However, this will
not hide Text input in Document mode. Clearing the Graphics check box ensures that a plot, an image, or the Canvas
inserted in the document by using the Insert menu option is also hidden.
Command Output Versus Inserted Content
Output is considered an element that results from executing a command. Inserted components are not considered output.
Consider the following examples.
The plot resulting from executing the plot(sin) command is considered output.
• To show a plot from the plot(sin) command, select both the Output and Graphics check boxes in the Show Contents
dialog.
Inserted images and the Canvas are not considered output. As such, they are not hidden if you clear the Output checkbox.
• To hide an inserted image or canvas, clear the Graphics check box in the Show Contents dialog.

7.3 Commands in Documents • 241

Indentation and the Tab Key
The Tab key has a few different uses:• Indentation• Navigation through a document or between table cells• Navigation between placeholders within a math expression
Control the behavior of the Tab key using the Tab Navigation feature in the Format menu. For more information,refer to the tabkey help page.

7.3 Commands in Documents
Document Blocks
With document blocks, you can create documents that present text and math in formats similar to those found in businessand education documents.
In a document block, an input prompt or execution group is not displayed.
By hiding Maple input such that only text and results are visible, you create a document with better presentation flow.
Before using document blocks, it is recommended that you display Markers. A vertical bar is displayed along the left
pane of the document. Icons representing document blocks are displayed in this vertical bar next to associated content.
To activate Markers:• From the View menu, select Markers.
For further details on document blocks, see Document Blocks (page 36) in Chapter 1.
Working with Document Blocks
In document mode, each time you press Enter, a new document block appears. Documents consist of a series of document blocks.
1. Create a new document block after the last section of the pasted example, either by pressing Enter, or by selecting,from the Edit→Document Blocks menu, Create Document Block.
2. Enter text and an expression to evaluate. For example, enter "Plot the expression

and its derivative,". For detailed instructions on entering this phrase, see Example 6 - Enter Text and 2-D Math in theSame Line Using Toolbar Icons (page 22) in Chapter 1.
3. Select the expression to display the context panel.
4. From the context panel, click Evaluate and Display Inline. The expression is evaluated.
5. Check that the input mode is Text, then enter the rest of the sentence: ", in the same plot." See Figure 7.10.

242 • 7 Creating Mathematical Documents

BeforeAfter
Figure 7.10: Working with Document Blocks
Result:Inline Document Output
Document blocks can display content inline, that is, text, input, and output in one line as presented in business andeducation documents.
To display content inline:
1. Place the cursor in the document block.
2. From the Edit→Document Blocks menu, select Inline Document Output.
View Document CodeTo view the contents, that is, all code and expanded execution groups within a document block, you must expand the
document block.
1. Place the cursor in the document block region.
2. From the Edit→Document Blocks menu, select Show Command.

7.3 Commands in Documents • 243

3. To hide code again, clear the check box beside Show Command.
Expand an Execution Group within a Document Block
An execution group is a grouping of Maple input with its corresponding Maple output. It is distinguished by a large
square bracket at the left called a group boundary.
As document blocks can contain many execution groups, you can select to expand an execution group within a document
block.
1. Place the cursor near the end of the document block region.
2. From the Edit→Document Blocks menu, select Show Execution Group.

3. To hide the group, clear the check box beside Show Execution Group.
Switch between Input and Output
1. Place the cursor in the document block region.
2. From the Edit→Document Blocks menu, select Toggle Input/Output Display.
Input from any executable math or commands is displayed in one instance, or only output is displayed.

Typesetting
You can control typesetting and 2-D Math equation parsing options in the Standard Worksheet interface. Extended
typesetting uses a customizable set of rules for displaying expressions.
The rule-based typesetting functionality is available when the Typesetting level is set to Extended (the default). You
can set the typesetting level under Tools→Options→Display tab). This parsing functionality applies to 2-D Mathediting (Math mode) and output.
For example, you can change the display of derivatives to suit the content and audience of your document.
>
Tools→Options→Display tab: Typesetting level = Extended.

>
Tools→Options→Display tab: Typesetting level = Maple Standard.

To specify rules, use the Typesetting Rule Assistant.
• From the View menu, select Typesetting Rules. The Typesetting Rule Assistant dialog opens.
For more information, see the Typesetting, TypesettingRuleAssist, and OptionsDialogDisplay help pages.

Auto-Execute
The Autoexecute feature allows you to designate regions of a document for automatic execution. These regions are
executed when the document opens or when the restart For more information, refer to the restart help page. commandis executed. This is useful when sharing documents. Important commands can be executed as soon as the user opens
your document. The user is not required to execute all commands.

244 • 7 Creating Mathematical Documents

Setting the Auto-Execute Feature
1. Select the region to be automatically executed when the document opens.
2. From the Evaluate menu, select Set Selection to Autoexecute.
Regions set to Autoexecute are denoted by exclamation mark symbols in the Markers region (View → Markers),.
For example, to display a plot in your document without saving the plot, making your document use less memory, you
can set a plot command to autoexecute.
1. After the plot instruction, enter a Maple prompt (Insert → Execution Group → After Cursor).
2. Enter the plot command:and press Enter to execute.

3. Select the plot, then select Evaluate → Remove Output from Selection.
4. Place the cursor in the plot command, then select Evaluate → Set Selection to Autoexecute.
5. Save and close the document; on reopening, the command is re-executed.
Result:Removing the Auto-Execute Setting
To remove the setting in a region:
1. Select the region.
2. From the Evaluate menu, select Clear Selection from Autoexecute.
To remove all autoexecuted regions from a document:• From the Evaluate menu, select Clear All Autoexecute.
Repeating Auto-Execution
To execute all marked groups:• From the Evaluate menu, select Repeat Autoexecute.

7.4 Tables • 245

Security Levels
By default, Maple prompts the user before automatically executing the document.
To set security levels for the autoexecute feature, use the Security tab in the Options dialog. For details, refer to the
OptionsDialogSecurity help page.

7.4 Tables
Tables allow you to organize content in a document.

Creating a Table
To create a table:
1. From the Insert menu, select Table.
2. Specify the number of rows and columns in the table creation dialog.
3. Click OK.
The default properties for the table include visible borders and auto-adjustment to 100% of the document width. These
options, as well as the table dimensions, can be modified after table creation.
Create a table with 4 rows and 2 columns at the end of your document. In document mode, the input mode is set to
Math by default; in worksheet mode, the default is Text mode.

Cell Contents
Any content that can be placed into a document can also be placed into a table cell, including other sections and tables.
Table cells can contain a mix of:• Input commands• 2-D Math
• Embedded components: buttons, sliders, check boxes, and more
• Plots• ImagesEnter a heading in both columns of the first row, in 2-D Math. You can use any text formatting features within eachcell; for example, bold and center the headings.

Navigating Table Cells
Use the Tab key to move to the next cell. Ensure that Format → Tab Navigation is selected.

246 • 7 Creating Mathematical Documents

Tab Navigation
Allows you to move between cells using the Tab key.
selected
Tab Navigation not Allows you to indent in the table using the Tab key.
selected

Tab between the cells of the table and enter the following expressions in the first column. For each function, from thecontext panel, select Differentiate → With respect to → x. Cut and paste the resulting expression into the second
column.

Modifying the Structural Layout of a Table
The number of rows and columns in a table are modified using the Insert and Delete submenus in the Table menu or
by using the Cut and Copy/Paste tools. The Table menu is found under the Format menu. The same table menu options
are available in the Context Panel when the cursor resides in a table.
Inserting Rows and Columns
Row and column insertion is relative to the table cell that currently contains the cursor. If the document has an active
selection, insertion is relative to the selection boundaries.
• Column insertion can be to the left or right of the document position marker or selection.
• Row insertion can be above or below the marker or selection.
In your table, add a third column on the right to display the plots of these expressions. Add the heading, and insert ablank plot region in each cell below it, by selecting Insert → Plot → 2-D (or 3-D for the second expression). Then
Ctrl-drag (Control-drag for Macintosh) each expression in the row into its plot region to display it. For details on thisprocedure, see Plots and Animations (page 187).
Resize the plots and table as desired.

7.4 Tables • 247

Plot ofandDeleting Rows and Columns
With deleting operations using the Delete key, the Delete Table Contents dialog opens allowing you to specify thedesired behavior. For example, you can delete the selected rows, or delete the contents of the selected cells. See
Figure 7.11.

Figure 7.11: Delete Table Contents Verification Dialog

Pasting
Pasting a table subselection into a table may result in the creation of additional rows or columns, overwriting existingcell content, or the insertion of a subtable within the active table cell. When there is a choice, the Table Paste Modedialog opens, allowing you to choose. See Figure 7.12.

Figure 7.12: Table Paste Mode Selection Dialog

248 • 7 Creating Mathematical Documents

Merging Cells
To merge adjacent cells in a table, select the cells you would like to merge. From the Table menu, select Merge Cells.
You can merge cells across row or column borders. See Figure 7.13. The resulting cell must be rectangular. The contentsof the individual cells in the merge operation are concatenated in execution order. See Figure 7.14. For details on cell
execution order, see Execution Order Dependency (page 251).
>>>

Figure 7.13: Two Cells>

Figure 7.14: Merged Cells

Modifying the Physical Dimensions of a Table
The overall width of the table can be controlled in several ways.
The most direct way is to press the left mouse button (press mouse button, for Macintosh) while hovering over the leftor right table boundary and dragging the mouse left or right. Upon release of the mouse button, the table boundary is
updated. This approach can also be used to resize the relative width of table columns.
Alternatively, the size of the table can be controlled from the Table Properties dialog. The Table Properties dialog isfound in the Context Panel or through the Format menu under Table and then Properties. Two sizing modes aresupported.
1. Fixed percentage of page width. Using this option, the table width adjusts whenever the width of the documentchanges. This option is useful for ensuring that the entire content of the table fits in the screen or printed page.
2. Scale with zoom factor. This option is used to preserve the size and layout of the table regardless of the size of the
document window or the zoom factor. If the table exceeds the width of the document window, the horizontal scroll
bar can be used to view the rightmost columns. Note: Using this option, tables may be incomplete when printed.

Modifying the Appearance of a Table
Table Borders
The style of exterior and interior borders is set using the Table Properties dialog.
• You can set all, none, or only some of the borders to be visible in a table. Exterior borders are controlled separately.
• You can control the visibility of interior borders by using the Group submenu of the Table menu; grouping rows orcolumns suppresses interior borders, provided that the interior border style is set by row and column group.

7.4 Tables • 249

For example, group the columns together, and group rows 2 to 4 together. Then in the Table Properties dialog, selectExterior Borders: Top and bottom, and Interior Borders: By row and column group.

• Hidden borders are visible when the mouse hovers over a table. Note: You can hide the visibility of lines on mousepointer roll over by using the View→Show/Hide Contents dialog, and clearing the Hidden Table Borders checkbox. This setting applies to all tables in the worksheet. You can also set controls for an individual table from theTable Properties→Show hidden borders option. Using this option, borders can be hidden in a table even if they
are set to visible on roll over in the Show/Hide Contents dialog.
Alignment Options
The table alignment tools control the horizontal alignment of columns and vertical alignment of rows.
For column alignment, the current selection is expanded to encompass all rows in the selected columns. The alignment
choice applies to all cells within the expanded selection. If the document does not contain a selection, the cursor position
is used to identify the column.
Similarly, the selection is expanded to include all columns in the selected rows for vertical alignment options. The
following table illustrates the vertical alignment options. The baseline option is useful for aligning equations acrossmultiple cells within a row of a table.

250 • 7 Creating Mathematical Documents

For example, set the Row alignment to Baseline for all rows, and set the Column alignment to Center for all columns.

Cell Color
You can set the background color of any cell or collection of cells to be any color. This coloring is independent of any
highlighting or text color that may also be applied.
To change the color of a cell, place the cursor in the cell, then from the Table menu, select Cell Color.... In the SelectA Color dialog, choose a color from the swatches, the color wheel, or RGB. See the DrawingTools help page for details
on color selection.

7.4 Tables • 251

For example, select the first row of the table and apply a light blue color. This sets the header off from the content below.

Controlling the Visibility of Cell Content
The Table Properties dialog includes two options to control the visibility of cell content. These options allow control
over the visibility of Maple input and execution group boundaries. Thus, these elements can be hidden in a table even
if they are set to visible for the document in the View→Show/Hide Contents dialog.

Printing Options
The Table Properties dialog contains options to control the placement of page breaks when printing. You can fit atable on a single page, allow page breaks between rows, or allow page breaks within a row.

Execution Order Dependency
The order in which cells are executed is set in the Table Properties dialog. The following tables illustrate the effectof execution order.
Row-wise execution order> x:=1;> x:=x+1;(7.1)> x:=x+1;(7.2)> x:=x+1;
(7.3)

(7.4)

252 • 7 Creating Mathematical Documents

Column-wise execution order> x:=1;> x:=x+1;
(7.5)

(7.6)

> x:=x+1;> x:=x+1;
(7.7)

(7.8)

Editable Tables
Tables can be marked as editable or non-editable. The editable property for tables is independent of the document editability, though if a document is marked as non-editable, tables cannot be edited. After a table has been marked as
non-editable, any content stored in the table cannot be modified. It is not possible to add any new content such as embedded components or to run computations in execution groups or document blocks. Existing interactive embedded
components inside of a table will continue to work.
A table can be marked as editable or non-editable in its Table Properties using either the DocumentTools:-SetProperty
command or the Context Panel. To make a table editable or non-editable using the Context Panel, in the Table properties,
select or clear the Editable check box

Additional Examples
For more practice creating and manipulating tables, try creating the following tables at the end of your document.
Table of Values
This example illustrates how to set the visibility options for cell contents to display a table of values.
>
Create a table with 2 rows and 7 columns. Enter the values as below, and then select all table cells. In the Table →Alignment menu, select Columns, and then Center.
0

>

1

>

2

>

3

>

4

>

5

>

6

>

Table settings:
In the Table Properties dialog:
1. Set Table Size Mode to Scale with zoom factor.
2. Hide Maple input and execution group boundaries: Clear the Show input and Show execution group boundaries
check boxes.

7.4 Tables • 253

0

1

2

3

4

5

6

Formatting Table Headers
The following table uses cell merging for formatting row and column headers, and row and column grouping to control
the visibility of cell boundaries.
By default, invisible cell boundaries are visible on mouse pointer roll over. You can hide the visibility of lines onmouse pointer roll over by using the View→Show/Hide Contents dialog, and clearing the Hidden Table Borders
check box.
Parameter 2
Parameter 1

Low
High

Low
13
18

High
24
29

Table settings:
1. Insert a table with 4 rows and 4 columns and enter the information shown above.
Using the Table menu:
2. Merge the following sets of (Row,Column) cells: (R1,C1) to (R2,C2), (R1,C3) to (R1,C4), and (R3,C1) to (R4,C1).
3. Group columns 1 and 2, and columns 3 and 4.
4. Group rows 1 and 2, and rows 3 and 4.
In the Properties dialog:
5. Set Exterior Borders to None.
6. (Optional) Change Table Size Mode size option to Scale with zoom factor.
Using the Table menu:
7. Set Alignment of columns 3 and 4 to Center.
2-D Math and Plots
The following example illustrates the use of tables to display 2-D Math and plots side by side.

254 • 7 Creating Mathematical Documents

Approximating exp(-x) as a rational polynomialusing aorder Padé approximation.

Insert a table with 1 row and 2 columns. Enter the information in text and executable 2-D Math to create the calculationand plot, as shown.
Table Settings:
In the Properties dialog:
1. Set Exterior and Interior Borders to None.
2. Hide Maple input and execution group boundaries: Clear the Show input and Show execution group boundaries
check boxes.
Using the Table menu:
3. Change row Alignment to Center.

7.5 Drawing Canvas
Using the drawing tools, you can sketch an idea in a canvas, draw on plots, and draw on images. See Figure 7.15. For
details about the drawing feature, refer to the DrawingTools help page.

7.5 Drawing Canvas • 255

Figure 7.15: Drawing Tools and Canvas

Insert a Drawing Canvas
To insert a drawing canvas:
1. Place the cursor where the drawing canvas is to be inserted.
2. From the Insert menu, select Drawing. A canvas with grid lines appears in the document at the insertion point.
The Drawing icon is available and associated context bar icons are displayed.
The tools include the following: selection tool, pencil (free style drawing), eraser, text insert, straight line, rectangle,
rounded rectangle, oval, diamond, alignment, drawing outline, drawing fill, drawing linestyle, and drawing canvas
properties.

Drawing
To draw with the pencil tool in the drawing canvas:
1. From the Drawing icons, select the pencil icon.
2. Click and drag your mouse in the canvas to draw lines. Release the mouse to complete the drawing.
To adjust the color of drawing tools:
1. From the Drawing icons, select the Drawing Outline icon. See Figure 7.16.
2. Select one of the color swatches available or select the color wheel, RGB ranges, or eye dropper icon at the bottomof the dialog and customize the color to your preference.
3. After selecting a new color, draw on the canvas using the pencil icon and notice the new color.

256 • 7 Creating Mathematical Documents

Figure 7.16: Drawing Outline Color Icon

In your document, there are three plots, two of which are 2-D plots that can be drawn on. All of the information in thetable you made in the previous section could be drawn onto the plot, putting the information in a more concise layout.
Consider one of the plots from the table:

Click on the plot, and notice that the Plot toolbar is open. However, the Drawing toolbar is also available. Click on
Drawing to see the toolbar.
Select the Text icon, , and click on the plot. Enter the expression
in one text area, and its derivative in another,as shown. You can move the text areas around on the plot so that they indicate the correct lines.
For details on the rest of the drawing features, refer to the DrawingTools help page.

Drawing Canvas Style
You can alter the Drawing in the following ways:• Add a grid of horizontal and/or vertical lines. By default, the canvas opens with a grid of horizontal and verticallines.
• Change the grid line color.

7.5 Drawing Canvas • 257• Change the spacing between grid lines.
• Change the background color.
These options can be changed in the Drawing Properties Canvas Icon. See Figure 7.17.

Figure 7.17: Drawing Properties Canvas Icon - Change the Gridline Color

Inserting Images
You can insert images in these file formats into yourdocument.
• Graphics Interchange Format - gif• Joint Photographic Experts Group - jpe, jpeg, jpg• Portable Network Graphics - png• Bitmap Graphics - bmp• Tagged Image File Format - tif, tiff, jfx• Portable aNyMap - pnm• Kodak FlashPix - fpx

To insert an image into the document at the cursor location:
1. From the Insert menu, select Image. The Load Image dialog opens.
2. Specify a path or folder name.
3. Select a filename.
4. Click Open. The image is displayed in the document.
If the source file is altered, the embedded image does not change because the original object is pasted into the document.
To resize an inserted image:
1. Click the image. Resizing anchors appear at the sides and corners of the image.
2. Move the mouse over the resize anchor. Resizing arrows appear.
3. Click and drag the image to the desired size.
Note: To constrain the proportions of the image as it is resized, press and hold the Shift key as you drag.

258 • 7 Creating Mathematical Documents

You can also draw on images in the same way as the drawing canvas For more information, refer to the worksheet/documenting/drawingtools help page..
ImageTools Package
You can manipulate image data using the ImageTools package. This package is a collection of utilities for reading
and writing common image file formats, and for performing basic image processing operations within Maple.
Within Maple, images are represented as dense, rectangular Arrays of 64-bit hardware floating-point numbers. Grayscale
images are 2-D, whereas color images are 3-D (the third dimension representing the color channels).
In addition to the commands in the ImageTools package, many ordinary Array and Matrix operations are useful forimage processing.
For details about this feature, refer to the ImageTools help page.

7.6 Hyperlinks
Use a hyperlink in your document to access any of the following.
• Webpage (URL)• Email• Worksheet• Help Topic• Task• Dictionary Topic• MapletFigure 7.18: Hyperlink Properties Dialog

Inserting a Hyperlink in a Document
To create a hyperlink from existing text in the document:
1. Highlight the text that you want to make a hyperlink.
2. From the Insert menu, select Hyperlink. Alternatively, from the Context Panel for the highlighted text, selectConvert To→Hyperlink.

7.6 Hyperlinks • 259

3. In the Hyperlink Properties dialog box, the Link Text field is dimmed since the text region you highlighted isused as the link text. This is demonstrated in Figure 7.18. The highlighted text region, Diff is dimmed.
4. Specify the hyperlink Type and Target as described in the appropriate following section.
To insert a text or image hyperlink into the document:
1. From the Insert menu, select Hyperlink.
2. In the Hyperlink Properties dialog box, enter the Link Text.
Optionally, use an image as the link. Select the Image check box and click Choose Image for the file. In .mw files,
the image appears as the link. You can resize the image as necessary. Click and drag from the corners of the image toresize.
3. Specify the hyperlink Type and Target as described in the appropriate following section.
Linking to a Webpage
To link to a webpage:
1. In the Type drop-down list, select URL.
2. In the Target field, enter the full URL, for example, http://www.maplesoft.com.
3. Click OK.
Linking to an Email Address
To link to an email address:
1. In the Type drop-down list, select Email.
2. In the Target field, enter the email address.
3. Click OK.
Linking to a Worksheet
To link to a Maple worksheet or document:
1. In the Type drop-down list, select Worksheet.
2. In the Target field, enter the path and filename of the document or click Browse to locate the file. (Optional) In
the Bookmark drop-down list, enter or select a bookmark.
Note: To link within a single Maple document, leave the Target field blank and choose the bookmark from theBookmark drop-down list.
Tip: When linking to another document, the default is to use a relative path. When sharing documents that containhyperlinks, ensure that target documents are in the same directory, or use a ZIP file to preserve the directory structure
if you are sharing a large collection of interlinking documents..
3. Click OK.
Linking to a Help Page
To link to a help page:
1. In the Type drop-down list, select Help Topic.
2. In the Target field, enter the topic of the help page. (Optional) In the Bookmark drop-down list, enter or select abookmark.
3. Click OK.

260 • 7 Creating Mathematical Documents

Linking to a Task
To link to a task:
1. In the Type drop-down list, select Task.
2. In the Target field, enter the topic name of the task template (see the status bar at the bottom of the Task Browser
window).
3. Click OK.
Linking to a Dictionary Topic
To link to a Dictionary topic:
1. In the Type drop-down list, select Dictionary Topic.
2. In the Target field, enter a topic name. Dictionary topics begin with the prefix Definition/, for example, Definition/dimension.
3. Click OK.
Linking to a Maplet Application
To link to a Maplet application:
1. In the Type drop-down list, select Maplet.
2. In the Target field, enter the local path to a file with the .maplet extension. Optionally, click Browse to locate thefile.
If the Maplet application exists, clicking the link launches the Maplet application. If the Maplet application contains
syntax errors, then error messages are displayed in a popup window.
When sharing documents that contain links to Maplet applications, ensure that target Maplet applications are in thesame directory, or use a ZIP file to preserve the directory structure if you are sharing a large collection.
3. Click OK.
Note: To link to a Maplet application available on a MapleNet™ webpage, use the URL hyperlink type to link to the
webpage. For information on MapleNet, see Embedded Components and Maplets (page 309).
Linking to a Workbook Attachment
Similar to attaching to a worksheet, you can link to workbook content by directly entering the workbook file URI, orby browsing to the target workbook file.
If you want to enter the URI directly into Target field, you should copy the URI first.
To copy the URI of the content you want to link to:
1. In the Workbook Navigator palette, right-click on the file you want to link to.
2. From the context menu, select Copy Path.
3. The URI of the target file is now copied to the clipboard.
To link to a workbook attachment:
4. Select Workbook Attachment from the Type drop-down list.
5. In the Target field, enter the URI of the worksheet, obtained in the above instructions, or click Browse to locate
the workbook file.
6. Click OK.

7.6 Hyperlinks • 261

Linking to a Workbook File
You can link to a workbook file (instead of an attachment inside the workbook) using the hyperlink properties dialog.
1. Select Worksheet from the Type drop-down list.
2. In the Target field, enter the path and filename of the workbook (.maple) file or click Browse to locate the file.
3. Click OK.
ExampleFor this example, link the text "horizontal range" to the dictionary page for domain. As indicated in the section for
Linking to a Dictionary Topic, select Dictionary Topic in the Type drop-down list, and then enter Definition/domain
in the Target field.
Links to dictionary topics appear underlined and in red.
Result:Bookmarks
Use a bookmark to designate a location in an active document. This bookmark can then be accessed from other regions
in your document or by using hyperlinks in other documents.
To display bookmark formatting icons, activate the Marker feature.
• From the View menu, select Markers.

Figure 7.19: Bookmark Indicator

Note: You can display bookmark properties by holding the pointer over a bookmark indicator. See Figure 7.19.
Inserting, Renaming, and Deleting a Bookmark
To insert a bookmark:1. Place the cursor at the location at which to place the bookmark. For example, place the cursor in the Parameters
section title.
2. From the Format menu, select Bookmarks. The Bookmark dialog opens, listing existing bookmarks in the document.

262 • 7 Creating Mathematical Documents

3. Click New. The Create Bookmark dialog opens. See Figure 7.20. Enter a bookmark name, "parameters", and click
Create.

Figure 7.20: Create Bookmark Dialog

4. The new bookmark appears in the Bookmark dialog list. Click OK.
Note: You can also rename and delete bookmarks using the Bookmark dialog.
Alternatively, right-click on a particular bookmark to rename or delete it.
Result:Go to a Bookmark
You can automatically move the cursor to the location of the bookmark in the active document.
1. From the Edit menu, select Go To Bookmark. The Go To Bookmark dialog opens with the current bookmarks
listed.
2. Select the bookmark "parameters" and click OK. The cursor moves to the bookmark, at the beginning of the Parameters section.
For more information, refer to the bookmarks help page.

7.7 Embedded Components • 263

7.7 Embedded Components
You can embed simple graphical interface components, such as a button, in your document. These components canthen be associated with actions that are to be executed. For example, the value of a slider component can be assigned
to a document variable, or a text field can be used to input an equation.

Adding Graphical Interface Components
The graphical interface components can be inserted by using the Components palette (Figure 7.21) or by cutting/copying
and pasting existing components to another area of the document. Although copied components have most of the samecharacteristics, they are distinct.
By default, palettes are displayed when you launch Maple. If palettes are not visible, use the following procedure:
1. From the View menu, select Palettes.
2. Select Expand Dock.
3. If the Components palette is not displayed, right-click (Control-click, for Macintosh) the palette dock. From thecontext menu, select Show Palette, and then Components.
For more information, see Palettes (page 15).
You can embed the following items:• Button, Toggle Button• Combo Box, Check Box, List Box, Radio Button• Text Area, Label• Slider, Plot, Mathematical Expression• Dial, Meter, Rotary Gauge, Volume Gauge• Data Table• Video Player• Shortcut Component

264 • 7 Creating Mathematical Documents

Figure 7.21: Components Palette

Task Template with Embedded Components
In your document, you can add components that have already been configured to work together, by using a task template.
Here, we use the Interactive Application template. For details on how to create and modify components, see Creating
Embedded Components (page 312).
To insert the task template, from the Tools menu, select Tasks → Browse. In the table of contents, expand Document
Templates, and select Interactive Application. Click Insert Minimal Content. The following is inserted into yourdocument.

7.8 Spell Checking • 265

Figure 7.22: Interactive Application Task Template

This configuration of components plots a linear function with slope and y-intercept given respectively by the two dials
and, and displays the function

on a gauge. For details on how thesecomponents work together, see Embedded Components and Maplets (page 309).

7.8 Spell Checking
The Spellcheck utility examines all designated text regions of your document for potential spelling mistakes, including
regions that are in collapsed sections. It does not check input, output, text in execution groups, or math in text regions.
See Figure 7.23.
Note: The Spellcheck utility uses American spelling.

266 • 7 Creating Mathematical Documents

Figure 7.23: Spellcheck Dialog

How to Use the Spellcheck Utility
1. From the Tools menu, select Spellcheck. Alternatively, press F7. The Spellcheck dialog appears. It automaticallybegins checking the document for potential spelling mistakes.
2. If the Spellcheck utility finds a word that it does not recognize, that word is displayed in the Not Found text box.
You have six choices:• To ignore the word, click Ignore.
• To ignore all instances of the word, click Ignore All.
• To change the word, that is, accept the suggested spelling that is in the Change To text box, click Change.
• To change all instances of the word, that is, accept the suggested spelling to replace all instances of the word, click
Change All.
• To add the word to your dictionary, click Add. For details, see the following User Dictionary section.
• To close the Spellcheck dialog and stop the spelling check, click Cancel.
3. When the Spellcheck is complete, a dialog containing the message "The spelling check is complete" appears. Click
OK to close this dialog.
Note: when using the Spellcheck utility, you can fix spelling errors in the dialog, but you cannot change the text indocument. The Spellcheck utility does not check grammar.

Selecting a Suggestion
To select one of the suggestions as the correct spelling, click the appropriate word from the list in the Suggestions textbox.
If none of the suggestions are correct, highlight the word in the Change To text box and enter the correct spelling.
Click Change to accept this new spelling.

User Dictionary
You can create and maintain a custom dictionary that works with the Maple Spellcheck utility.

7.8 Spell Checking • 267

Properties of the Custom Dictionary File
• It must be a text file, that is, have the file extension .txt. For example, mydictionary.txt.
• It is a list of words, one word per line.
• It is case sensitive. This means that integer and Integer require individual entries in the dictionary file.
• It does not require manual maintenance. You build your dictionary file by using the Add functionality of theSpellcheck. However, you can manually edit the file.
To specify a custom dictionary to be used with the Maple Spellcheck utility:
1. Create a .txt file in a directory/folder of your choice.
2. In Maple, open the Options dialog, Tools → Options, and select the General tab.
3. In the User Dictionary field, enter the path and name of the .txt file you created, or click Browse to select the location and filename.
4. To ignore Maple words that are command and function names, clear the Use Maple words in spellchecker checkbox.
5. Click Apply to Session or Apply Globally to save the settings, or Cancel to discard.
Adding a Word to Your Dictionary
When running the spellcheck, if the word in the Not Found text box is correct, you can add the word to your dictionary.
1. Click the Add button. If this is the first time you are adding a word, the Select User Dictionary dialog opens.
2. Enter or select the custom dictionary (.txt file) you created. See User Dictionary (page 266).
3. Click Select. The word is automatically added to your custom dictionary file.
Note: Specifications in the Options dialog determine whether this word is recognized in your next Maple session. If
you set your custom dictionary and clicked Apply to Session, then this word will not be recognized in a new Maple
session. If you set your custom dictionary and clicked Apply Globally, then this new word will be recognized.

268 • 7 Creating Mathematical Documents

8 Maple Expressions
This chapter provides basic information on using Maple expressions, including an overview of the basic data structures.
Many of the commands described in this chapter are useful for programming. For information on additional Maple
programming concepts, such as looping, conditional execution, and procedures, see Basic Programming (page 293).

8.1 In This Chapter
SectionTopicsCreating and Using Data Structures (page 269) - How to define • Expression Sequences
and use basic data structures• Sets• Lists• Tables• Arrays• Matrices and Vectors• Functional Operators• Strings
Working with Maple Expressions (page 278)- Tools for
manipulating and controlling the evaluation of expressions• Low-Level Operations• Manipulating Expressions• Evaluating Expressions

8.2 Creating and Using Data Structures
Constants, data structures, mathematical expressions, and other objects are Maple expressions. For more information
on expressions, refer to the Maple Help System.
This section describes the key data structures:• Expression sequences• Sets• Lists• Tables• Arrays• Matrices and Vectors• Functional operators• Strings

Expression Sequences
The fundamental Maple data structure is the expression sequence. It is a group of expressions separated by commas.
>
Accessing Elements
To access one of the expressions:• Enter the sequence name followed by the position of the expression enclosed in brackets([ ]).

269

270 • 8 Maple Expressions

For example:>

Using negative integers, you can select an expression from the end of a sequence.
>

You can select multiple expressions by specifying a range using the range operator (..).
>

Note: This syntax is valid for most data structures.

Sets
A set is an expression sequence enclosed in curly braces ({ }).
>A Maple set has the basic properties of a mathematical set.
• Each element is unique. Repeated elements are stored only once.
• The order of elements is not stored.
For example:>

Using Sets
To perform mathematical set operations, use the set data structure.
>

Note: The union operator is available in 1-D Math input as union. For more information, refer to the union help page.
For more information on sets, refer to the set help page.

Lists
A list is an expression sequence enclosed in brackets ([ ]).
>Note: Lists preserve both the order and repetition of elements.

8.2 Creating and Using Data Structures • 271

Accessing Entries
To refer to an element in a list:• Use square brackets.
For example:>

For more information, see Accessing Elements (page 269).
Using Lists
Some commands accept a list (or set) of expressions.
For example, you can solve a list (or set) of equations using the context panel or the solve command.
>
For more information, see Solving Equations and Inequations (page 82).
For more information on sets and lists, refer to the set help page.

ArraysConceptually, the Array data structure is a generalized list. Each element has an index that you can use to access it.
The two important differences are:
• The indices can be any integers.
• The dimension can be greater than one.
Creating and Using Arrays
To define an Array, use the Array constructor.
Standard Array constructor arguments are:
• Expression sequences of ranges - Specify the indices for each dimension• Nested lists - Specify the contents

272 • 8 Maple Expressions

For example:>>

To access entries in an Array, use either square bracket or round bracket notation.
Square bracket notation respects the actual index of an Array, even when the index does not start at 1.
>

>

>

>
Error, Array index out of range

Round bracket indexing normalizes the dimensions to begin at 1. Since this method is relative, you can access the endof the array by entering>>

Arrays can have more than one or two dimensions. For example, the following is a simple three-dimensional Array.
>

(8.1)

8.2 Creating and Using Data Structures • 273

The Array constructor supports other syntaxes. It also supports many options. For more information on the Array
constructor and the Array data structure, refer to the Array help page. For more information on indexing methods,
refer to the rtable_indexing help page.
Large Arrays
Larger Arrays than can be practically displayed in the document display with a summary format. For example, themultidimensional Array in (8.1) is displayed in summary format. The following 100-entry Array is as well. In bothcases, double-clicking on the placeholder output opens a browser for the entire data structure.
>

To view large Arrays:• Double-click the placeholder output.
The Matrix Browser displays the Array.
In the case of a multidimensional array, you can change what slice you are viewing in the Options tab.
For more information, see Viewing Large Matrices and Vectors (page 120).

TablesTables are conceptually an extension of the Array data structure, but the table data structure is implemented using hashtables. Tables can be indexed by any values, not only integers.
Defining Tables and Accessing Entries>>

You can also assign anything, for example, a list, to each element.
>>

For more information on tables, refer to the table help page.

Matrices and Vectors
Matrices and Vectors are specialized data structures used in linear algebra and vector calculus computations.

>
For information on defining Matrices and Vectors, see Creating Matrices and Vectors (page 118).

274 • 8 Maple Expressions

>

>

>

For more information on these data structures, including how to access entries and perform linear algebra computations,see Linear Algebra (page 118).

Functional Operators
A functional operator is a mapping. The value ofis the result of evaluating.

Using functional operators, you can define mathematical functions.
Defining a Function
To define a function of one or two variables:
1. In the Expression palette, click one of the function definition items. See Figure 8.1. Maple inserts the function
definition.
2. Replace the placeholders, using Tab to move to the next placeholder. Note: If pressing the Tab key indents thetext, click the Tab iconin the toolbar. This allows you to move between placeholders.

3. Press Enter.

Figure 8.1: Function Definition Palette Items

For example, define a function that adds 1 to its input.
>
Note: Instead of using the palettes, you can type the definition. To insert the right arrow, you can enter the characters->. In 2-D Math, Maple replaces -> with the right arrow symbol. In 1-D Math, the characters are not replaced.
You can evaluate the function add1 with symbolic or numeric arguments.

8.2 Creating and Using Data Structures • 275>

Distinction between Functional Operators and Other Expressions
Note: The expression

is different from the functional operator

.

to f.

Assign the functional operator>
Assign the expression

to g.

>
To evaluate the functional operator f at a value of x:• Specify the value as an argument to f.
>

To evaluate the expression g at a value of x:• You must use the eval command.
The following is not meaningful:>

Evaluating

atgives the desired result.

>

For more information on the eval command, and on using palettes and the context panel to evaluate an expression ata point, see Substituting a Value for a Subexpression (page 285).
Multivariate and Vector Functions
To define a multivariate or vector function:• Enclose coordinates or coordinate functions in parentheses (( )).
For example, a multivariate function:>

276 • 8 Maple Expressions>

A vector function:>>

Using Operators
To perform an operation on a functional operator, specify arguments to the operator. For example, for the operator f,
specify f(x), which Maple evaluates as an expression. See the following examples.
Plotting:
Plot a three-dimensional operator as an expression using the plot3d command.
>>

8.2 Creating and Using Data Structures • 277>

For information on plotting, see Plots and Animations (page 187).
Integration:
Integrate a function using the int command.
>>

The result uses the Struve function.

For information on integration and other calculus operations, see Calculus (page 131). For information on mathematical
functions, including accessing detailed information on the properties of a function, see Mathematical Functions (page 60)
and the FunctionAdvisor help page.

Strings
A string is a sequence of characters enclosed in double quotes (" ").

278 • 8 Maple Expressions>

Accessing Characters
You can access characters in a string using brackets.
>

Using Strings
The StringTools package is an advanced set of tools for manipulating and using strings.
>
>

>

>

8.3 Working with Maple Expressions
This section describes how to manipulate expressions using commands. Topics covered include testing the expression
type, accessing operands of an expression, and evaluating an expression.

Low-Level Operations
Expression Types
A Maple type is a broad class of expressions that share common properties. Maple contains over 200 types, including:• `+`• boolean• constant• integer• Matrix• trig• truefalse
For more information and a complete list of Maple types, refer to the type help page.
The type commands return true if the expression satisfies the type check. Otherwise, they return false.

8.3 Working with Maple Expressions • 279

Testing the Type of an Expression
To test whether an expression is of a specified type:• Use the type command.
>>

For information on enclosing keywords in right single quotes ('), see Delaying Evaluation (page 291).
Maple types are not mutually exclusive. An expression can be of more than one type.
>>For information on converting an expression to a different type, see Converting (page 284).
Testing the Type of Subexpressions
To test whether an expression has a subexpression of a specified type:• Use the hastype command.
>

Testing for a Subexpression
To test whether an expression contains an instance of a specified subexpression:• Use the has command.
>>>

The has command searches the structure of the expression for an exactly matching subexpression.

280 • 8 Maple Expressions

For example, the following calling sequence returns false.
>

To return all subexpressions of a particular type, use the indets command. For more information, see
Indeterminates (page 281).
Accessing Expression Components
Left and Right-Hand SideTo extract the left-hand side of an equation, inequality, or range:• Use the lhs command.
To extract the right-hand side of an equation, inequality, or range:• Use the rhs command.
For example:
>
(8.2)

>
(8.3)

>
(8.4)

For the following equation, the left endpoint of the range is the left-hand side of the right-hand side of the equation.
>
(8.5)

>
(8.6)

Numerator and DenominatorTo extract the numerator of an expression:• Use the numer command.
To extract the denominator of an expression:• Use the denom command.

>
If the expression is not in normal form, Maple normalizes the expression before selecting the numerator or denominator.
(For more information on normal form, refer to the normal help page.)8.3 Working with Maple Expressions • 281

>

>

>

The expression can be any algebraic expression. For information on the behavior for non-rational expressions, referto the numer help page.
Components of an Expression
The components of an expression are called its operands.
To count the number of operands in an expression:• Use the nops command.
For example, construct a list of solutions to an equation.
>

Using the nops command, count the number of solutions.
>

For more information on the nops command and operands, refer to the nops help page.
Indeterminates
To find the indeterminates of an expression:• Use the indets command.
The indets command returns the indeterminates as a set. Because the expression is expected to be rational, functions
such as sin(x), f(x), and sqrt(x) are considered to be indeterminate.
>

To return all subexpressions of a particular type, specify the type as the second argument. For information on types,
see Testing the Type of an Expression (page 279).
>

282 • 8 Maple Expressions

To test whether an expressions has subexpressions of a specific type (without returning them), use the has command.
For more information, see Testing for a Subexpression (page 279).

Manipulating Expressions
This section introduces the most commonly used manipulation commands. For additional manipulation commands,
see Iterative Commands (page 301).
Simplifying
To simplify an expression:• Use the simplify command.
The simplify command applies simplification rules to an expression. Maple has simplification rules for various typesof expressions and forms, including trigonometric functions, radicals, logarithmic functions, exponential functions,powers, and various special functions. You can also specify custom simplification rules using a set of side relations.
>>

To limit the simplification, specify the type of simplification to be performed.
>>

You can also use the simplify command with side relations. See Substituting a Value for a Subexpression (page 285).
Factoring
To factor a polynomial:• Use the factor command.
>>

Maple can factor polynomials over the domain specified by the coefficients. You can also factor polynomials over algebraic extensions. For details, refer to the factor help page.
For more information on polynomials, see Polynomial Algebra (page 112).

8.3 Working with Maple Expressions • 283

To factor an integer:• Use the ifactor command.
>

For more information on integers, see Integer Operations (page 78).
Expanding
To expand an expression:• Use the expand command.
The expand command distributes products over sums and expands expressions within functions.
>>

Combining
To combine subexpressions in an expression:• Use the combine command.
The combine command applies transformations that combine terms in sums, products, and powers into a single term.
>

Recall thatwas previously assigned to represent a two-dimensional array (see Creating and Using Arrays (page 271)).

>

The combine command applies only transformations that are valid for all possible values of names in the expression.
>

To perform the operation under assumptions on the names, use the assuming command. For more information about
assumptions, see Assumptions on Variables (page 106).

284 • 8 Maple Expressions>

Converting
To convert an expression:• Use the convert command.
The convert command converts expressions to a new form, type (see Expression Types (page 278)), or in terms of afunction. For a complete list of conversions, refer to the convert help page.
Convert a measurement in radians to degrees:>

To convert measurements that use units, use the Unit Converter or the convert/units command.
>

For information on the Unit Converter and using units, see Units (page 95).
Convert a list to a set:>

Maple has extensive support for converting mathematical expressions to a new function or function class.
>Find an expression equivalent to the inverse hyperbolic cotangent function in terms of Legendre functions.
>

For more information on converting to a class of functions, refer to the convert/to_special_function help page.
Normalizing
To normalize an expression:• Use the normal command.
The normal command converts expressions into factored normal form.

8.3 Working with Maple Expressions • 285>

You can also use the normal command for zero recognition.
>

To expand the numerator and denominator, use the expanded option.
>>

Sorting
To sort the elements of an expression:• Use the sort command.
The sort command orders a list of values or terms of a polynomial.
>>>

For information on sorting polynomials, see Sorting Terms (page 113).
For more information on sorting, refer to the sort help page.

Evaluating Expressions
Substituting a Value for a Subexpression
To evaluate an expression at a point, you must substitute a value for a variable.

286 • 8 Maple Expressions

To substitute a value for a variable using the context panel:
1. Select the expression.
2. From the context panel, select Evaluate at a Point. The Evaluate at a Point dialog is displayed. See Figure 8.2.

Figure 8.2: Evaluate at a Point

3. In the drop-down list, select the variable to substitute.
4. In the text field, enter the value to substitute for the variable. Click OK.
In Worksheet mode, Maple inserts the eval command calling sequence that performs the substitution. This is the mostcommon use of the eval command.
For example, substitutein the following polynomial.

>>

To substitute a value for a variable using palettes:
1. In the Expression palette, click the evaluation at a point item.

2. Specify the expression, variable, and value to be substituted.
For example:>

Substitutions performed by the eval function are syntactical, not the more powerful algebraic form of substitution.
If the left-hand side of the substitution is a name, Maple performs the substitution.
>

8.3 Working with Maple Expressions • 287>

If the left-hand side of the substitution is not a name, Maple performs the substitution only if the left-hand side of thesubstitution is an operand of the expression.
>>

Maple did not perform the evaluation because
refer to the op help page.

is not an operand of

For information on operands,

For algebraic substitution, use the algsubs command, or the simplify command with side relations.
>>

Numerical Approximation
To compute an approximate numerical value of an expression:• Use the evalf command.
The evalf command returns a floating-point (or complex floating-point) number or expression.

288 • 8 Maple Expressions

>

>

>

By default, Maple calculates the result to ten digits of accuracy, but you can specify any number of digits as an index,
that is, in brackets ([ ]).
>For more information, refer to the evalf help page.
See also Numerically Computing a Limit (page 132) and Numeric Integration (page 139).
Evaluating Complex Expressions
To evaluate a complex expression:• Use the evalc command.
If possible, the evalc command returns the output in the canonical form expr1 + i expr2.
In 2-D Math input, you can enter the imaginary unit using the following two methods.
• In the Common Symbols palette, click the i or j item. See Palettes (page 15).
• Enter i or j, and then press the symbol completion key. See Symbol Names (page 21).
>>

In 1-D Math input, enter the imaginary unit as an uppercase i (I).
> evalc(2^(1 + I));

Evaluating Boolean Expressions
To evaluate an expression involving relational operators (• Use the evalb command.

,

,

,

,

, and

):

8.3 Working with Maple Expressions • 289

Note: In 1-D Math input, enter

,

, and

using the <>, <=, and >= operators.

The evalb command uses a three-valued logic system. The return values are true, false, and FAIL. If evaluation is
not possible, an unevaluated expression is returned.
>>>

Important: The evalb command does not perform arithmetic for inequalities involving,,, or
does not simplify expressions. Ensure that you perform these operations before using the evalb command.

, and

>

>

Applying an Operation or Function to All Elements in a List, Set, Table, Array, Matrix, or Vector
You can use the tilde character (~) to apply an operation or function to all of the elements in a list, set, table, Array,
Matrix, or Vector.
In the following example, each element in the Matrix M is multiplied by 2 by adding a tilde character after the multiplication operator( .

>

(8.7)

>

(8.8)

In the following example, the function sin is applied to each element in the Matrix M.

290 • 8 Maple Expressions

>

(8.9)

The tilde character can also be used to apply a function to multiple data sets, for example,>>(8.10)

You can use values in one data structure type to compute values in another data structure type, as long as both data
structures are dimensional and contain the same number of elements. In the following example, the values in an Array
are compared to the values in a Matrix that contains the same number of elements.
>(8.11)For more information, refer to the elementwise help page.
Levels of Evaluation
In a symbolic mathematics program such as Maple, you encounter the issue of levels of evaluation. If you assign y tox, z to y, and then 5 to z, what is the value of x?
At the top-level, Maple fully evaluates names. That is, Maple checks if the name or symbol has an assigned value. If
it has a value, Maple substitutes the value for the name. If this value has an assigned value, Maple performs a substitution,
recursively, until no more substitutions are possible.
For example:>>>
Maple fully evaluates the name x, and returns the value 5.
>

To control the level of evaluation of an expression:• Use the eval command with an integer second argument.
If passed a single argument, the eval command fully evaluates that expression. If you specify an integer second argument,
Maple evaluates the expression to that level.

8.3 Working with Maple Expressions • 291

>

>

>

>

For more details on levels of evaluation, refer to the lastnameevaluation, assigned, and evaln help pages.
Delaying Evaluation
To prevent Maple from immediately evaluating an expression:• Enclose the expression in right single quotes (' ').
Because right single quotes delay evaluation, they are referred to as unevaluation quotes.
>>>

Using an Assigned Name as a Variable or Keyword
If you use an assigned name as a variable, Maple evaluates the name to its value, and passes the value to the command.
In this example, that causes Maple to return an error message.

>
Error, (in sum) summation variable previously assigned, second argument evaluates to 4 = 1.. n

Note: In general, it is recommended that you unassign a name to use it as a variable. See Unassigning a Name Using
Unevaluation Quotes (page 292).
To use an assigned name as a variable:• Enclose the name in unevaluation quotes. Maple passes the name to the command.

292 • 8 Maple Expressions>

Important: It is recommended that you enclose keywords in unevaluation quotes.
For example, if you enclose the keyword left in unevaluation quotes, Maple uses the name, not its assigned value. We
can also unassign the definition of 'x' with unevaluation quotes.
>>>

Full Evaluation of an Expression in Quotes
Full evaluation of a quoted expression removes one set of right single quotes.
>>(8.12)>(8.13)>(8.14)For information on equation labels and equation label references, see Equation Labels (page 70).
Enclosing an expression in unevaluation quotes delays evaluation, but does not prevent automatic simplification.
>(8.15)

Unassigning a Name Using Unevaluation Quotes
To unassign a name:• Assign the name enclosed in unevaluation quotes to itself.
>>

You can also unassign a name using the unassign command. For more information, see Unassigning Names (page 69).

9 Basic Programming
You have used Maple interactively in the previous chapters, sequentially performing operations such as executing asingle command. Because Maple has a complete programming language, you can also use sophisticated programming
constructs.
In Maple, you can write programs called procedures, and save them in modules. These modules can be used and distributed in the same way as Maple packages.
Important: It is strongly recommended that you use the Worksheet mode and 1-D Math input when programming or
using programming commands. Hence, all input in this chapter is entered as 1-D Math.

9.1 In This Chapter
SectionFlow Control (page 293) - Basic programming constructs:
if-then statements and loops

Topics• Conditional Execution (if Statement)

Iterative Commands (page 301) - Specialized, efficient
iterative commands• Creating a sequence• Repetition (for Statement)• Adding and Multiplying Expressions• Selecting Expression Operands• Mapping a Command over a Set or List
• Mapping a Binary Command over Two Lists or Vectors

Procedures (page 303) - Maple programs• Defining and Running Simple Procedures• Procedures with Inputs• Procedure Return Values• Displaying Procedure Definitions• Displaying Maple Library Procedure Definitions• Modules

Programming in Documents (page 306) - Display methods • Code Edit Region
for Maple code
• Startup Code• Document Blocks

9.2 Flow Control
Two basic programming constructs in Maple are the if statement, which controls the conditional execution of statement
sequences, and the for statement, which controls the repeated execution of a statement sequence (a loop).

Conditional Execution (if Statement)
You can specify that Maple perform an action only if a condition holds. You can also perform an action, from a set ofmany, depending on which conditions hold.
Using the if statement, you can execute one statement from a series of statements based on a boolean (true, false, or
FAIL) condition. Maple tests each condition in order. When a condition is satisfied, Maple executes the corresponding
statement, and then exits the if statement.
SyntaxThe if statement has the following syntax.

293294 • 9 Basic Programming

The conditional expressions (conditional_expression1, conditional_expression2, ...) can be any boolean expression.
You can construct boolean expressions using:• Relational operators - <, <=, =, >=, >, <>• Logical operators - and, or, xor, implies, not• Logical names - true, false, FAIL
The statement sequences (statement_sequence1, statement_sequence2, ..., statement_sequenceN) can be any sequenceof Maple statements, including if statements.
The elif clauses are optional. You can specify any number of elif clauses.
The else clause is optional.
Simple if Statements
The simplest if statement has only one conditional expression.

If the conditional expression evaluates to true, the sequence of statements is executed. Otherwise, Maple immediately
exits the if statement.
For example:> x := 1173:> if not isprime(x) thenifactor(x);end if;else Clause
In a simple if statement with an else clause, if the evaluation of the conditional expressions returns false or FAIL,
Maple executes the statement sequence in the else clause.
For example:> if false then"if statement";
else"else statement";
end if;

9.2 Flow Control • 295

elif Clauses
In an if statement with elif clauses, Maple evaluates the conditional expressions in order until one returns true. Maple
executes the corresponding statement sequence, and then exits the if statement. If no evaluation returns true, Maple
exits the if statement.
The keyword elif stands for else if.
> x := 11:> if not type(x, integer) thenprintf("%a is not an integer.", x);elif x >= 10 thenprintf("%a is an integer with more than one digit.", x);elif x >= 0 thenprintf("%a is an integer with one digit.", x);
end if;
11 is an integer with more than one digit.

Order of elif Clauses: An elif clause's statement sequence is executed only if the evaluation of all previous conditional
expressions returns false or FAIL, and the evaluation of its conditional expression returns true. This means thatchanging the order of elif clauses may change the behavior of the if statement.
In the following if statement, the elif clauses are in the wrong order.
> if not(type(x, integer)) thenprintf("%a is not an integer.", x);elif x >= 0 thenprintf("%a is an integer with one digit.", x);elif x >= 10 thenprintf("%a is an integer with more than one digit.", x);
end if;
11 is an integer with one digit.

elif and else Clauses
In an if statement with elif and else clauses, Maple evaluates the conditional expressions in order until one returns true.
Maple executes the corresponding statement sequence, and then exits the if statement. If no evaluation returns true,
Maple executes the statement sequence in the else clause.
> x := -12:
> if not type(x, integer) thenprintf("%a is not an integer.", x);elif x >= 10 thenprintf("%a is an integer with more than one digit.", x);elif x >= 0 thenprintf("%a is an integer with one digit.", x);
else
printf("%a is a negative integer.", x);
end if;-12 is a negative integer.

For more information on the if statement, refer to the if help page.

296 • 9 Basic Programming

Repetition (for Statement)
Using repetition statements, you can repeatedly execute a statement sequence. You can repeat the statements in threeways.
• Until a counter variable value exceeds a limit (for/from loop)• For each operand of an expression (for/in loop)• Until a boolean condition does not hold (while loop or until loop)
for/from Loop
The for/from loop statement repeats a statement sequence until a counter variable value exceeds a limit.
Syntax
The for/from loop has the following syntax.

The behavior of the for/from loop is:
1. Assign the initial value to the name counter.
2. Compare the value of counter to the value of final. If the counter value exceeds the final value, exit the loop. (Thisis the loop bound test.)
3. Execute the statement_sequence.
4. Increment the counter value by the value of increment.
5. Repeat steps 2 to 4, until Maple exits the loop.
The from, by, and to clauses are optional and can be in any order between the for clause and the do keyword. Table
9.1 lists the default clause values.
Table 9.1: Default Clause Values
Clausefrom initial
by increment
to final

Default Value
11
infinity (∞)

ExamplesThe following loop returns the square root of the integers 1 to 5 (inclusive).

9.2 Flow Control • 297> for n to 5 doevalf(sqrt(n));
end do;When the value of the counter variable n is strictly greater than 5, Maple exits the loop.
> n;

The previous loop is equivalent to the following for/from statement.
> for n from 1 by 1 to 5 doevalf(sqrt(n));
end do;The by value can be negative. The loop repeats until the value of the counter variable is strictly less than the final
value.
> for n from 10 by -1 to 3 do
if isprime(n) thenprint(n);end if;end do;> n;

for/in Loop
The for/in loop statement repeats a statement sequence for each component (operand) of an expression, for example,
the elements of a list.

298 • 9 Basic Programming

Syntax
The for/in loop has the following syntax.

The for clause must appear first.
The behavior of the for/in loop is:
1. Assign the first operand of expression to the name variable.
2. Execute the statement_sequence.
3. Assign the next operand of expression to variable.
4. Repeat steps 2 and 3 for each operand in expression. If there are no more operands, exit the loop. (This is the loop
bound test.)
ExampleThe following loop returns a floating-point approximation to the sin function at the angles (measured in degree) in thelist L.
> L := [23.4, 87.2, 43.0, 99.7]:> for i in L do
evalf(sin(i*Pi/180));
end do;while Loop and until Loop
The while loop repeats a statement sequence until a boolean expression does not hold.
The until loop also repeats a statement sequence until a boolean expression does not hold, but it tests the terminating
condition at the end of each iteration of the loop, instead of the beginning.
Syntax
The while loop has the following syntax.

A while loop repeats until its boolean expression conditional_expression evaluates to false or FAIL. For more information on boolean expressions, see Conditional Execution (if Statement) (page 293).
The until loop has the following syntax.

9.2 Flow Control • 299

Note the difference in syntax: the until clause appears in place of end do
ExampleCompare the following loops. In the first one, the terminating condition is met the first time it is tested, and the loop
terminates immediately. In the second one, which uses the until clause, the body of the loop is performed before thecondition is tested, and the loop is used.
> a:=1;(9.1)> while a mod 7 <>1 do
a:=a+1;end do:

> a;
(9.2)

> a:=1;(9.3)> doa:=a+1;
until a mod 7=1:

> a;
(9.4)

The following loop computes the digits of 872,349 in base 7 (in order of increasing significance).
> x := 872349:> while x > 0 do
irem(x, 7);
x := iquo(x, 7);
end do;300 • 9 Basic Programming

To perform such conversions efficiently, use the convert/base command.
> convert(872349, base, 7);

For information on non-base 10 numbers, see Non-Base 10 Numbers (page 80).
General Loop Statements
You can include a while statement in a for/from or for/in loop.
The general for/from loop has the following syntax.

The general for/in loop has the following syntax.

After testing the loop bound condition at the beginning of each iteration of the for loop, Maple evaluates conditional_expression.

9.3 Iterative Commands • 301• If conditional_expression evaluates to false or FAIL, Maple exits the loop.
• If conditional_expression evaluates to true, Maple executes statement_sequence.
The equivalent general until loops have the same form but with end do replaced with until conditional_expression.
Infinite Loops
You can construct a loop for which there is no exit condition, for example, a while loop in which the conditional_expression always evaluates to true. This is called an infinite loop. Maple indefinitely executes an infinite loop unless it
executes a break, quit, or return statement or you interrupt the computation using the interrupt iconin the toolbar(in worksheet versions). For more information, refer to the break, quit, return, and interrupt help pages.
Additional Information
For more information on the for statement and looping, refer to the do help page and the Loops section of the Maple
Statements chapter of the Maple Programming Guide.

9.3 Iterative Commands
Maple has commands that perform common selection and repetition operations. These commands are more efficientthan similar algorithms implemented using library commands. Table 9.2 lists the iterative commands.
Table 9.2: Iterative Commands
Commandseq
addmul
selectremoveselectremovemapzip

Description
Create sequence
Compute numeric sum
Compute numeric product
Return operands that satisfy a condition
Return operands that do not satisfy a condition
Return operands that satisfy a condition and separately return operands that do not satisfy a condition
Apply command to the operands of an expression
Apply binary command to the operands of two lists or vectors

Creating a Sequence
The seq command creates a sequence of values by evaluating a specified expression over a range of index values or
the operands of an expression. See Table 9.3.
Table 9.3: The seq Command
Calling Sequence Syntax
seq(expression, name = initial .. final);

Examplesseq(expression, name in expression);> seq(u, u in [Pi/4, Pi^2/2, 1/Pi]);> seq(exp(x), x=-2..0);

Adding and Multiplying Expressions
The add and mul commands add and multiply sequences of expressions over a range of index values or the operandsof an expression. See Table 9.4.

302 • 9 Basic Programming

Table 9.4: The add and mul Commands
Calling Sequence Syntax
add(expression, name = initial .. final);

Examples> add(exp(x), x = 2..4);mul(expression, name = initial .. final);> mul(2*x, x = 1 .. 10);add(expression, name in expression);> add(u, u in [Pi/4, Pi/2, Pi]);mul(expression, name in expression);> mul(u, u in [Pi/4, Pi/2, Pi]);The endpoints of the index range (initial and final) in the add and mul calling sequence must evaluate to numeric
constants. For information on symbolic sums and products, refer to the sum and product help pages.

Selecting Expression Operands
The select, remove, and selectremove commands apply a boolean-valued procedure or command to the operands ofan expression. For information on operands, refer to the op help page.
• The select command returns the operands for which the procedure or command returns true.
• The remove command returns the operands for which the procedure or command returns false or FAIL.
• The selectremove command returns two expressions of the same type as the input expression.
- The first consists of the operands for which the procedure or command returns true.
- The second consists of the operands for which the procedure or command returns false or FAIL.
The structure of the output is the same as the structure of the input. See Table 9.5.
For information on Maple procedures, see Procedures (page 303).
Table 9.5: The select, remove, and selectremove Commands
Calling Sequence Syntax
select(proc_cmd, expression);

Examples> select(issqr, {198331, 889249, 11751184,
9857934});

remove(proc_cmd, expression);> remove(var -> degree(var) > 3, 2*x^3*y y^3*x + z );selectremove(proc_cmd, expression);> selectremove(x -> evalb(x > round(x)),[sin(0.), sin(1.), sin(3.)]);For information on optional arguments to the selection commands, refer to the select help page.

9.4 Procedures • 303

Mapping a Command over a Set or List
The map command applies a name, procedure, or command to each element in a set or list. See Table 9.6.
Table 9.6: The map Command
Calling Sequence Syntax
map(name_proc_cmd, expression);

Examples> map(f, {a, b, c});> map(u -> int(cos(x), x = 0 .. u), [Pi/4,
Pi/7, Pi/3.0]);

An alternative to the map command is to apply a function elementwise, using ~. For more information ~, see Applying
an Operation or Function to All Elements in a List, Set, Table, Array, Matrix, or Vector (page 289). For information
on mapping over the operands of other expressions, optional arguments to the map command, and other mapping
commands, refer to the map help page.

Mapping a Binary Command over Two Lists or Vectors
The zip command applies a name or binary procedure or command component-wise to two lists or vectors.
By default, the length of the returned object is that of the shorter list or vector. If you specify a value as the (optional)
fourth argument, it is used as the value of the missing elements of the shorter list or vector. In this case, the length of
the return value is that of the longer list or vector. See Table 9.7.
Table 9.7: The zip Command
Calling Sequence Syntax
zip(proc_cmd, a, b);

Examples> zip(f, [i, j], [k, l]);zip(proc_cmd, a, b, fill);> zip(AiryAi, [1, 2], [0], 1);

This is equivalent to
For more information on the zip command, refer to the zip help page.

Additional Information
For more information on looping commands, refer to the corresponding command help page.

9.4 Procedures
A Maple procedure is a program consisting of Maple statements. Using procedures, you can quickly execute the contained
sequence of statements.

304 • 9 Basic Programming

Defining and Running Simple Procedures
To define a procedure, enclose a sequence of statements between proc(...) and end proc statements. In general, you
assign a procedure definition to a name.
The following procedure returns the square root of 2.
> p := proc() sqrt(2); end proc;

Note: Maple returns the procedure definition.
To improve readability of procedures, it is recommended that you define a procedure using multiple lines, and indent
the lines using space characters. To begin a new line (without evaluating the incomplete procedure definition), press
Shift+Enter. When you have finished entering the procedure, press Enter to create the procedure.
For example:> p := proc()
sqrt(2);end proc:

To run the procedure p, enter its name followed by parentheses (( )).
> p();

Procedures with Inputs
You can define a procedure that accepts user input. In the parentheses of the proc statement, specify the parameternames. For multiple parameters, separate the names with commas.
> geometric_mean := proc(x, y)sqrt(x*y);
end proc:

When the user runs the procedure, the parameter names are replaced by the argument values.
> geometric_mean(13, 17);

> geometric_mean(13.5, 17.1);

For more information on writing procedures, including options and local and global variables, refer to the procedure
help page.

Procedure Return Values
When you run a procedure, Maple returns only the last statement result value computed. Maple does not return the
output for each statement in the procedure. It is irrelevant whether you use semicolons or colons as statement separators.
> p := proc(a, b)
a + b;
a - b:
end proc:

9.4 Procedures • 305> p(1, 2);

Displaying Procedure Definitions
Unlike simple Maple objects, you cannot display the value of a procedure by entering its name.
> geometric_mean;

You must evaluate the name of the procedure using the print (or eval) command.
> print(geometric_mean);

Displaying Maple Library Procedure Definitions
Maple procedure definitions are a valuable learning tool. To learn how to program in Maple, it is recommended thatyou examine the procedures available in the Maple library.
By default, the print command returns only the proc and end proc statements and (if present) the description fields
of a Maple procedure.
> print(lcm);

To display a Maple library procedure definition, first set the value of the interface verboseproc option to 2. Then reexecute the print calling sequence.
> interface('verboseproc' = 2):> print(lcm);

306 • 9 Basic Programming

Modules
Maple procedures associate a sequence of commands with a single command. The module, a more complex programming
structure, allows you to associate related procedures and data.
A key feature of modules is that they export variables. This means that the variables are available outside the modulein which they are created. Most Maple packages are implemented as modules. The package commands are exports ofthe module.
For more information on modules, refer to the module help page.

Objects
Objects take the idea of associating data and procedures beyond what modules provide. With objects, multiple instancesof a class of objects can be created. Each individual object can have its own data, yet share other values and procedureswith the entire class objects. A well implemented class of objects can be used in Maple as naturally as a built-in Maple
type.
For more information on objects, refer to the object help page.

9.5 Programming in Documents
To write Maple code, you could simply open a Maple worksheet and start typing. However, if you want to create areadable document with the code interspersed or hidden, there are several options available: code edit regions and start
up code. Both these features use a code editor which has features such as syntax highlighting and line numbers.

Code Edit Region
The code edit region allows you to program in one contained region, in a natural way. Features include the ability topress Enter for line breaking and indentation preservation. Figure 9.1 shows the expanded code edit region.
To insert a new code edit region into your worksheet:• From the Insert menu, select Code Edit Region.

Figure 9.1: Code Edit Region

To execute the code within this region, click anywhere in this region, then click the Execute Selection icon (the toolbar. (Alternatively, from the Evaluate menu, select Execute Code.)) on

You can hide the code in a code edit region by minimizing the region. To minimize, select View → Collapse Code
Edit Region. When the region is minimized, an icon appears with the first line of the code written next to it. It is recommended that you make the first line a comment describing the program or programs contained in the region. See
Figure 9.2.

9.5 Programming in Documents • 307

Figure 9.2: Collapsed Code Edit Region

To re-execute the code in the region while it is collapsed, click this icon.
For more information, refer to the CodeEditRegion help page.

Startup CodeStartup code allows you to define commands and procedures that are executed each time the document is opened andafter restart is called. This code is completely hidden to others reading the document. For example, use this region todefine procedures that will be used throughout the document code but that would take up space and distract readersfrom the message of the document.
To enter startup code for a document:
1. From the Edit menu, select Startup Code. Alternatively, click the startup code icon in the toolbar,.

2. Enter commands to be run each time the worksheet is opened or restart is called.
3. To check the syntax of the entered code while entering your Maple commands or before closing the editor, fromthe Edit menu. select Check Syntax Now.
Note: You can also check the Check Syntax Automatically option to enable continuous syntax checking. It is recommended that you check the syntax before saving so that your startup code does not prevent Maple from opening successfully.
4. To save the contents, from the File menu, select Save Code. Alternatively, click the save icon,
5. Close Startup Code.

Figure 9.3: Startup Code Editor

For more information, refer to the startupcode help page.

.

308 • 9 Basic Programming

9.6 Additional Information
The Maple Programming Guide provides an in-depth reference for programming in Maple. Topics include statements,
data structures, procedures, packages, and debugging your code.
• Access via the help system. From the Table of Contents, select Manuals>Programming Guide.
The Programming Guide is also available as a PDF on the Maplesoft website.
http://www.maplesoft.com/documentation_center10 Embedded Components and Maplets
These graphical components help you to create documents to use and share with colleagues or students, that interact
with Maple code within the document without needing the reader to understand that Maple code. Other methods ofinteraction with Maple are described throughout this guide.

10.1 In This Chapter
SectionTopicsUsing Embedded Components (page 309) - Basic interacting with Maple • Interacting with Components
documents containing embedded components• Printing and Exporting
Creating Embedded Components (page 312) - Methods for creatingembedded components that work together and with your document• Inserting Components• Editing Components• Removing Components• Integrating into a Document• Maplet File

Using Maplets (page 318) - Methods for launching a Maplet• Maple Document
Authoring Maplets (page 319) - Methods for authoring and saving a Maplet • Simple Maplet• Maplet Builder• Maplets Package• Saving

10.2 Using Embedded Components
Interacting
Embedded components allow readers to interact with Maple code through graphical components, rather than commands.
They can be used alone, as with a button that you click to execute code, or together, such as a drop-down menu where
you select an item, and a change takes place in a plot component.
Component Descriptions
Table 10.1: Embedded Component Descriptions
Component Name and Description
Button - Click to perform an action; that is, execute code.

Inserted Image

Check Box - Select or de-select. Change the caption, and enter code to
execute when the value changes.
Combo Box - Select one of the listed options from the drop-down menu.
Change the items listed, and enter code to execute when the value changes.
Data Table - Link this embedded component to a Matrix, Vector, or Arrayin your worksheet.

309

310 • 10 Embedded Components and Maplets

Component Name and Description
Inserted Image
Dial - Select or display an integer or floating-point value. Change the display,and enter code to execute when the value changes.

Label - Display a label. The value can be updated based on code in the
document or another embedded component.
List Box - Display a list of items. Change the items listed, and enter code
to execute when an item is selected.
Math Expression - Enter or display a mathematical expression. The value
can be updated based on code in the document or another embedded
component.
Meter - Select or display an integer or floating-point value. Change thedisplay, and enter code to execute when the value changes.

Microphone Component - Capture sound from a recording device. Change
setting options from properties, and enter code for start and stop recording
actions.
Plot - Display a 2-D or 3-D plot or animation. This plot or animation can beinteracted with in the same way as other plots (see Plots andAnimations (page 187)). The value can be updated based on code in the
document or another embedded component. You can also enter code to be
executed when the Click and Drag pointer is used to click or drag in theplot region.

Radio Button - Use with other radio buttons to select one in a group. Enter
code to execute when the value changes.
Rotary Gauge - Select or display an integer or floating-point value. Change
the display, and enter code to execute when the value changes.

Slider - Select or display an integer or floating-point value. Change thedisplay, and enter code to execute when the value changes.
Text Area - Enter or display plain text. The value can be updated based oncode in the document or another embedded component, and you can entercode to execute when the value changes.
Toggle Button - Select or display one of two options. Change the images
displayed, and enter to code to execute when the value changes.

10.2 Using Embedded Components • 311

Component Name and Description
Inserted Image
Video Player - Play a video. Enter code that specifies an action to perform
when the video player reaches a marker during playback.

Volume Gauge - Select or display an integer or floating-point value. Change
the display, and enter code to execute when the value changes.

Shortcut Component - Use to hyperlink various types of content, including
help pages, MapleCloud documents, and URLs.

Speaker Component - Play a sound. Customize component by modifying
setting options under properties.

Example 1 - Using Embedded Components
This example demonstrates several components working together to perform a task. The user inputs an expression,
which is plotted when the button is clicked. Plot options are controlled by text areas, a combo box, a math expression,and radio buttons.

312 • 10 Embedded Components and Maplets

Printing and Exporting a Document with Embedded Components
Printing: When printing a document, embedded components are rendered as they appear on screen.
Exporting: Exporting a document with embedded components to other formats produces the following results.
• HTML format - components are exported as .gif files.
• RTF format - components are rendered as bitmap images in the .rtf document.
• LaTeX - components are exported as .eps files.
• PDF - components are rendered as static images.

10.3 Creating Embedded Components
Embedded Components are graphical components that you can add to your document. They provide interactive accessto Maple code without requiring the user to know Maple commands, and include buttons, sliders, math and text input
areas, plot display, and shortcut components.

Inserting Components
The graphical interface components can be inserted by using the Components palette (Figure 10.1) or by cutting/copying
and pasting existing components to another area of the document. Although copied components have most of the samecharacteristics, they are distinct.
If the Components palette is not visible, see Palettes (page 15) for instructions on viewing palettes.

10.3 Creating Embedded Components • 313

Figure 10.1: Components Palette

Editing Component Properties: General Process
To edit properties of components embedded in the document:
1. Click the component to display the context panel.
2. In the context panel, enter values and contents in the fields as necessary.
3. To define an action, such as an action to perform when the slider is moved, click the component, and then select
Edit Value Changed Code... from the Context Panel. A Code Edit Region opens allowing you to enter Maple
code that is executed when the event occurs. For details, refer to the DocumentTools help page.
Note: You can also edit embedded component properties and actions that are performed when a value changes by using
Maple worksheet Edit menu options, Edit > Component Properties, and Edit > Component Code, respectively.
For more information on options available in the Edit menu, see Edit menu options.

Removing Graphical Interface Components
You can remove an embedded component by:• Using the Delete key• Using the Backspace key• Placing the cursor at the component and selecting from the document menu, Edit→Delete Element

Integrating Components into a Document
Use embedded components to display information from calculations, obtain input from a reader, or perform calculations
at the click of a button, all without your readers having an understanding of Maple commands. They can be entered inany part of a Maple document, including a document block or table. For details on each component, see its help page.

314 • 10 Embedded Components and Maplets

This simple example inserts a slider with a label that indicates the current value of the slider.
1. Place the cursor in the location where the embedded component is to be inserted.
2. In the Components palette, click the Slider item. A slider is inserted into the document.
3. In the Components palette, click the Label item. A label is inserted next to the slider.

4. Click the label component. The Label context panel opens. See Figure 10.2.

Figure 10.2: Label Properties Dialog

Figure 10.3: Slider Properties Dialog

5. Name the component SliderLabel and click OK.
6. Click the slider component. The Slider context panel opens. See Figure 10.3.

10.3 Creating Embedded Components • 315

7. Name the component Slider1.
8. Enter the value at the lowest position as 0 and the highest as 100.
9. Enter major tick marks at 20 and minor tick marks at 10.
10. Make sure that the Continuous Update On Drag check box is selected.
11. Click OK.
12. To define an action, click the slider component, and then select Edit Value Changed Code... from the context
panel. This launches a dialog that allows you to program the action of displaying the slider value in the label component. The dialog includes information on how to program actions between embedded components. The use...in/end
use; statement allows you to specify routines using the short form of accessing a package command without invoking
the package. For details on this command, refer to the use help page.
13. Before the end use; statement at the bottom of the dialog, enter the following command.
Do(%SliderLabel(caption)=%Slider0(value));
14. Save the code, and exit the code editor.
As you move the arrow indicator, the value from the slider populates the Label caption field.
For details on this command, refer to the DocumentTools[Do] help page.

Example 2 - Creating Embedded Components
In chapter 7 (see Embedded Components (page 263)), you created a document that included embedded components,
imported from a task template. Here, we re-create that configuration of components. This example takes two parameters,
andas inputs, then plots the function

and calculates.

1. Create the components.
The table layout is best done after the components are finished, in case the configuration of the components changes
as you are working.
Create two DialComponents to set the parameters,

and, one RotaryGaugeComponent to display the result,

one PlotComponent to display the plot, and one MathContainerComponent to display the function. Note that you
do not have to use the dial and rotary gauge components here, you can also use the slider instead.

,316 • 10 Embedded Components and Maplets

Figure 10.4: The Inserted Components

2. Edit the display of the components.
Open the context panel for the first DialComponent, and notice that it already has a name. This name is used to reference
the component from other components, and is unique. Change the display of each of the components as follows:• Dial0: no changes.
• Dial1: change the Value at Lowest Position to 1, the Value at Highest Position to 10, the Spacing of Major Tick
Marks to 1, and the Spacing of Minor Tick Marks to 1.
• RotaryGauge0: change the Value at Highest Position to 40, the Spacing of Major Tick Marks to 5, and theSpacing of Minor Tick Marks to 1.
• Plot0: no changes.
• MathContainer0: change the Width in Pixels to 200, and the Height in Pixels to 45.
Note the names of all of the components, and close each dialog before moving on.
3. Create actions for the components.
Components can perform actions when their values are changed, so the code to execute needs to be in the dials. Thatway, whenever one of them is changed, the other components are updated to reflect that change.
The following Maple commands retrieve the values of the parameters and display them in the other three components:> parameter1:=Do(%Dial0):> parameter2:=Do(%Dial1):

10.3 Creating Embedded Components • 317> Do(%RotaryGauge0=parameter1/parameter2);> Do(%Plot0=plot((parameter2*x+parameter1), x=-50..50, y=-50..50));> Do(%MathContainer0=(y=parameter2*x+parameter1));
4. Test the actions.
To test these commands, first load the DocumentTools package with the following command.
> with(DocumentTools):
After loading the package, execute the commands in the document, and verify that the components you inserted are
updated: the gauge should change to the computed value, a plot should appear in the plot component, and the function
should display in the math container.
5. Troubleshooting.
The first Do command gives an error, because the second parameter is 0. One way to avoid this problem is to change
the range of the second dial. In the Component Properties dialog for the second DialComponent, change the Valueat Lowest Position from 0 to 1. Alternatively, you could change the code to compensate, with an if statement.
6. Copy the actions to the components.
After the commands work as expected, you can copy them into the components.
• Click the first DialComponent and select Edit Value Changed Code from the context panel. Copy and paste thecommands into the space between the use statements.

Figure 10.5: DialComponent Action Code Editor• Save the code, and exit the code editor.
• Do the same for the second DialComponent. Now, moving either dial will update the rotary gauge, plot, and formuladisplayed in the math component.

318 • 10 Embedded Components and Maplets

7. Create the layout for the components.
Create a table, and then cut and paste the components into it, along with explanatory text. Important: you must cut,
not copy, the components, or their names will be changed to avoid duplication. For information on creating andmodifying tables, refer to Tables (page 245).

10.4 Using Maplets
A Maplet is a popup graphical user interface that provides interactive access to the Maple engine through buttons, text
regions, slider bars, and other visual interfaces. You can create your own Maplets, and you can take advantage of thebuilt-in Maplets that cover numerous academic and specialized topics. Built-in Maplets include some assistants andtutors, such as the ODE Analyzer. For more information on this assistant, see Ordinary Differential Equations(ODEs) (page 89).
Maplet applications are launched by executing Maplet code. Maplet code can be saved in a Maplet (.maplet) file or
Maple document (.mw).

Maplet FileTo launch a Maplet application saved as a Maplet file:• In Windows, double-click the file from a Windows file browser.
• In UNIX and on Macintosh, use the command-line interface. At the command-line, enter maple -q <maplet_filename>.
To view and edit the Maplet code contained within the .maplet file:
1. Start Maple.
2. From the File menu, select Open. Maple displays the Open dialog.
3. In the Files of Type drop-down list, select .maplet.
4. Navigate to the location of the .maplet file and select the file.

10.5 Authoring Maplets • 319

5. Click Open.

Maple Document
To launch a Maplet application for which the Maple code is contained in a Maple document, you need to execute theMaplet code. To display the Maplet application, you must use the Maplets[Display] command. Note: The Maplet
code may be quite large if the Maplet application is complex. In this case, execute the document to ensure user-definedprocedures that are referenced in the Maplet application are also defined.
Typical procedure:
1. If present, evaluate user-defined procedures.
Myproc:=proc..

2. Load the Maplets[Elements] package.
with( Maplets[Elements] );3. Evaluate the Maplet definition.
Maplet_name:=Maplet( Maplet_definition );4. Display the Maplet application.
Maplets[Display]( Maplet_name );Important: When a Maplet application is running, you cannot interact with the Maple document.

10.5 Authoring Maplets
To author Maplets, you can use the Maplet Builder (GUI-based) or the Maplets package (syntax-based). The Maplet
Builder allows you to drag and drop buttons, sliders, text regions, and other elements to define the Maplet applicationand set the element properties to perform an action on selection or update of the element. The Maplet Builder is designed
to create simple Maplets. The Maplets package offers more capabilities, control, and options when designing complicatedMaplet applications.
Designing a Maplet application is similar to constructing a house. When building a house, you first construct theskeletal structure (that is, foundation, floors, and walls) and then proceed to add the windows and doors. Constructing
a Maplet is no different. First define the rows and columns of the Maplet application and then proceed to add the bodyelements (such as buttons, text fields, and plot regions).

Simple Maplet
A Maplet application can be defined using the commands in the Maplets[Elements] package and then launched using
the Maplets[Display] command. The following commands define and run a very simple Maplet application that contains
the text string "Hello World".
> with(Maplets[Elements]):> MySimpleMaplet:= Maplet([["Hello World"]]):> Maplets[Display](MySimpleMaplet):Figure 10.6: A Simple Maplet

320 • 10 Embedded Components and Maplets

Maplet Builder
To start the Maplet Builder:• From the Tools menu, select Assistants → Maplet Builder.

Figure 10.7: Maplet Builder Interface

The Maplet Builder is divided into four different panes.
• The Palette pane displays palettes, which contain Maplet elements, organized by category. For a description of theelements, see the MapletBuilder/Palette help page. The Body palette contains the most popular elements.
• The Layout pane displays the visual elements of the Maplet.
• The Command pane displays the commands and corresponding actions defined in the Maplet.
• The Properties pane displays the properties of an instance of a defined element in the Maplet.
Example 3 - Design a Maplet Using the Maplet Builder
In this example, shown in Figure 10.8, the Maplet user enters a function and plots the result.

10.5 Authoring Maplets • 321

Figure 10.8: Image of the Maplet
Button element
Label element
Plot element
TextField element

Figure 10.9: Body Elements Used to Define This Maplet
ActionDefine the number of rows in the Maplet:
1. In the Properties pane:a. In the drop-down list, selectBoxColumn1.
b. Change the numrows field to 2.

Add a plot region to row 1:
2. From the Body palette, drag the Plotter element to
the first row in the Layout pane.

Result in MapletBuilder

322 • 10 Embedded Components and Maplets

ActionAdd columns to row 2:
3. In the Properties pane:a. In the drop-down list, select BoxRow2.
b. Change the numcolumns field to 3.

Add a label to row 2:
4. From the Body palette, drag the Label element to
the left column in the Layout pane.
5. In the Properties pane:a. In the drop-down list, select Label1.
b. Change the caption field to Enter afunction of x.

Add a text region to row 2:
6. From the Body palette, drag the TextField element
to the middle column. The TextField element
allows the Maplet user to enter input that can be
retrieved in an action.
7. If necessary, resize the Maplet Builder to display
the entire Layout pane.

Add a button to row 2:
8. From the Body palette, drag the Button element to
the right column in the Layout pane.
9. In the Properties pane:a. In the drop-down list, select Button1.
b. Change the caption field to Plot.
c. In the onclick property drop-down list,
select <Evaluate>.

Result in MapletBuilder

10.5 Authoring Maplets • 323

ActionResult in MapletBuilder
10. In the Evaluate Expression dialog that displays, theTarget drop-down list contains the defined elements
to which you can send information, in this case,
Plotter1 and TextField1. The List group box,
located below the Expression group box, displays
the defined elements to which you can retrieve
information, in this case, TextField1.
a. In the Target drop-down list, selectPlotter1.
b. In the Command Form tab, enterplot(TextField1, x=-10..10) in the
Expression group box. (Note: Do notinclude a semicolon (;) at the end of theplot command.) You can also
double-click TextField1 in the List groupbox to insert this element in the command
syntax.
c. Click Ok.
Run the Maplet:
11. From the File menu, select Run. You are prompted to save the Maplet. Maplets created with the Maplet Builder are saved as.maplet files.
12. Click Yes and navigate to a location to save this Maplet.

For further information on the Maplet Builder, see the MapletBuilder help page. For more examples of designing
Maplets using the Maplet Builder, see examples/MapletBuilder.

Maplets Package
When designing a complicated Maplet, the Maplets package offers greater control. The Maplets[Elements] subpackage
contains the elements available when designing a Maplet application. After you define the Maplet, use theMaplets[Display] command to launch the Maplet.
For more information on the Maplets package, refer to the MapletsPackage help page. For more examples ofdesigning Maplets using the Maplets package, see the Maplets/Roadmap help page.
Example 4 - Design a Maplet Using the Maplets Package
To introduce the structure of designing Maplets using the Maplets package, this example illustrates the equivalentsyntax for the Example 3 - Design a Maplet Using the Maplet Builder (page 320).
Load the Maplets[Elements] package.
> with(Maplets[Elements]):
Define the Maplet application. To suppress the display of the data structure associated with the Maplet application,end the definition with a colon.
> PlottingMaplet:=Maplet(
BoxLayout(
BoxColumn(# First Box Row
BoxRow(# Define a Plot region
Plotter('reference' = Plotter1)# End of first Box Row

324 • 10 Embedded Components and Maplets),# Second Box Row
BoxRow(# Define a Label
Label("Enter a function of x "),# Define a Text Field
TextField('reference' = TextField1),# Define a Button
Button(caption="Plot", Evaluate(value = 'plot(TextField1,
x = -10..10)', 'target' = Plotter1))# End of second Box Row)# End of BoxColumn)# End of BoxLayout)# End of Maplet):

Launch the Maplet.
> Maplets[Display](PlottingMaplet);For further examples using both the MapletBuilder and Maplets package commands, see the Maplets example
worksheets. For a listing, refer to the examples/index help page.

SavingWhen saving a Maplet, you can save the document as an .mw file or you can export the document as a .maplet file.
Maple Document
To save the Maplet code as an .mw file:
1. From the File menu, select Save.
2. Navigate to the save location.
3. Enter a filename.
4. Click Save.
If the document contains only Maplet code, it is recommended that you export the document as a .maplet file.
Maplet FileTo export the Maplet code as a .maplet file:
1. From the File menu, select Export As.
2. In the Files of Type drop-down list, select Maplet.
3. Navigate to the export location.
4. Enter the filename.
5. Click Save.

11 Input, Output, and Interacting with Other Products
11.1 In This Chapter
SectionWriting to Files (page 325) - Saving to Maple file formats

Topics• Saving Data to a File
• Saving Expressions to a File

Reading from Files (page 327) -Opening Maple files• Reading Data from a File
• Reading Expressions from a File

Exporting to Other Formats (page 329) - Exporting documents • Exporting Documents
in file formats supported by other software• MapleNet
Connectivity (page 331) - Using Maple with other programming • Translating Maple Code to Other Programming Languages
languages and software• Accessing External Products from Maple• Accessing Maple from External Products• Sharing and Storing Maple Worksheet Content with the
MapleCloudTM

11.2 Writing to Files
Maple supports file formats in addition to the standard .mw file format.
After using Maple to perform a computation, you can save the results to a file for later processing with Maple or anotherprogram.
Note: Make sure you have write access to the directory in order to execute the example in the following subsections.

Saving Data to a File
If the result of a Maple calculation is a long list or a large array of numbers, you can convert it to Matrix form andwrite the numbers to a file using the ExportMatrix command. This command writes columns of numerical data to afile, allowing you to import the numbers into another program. To convert a list or a list of lists to a Matrix, use theMatrix constructor. For more information, refer to the Matrix help page.

>>
If the data is a Vector or any object that can be converted to type Vector, use the ExportVector command. To convert
lists to Vectors, use the Vector constructor. For more information, refer to the Vector help page.

325

326 • 11 Input, Output, and Interacting with Other Products>(11.1)>(11.2)>
You can extend these routines to write more complicated data, such as complex numbers or symbolic expressions. For
more information, refer to the ExportMatrix and ExportVector help pages.
For more information on matrices and vectors, see Linear Algebra (page 118).

Saving Expressions to a FileIf you construct a complicated expression or procedure, you can save them for future use in Maple. If you save theexpression or procedure in the Maple internal format, Maple can retrieve it more efficiently than from a document.
Use the save command to write the expression to a .m file. For more information on Maple internal file formats, referto the file help page.

>In this example, small expressions are used. In practice, Maple supports expressions with thousands of terms.
>(11.3)>(11.4)

You can save these expressions to the file qbinom.m.
>
Clear the memory using the restart command and retrieve the expressions using the read command.
>>

11.3 Reading from Files • 327>(11.5)For more information on writing to files, refer to the save help page.

Saving Data as Part of a Workbook
You can save all files related to a common Maple project as a workbook (.maple) file. Saving your data files andworksheets (or documents) as a workbook allows you to use this saved data across all .mw file inside your workbook.

11.3 Reading from Files
The most common reason for reading files is to load data, for example, data generated in an experiment. You can store
data in a text file, and then read it into Maple.

Reading Data from a File
Import Data AssistantIf you generate data outside Maple, you can read it into Maple for further manipulation. This data can be an image, asound file, or columns of numbers in a text file. You can easily import this external data into Maple using the Import
Data Assistant, where the supported file formats include files of type Excel®, MATLAB®, Image, Audio, Matrix
Market, and Delimited.
To launch the Import Data Assistant:
1. From the Tools menu, select Assistants, and then Import Data.
2. A dialog window appears where you can navigate to your data file. Select the file that you want to import data from,and then select the file type before clicking Next.
3. From the main window, you can preview the selected file and choose from the applicable options based on theformat of the file read in before importing the data into Maple. See Figure 11.1 for an example.

Figure 11.1: Import Data Assistant328 • 11 Input, Output, and Interacting with Other Products

ImportMatrix Command
The Import Data Assistant provides a graphical interface to the ImportMatrix command. For more information,
including options not available in the assistant, refer to the ImportMatrix help page.

Reading Expressions from a File
You can write Maple programs in a text file using a text editor, and then import the file into Maple. You can paste thecommands from the text file into your document or you can use the read command.
When you read a file with the read command, Maple treats each line in the file as a command. Maple executes thecommands and displays the results in your document but it does not, by default, insert the commands from the file inyour document.
For example, the file ks.txt contains the following Maple commands.
S:= n -> sum( binomial( n, beta ) * ( ( 2*beta )! / 2^beta - beta!*beta ), beta=1..n );S(19);
Note that the file should not contain prompts (>) at the start of lines.
When you read the file, Maple displays the results but not the commands.

(11.6)>>(11.7)

If you set the interface echo option to 2, Maple inserts the commands from the file into your document.
>> S:= n -> sum( binomial( n, beta ) * ( ( 2*beta )! / 2^beta - beta!*beta ), beta=1..n );> S(19);(11.8)For more information, refer to the read and interface help pages.

11.4 Exporting to Other Formats • 329

Reading Data From Workbook Attachments
Data stored in a workbook in the form of an attachment, can be accessed easily using the workbook URI. For information on workbook attachments, see worksheet,workbook,attachFiles. For information on the workbook URI format,
see worksheet,workbook,uri.

11.4 Exporting to Other Formats
Exporting Documents
You can save your documents by selecting Save or Save As from the File menu. By selecting Export As from theFile menu, you can also export a document in the following formats: HTML, LaTeX, Maple input, Maplet application,
Maple text, plain text, PDF, and Rich Text Format. This allows you to access your work outside Maple.
HTML
The .html file that Maple generates can be loaded into any HTML browser. Exported mathematical content can bedisplayed in one of two formats, GIF or MathML 2.0, and is saved in a separate folder. MathML is the Internet standard,sanctioned by the World Wide Web Consortium (W3C), for the communication of structured mathematical formulae
between applications. For more information about MathML, refer to the MathML help page.
Maple documents that are exported to HTML translate into multiple documents when using frames. If the frames feature
is not selected, Maple creates only one page that contains the document contents.
LaTeX
The .tex file generated by Maple is ready for processing by LaTeX. All distributions of Maple include the necessarystyle files. By default, the LaTeX style files are set for printing the .tex file using the dvips printer driver. You canchange this behavior by specifying an option to the \usepackage LaTeX command in the preamble of your .tex file.
For more information, refer to the exporttoLaTeX help page.
Maple Input
You can export a Maple document as Maple input so that it can be loaded using the Maple Command-line version.
Important: When exporting a document as Maple input for use in Command-line Maple, your document must contain
explicit semicolons in 1-D Math input. If not, the exported .mpl file does not contain semicolons, and Command-line
Maple generates errors.
Maplet Application
The Export as Maplet facility saves a Maple document as a .maplet file, so that you can run it using the commandline interface or the MapletViewer. The MapletViewer is an executable program that can launch saved Maplet applications. It displays and runs Maplet applications independently of the Maple Worksheet interface.
Important: When exporting a document as a Maplet Application for use in Command-line Maple or the
MapletViewer, your document must contain explicit semicolons. If not, the exported .maplet file does not containsemicolons, and Command-line Maple and the MapletViewer generates errors.
Maple Text
Maple text is marked text that retains the distinction between text, Maple input, and Maple output. Thus, you can export
a document as Maple text, send the text file by email, and the recipient can import the Maple text into a Maple session
and regenerate the computations in the original document.

330 • 11 Input, Output, and Interacting with Other Products

PDF
Export a Maple document to a Portable Document Format (PDF) file so that you can open the file in a reader such as
Adobe® Acrobat®. The PDF document is formatted as it would appear when the Maple worksheet is printed using theactive printer settings.
Note: Images, plots, and embedded components may be resized in the PDF file.
Plain Text
Export a Maple document as plain text so that you can open the text file in a word processor.
Rich Text Format (RTF)
Export a Maple document to a rich text format file so that you can open and edit the file in a word processor.
Note: The generated .rtf format is compatible with Microsoft Word and Microsoft WordPad only.
Summary of Translation
Table 11.1: Summary of Content Translation When Exporting to Different Formats
Content

HTML

LaTeX

Maple
MapletMaple Text Plain Text Rich Text PDF Format
Input
Application
Format
Text
Maintained
Maintained
Preceded Preceded by Preceded by Maintained Maintained Maintainedby ###1-D Math
Maintained
Maintained
Maintained Maintained Preceded by Preceded by Static image Static image>>
2-D Math
GIF or MathML LaTeX
1-D Math 1-D Math 1-D Math or 1-D Math or Static image Either text or(if possible) (if possible) character-based character-based
shapestypesetting typesetting
depending on
optionselected
Plot
GIF
Postscript file Not
Not
Not
Not
Static image Static image
exported
exported
exported
exported
Animation
Animated GIF Not exported Not
Not
Not
Not
Not
Static image
exported
exported
exported
exported
exported
Hidden content Not exported
Not exported Not
Not
Not
Not
Not
Not exported
exported
exported
exported
exported
exported
Manually
Not supported Not supported Not
Not
Not
Not
RTF page Maintained
inserted page
supported supported supported supported break object
break
Hyperlink
Links to help
Plain text
Plain text Plain text Plain text Plain text Plain text
Plain text
pages become
plain text. Links
to documents arerenamed andconverted toHTML links
Embedded
GIF
Not exported Not
Not
Not
Not
Static image Static image
image orexported
exported
exported
exportedsketch output
Spreadsheet
HTML table
LaTeX tables Not
Not
Not
Not
RTF table Static image
exported
exported
exported
exported

11.5 Connectivity • 331

Content
Document
style

HTML

LaTeX

Maple
Input
Approximated LaTeX
Not
by HTML style environments exported
attributes
and sections,
LaTeX macro
calls

MapletMaple Text Plain Text Rich Text
Application
FormatNot
Not
Not
RTF styleexported
exported
exported

PDF Format
Maintained

MapleNet
Overview of MapleNet
Using MapleNet, you can deploy Maple content on the web. Powered by the Maple computation engine, MapleNet
allows you to embed dynamic formulas, models, and diagrams as live content in webpages. The MapleNet software
is not included with the Maple software. For more information on MapleNet, visit http://www.maplesoft.com/maplenet.
MapleNet Documents and Maplets
After you upload your Maple document to the MapleNet server, it can be accessed by anyone in the world using a web
browser. Even if viewers do not have a copy of Maple installed, they can view documents and Maplets, manipulate 3D plots, and execute code at the click of a button.
TM

Custom Java Applets and JavaServer Pages

Technology

MapleNet provides a programming interface to the Maple math engine so commands can be executed from a Java applet
or using JavaServer PagesTM technology. Embed MapleNet into your web application, and let Maple handle the mathand visualization.

11.5 Connectivity
Translating Maple Code To Other Programming Languages
Code Generation
The CodeGeneration package is a collection of commands and subpackages that enable the translation of Maple code
to other programming languages. Languages currently supported include: C, C#, Fortran 77, Java, MATLAB®, Visual
Basic, Perl, and Python.
For details on Code Generation, refer to the CodeGeneration help page.

Accessing External Products from Maple
External Calling
External calling allows you to use compiled C, C#, Fortran 77, or Java code in Maple. Functions written in these languages can be linked and used as if they were Maple procedures. With external calling you can use pre-written optimized
algorithms without the need to translate them into Maple commands. Access to the NAG library routines and othernumerical algorithms is built into Maple using the external calling mechanism.
External calling can also be applied to functions other than numerical algorithms. Routines exist that accomplish avariety of non-mathematical tasks. You can use these routines in Maple to extend its functionality. For example, you
can link to controlled hardware via a serial port or interface with another program. The Database package uses externalcalling to allow you to query, create, and update databases in Maple. For more information, refer to the Database help
page.
For more information on using external calling, refer to the ExternalCalling help page.

332 • 11 Input, Output, and Interacting with Other Products

Mathematica Translator
The MmaTranslator package provides translation tools for converting Mathematica® expressions, command operations,and notebooks to Maple. The package can translate Mathematica input to Maple input and Mathematica notebooks to
Maple documents. The Mma subpackage contains commands that provide translation for Mathematica commands
when no equivalent Maple command exists. In most cases, the command achieves the translation through minor manipulations of the input and output of similar Maple commands.
Note: The MmaTranslator package does not convert Mathematica programs.
There is a Maplet interface to the MmaTranslator package. For more information, refer to the MmaToMaple help
page.
Matlab Package
The Matlab package enables you to translate MATLAB® code to Maple, as well as call selected MATLAB® functions
from a Maple session, provided you have MATLAB® installed on your system.
For more information, refer to the Matlab help page.

Accessing Maple from External Products
Microsoft Excel Add-In
Maple is available as an add-in to Microsoft Excel. This add-in is supported for Excel 365 (desktop) and Excel 2019
for Windows, and provides the following features.
• Access to Maple commands from Excel• Ability to copy and paste between Maple and Excel• Access to a subset of the Maple help pages• Maple Function Wizard to step you through the creation of a Maple function callTo enable the Maple Excel Add-in:
1. In Excel, click the File menu and select Options.
2. Click Add-ins.
3. In the Manage box select Excel Add-ins, and then Go.
4. Navigate to the Excel subdirectory of your Maple installation and select the file:- WMIMPLEX64.xla (that is, select $MAPLE/Excel/WMIMPLEX64.xla), and click OK.
5. Select the Maple Excel Add-in check box.
6. Click OK.
For further details on enabling the Maple Excel Add-in, refer to the Excel help page.
For information on using this add-in, refer to the Using Maple in Excel help file within Excel.
To view this help file:
1. Enable the add-in.
2. From the Add-ins tab, view the Maple toolbar.
3. On the Maple toolbar, click the Maple help icon.

11.5 Connectivity • 333

OpenMaple
OpenMaple is a suite of functions that allows you to access Maple algorithms and data structures in your compiled C,
C#, Java, or Visual Basic programs. (This is the reverse of external calling, which allows access to compiled C, C#,
Fortran 77, and Java code from Maple.)To run your application, Maple must be installed. You can distribute your application to any licensed Maple user. For
additional terms and conditions on the use of OpenMaple, refer to the extern/OpenMapleLicensing.txt file in your
Maple installation.
For more details on using OpenMaple functions, refer to the OpenMaple help page.
MapleSim
MapleSimTM is a complete environment for modeling and simulating multidomain engineering systems. During asimulation, MapleSim uses the symbolic Maple computation engine to generate the mathematical models that represent
the system behavior.
Because both products are tightly integrated, you can use Maple commands and technical document features to edit,
manipulate, and analyze a MapleSim model. For example, you can use Maple commands and tools to manipulate yourmodel equations, develop custom components based on a mathematical model, and visualize simulation results.
MapleSim software is not included with the Maple software. For more information on MapleSim, visit
http://www.maplesoft.com/maplesim.

Sharing and Storing Maple Content
The MapleCloudYou can use the MapleCloud to share or store your Maple documents and workbooks. Upload Maple documents orworkbooks. Package workbooks offer a way to share a Maple package with other users, including source code, documentation and examples.
The MapleCloud has private and public sharing. You can share with all Maple users, share with a private group, or
upload and store content in a user-specific area that only you can access.
Users need an internet connection to use the MapleCloud. Anyone can access publicly shared documents. To sharecontent, create, manage and join user groups; and view group-specific content, you must log in to the MapleCloud
using a Maplesoft.com, Gmail™, or Google Mail™ account name and password.
A Maplesoft.com membership account gives you access to thousands of free Maple resources and MaplePrimes, which
is an active web community for sharing techniques and experiences with Maple and related products. To sign up fora free Maplesoft.com membership account, visit http://www.maplesoft.com/members/sign_up_form.aspx. The
MapleCloud is integrated with several of these online features, so it is strongly recommended that you use a
Maplesoft.com membership account.
For more information on the MapleCloud, refer to the MapleCloud help page.

334 • 11 Input, Output, and Interacting with Other ProductsIndexSymbols! toolbar icon, 49!!! toolbar icon, 50"", 277$, 134%H, 128%T, 127&x, 128', 69, 291(), 304->, 69., 127
1-D Math, 58
2-D Math, 58
converting to 1-D, 59
entering, 4
shortcuts, 6
switching to 1-D, 59:, 58, 59::, 106:=, 68;, 58, 59<>, 118, 120>, 58?
help topic, 38[], 125, 269, 270^, 5, 81entering, 81_, 70_ZN~, 85`, 70{}, 270|, 120~, 85, 107element-wise operations, 289

A
about command, 107
abs command, 79
absolute value, 79
add command, 301
additionally command, 107
algebra, 117
linear, 129
polynomial, 112
algsubs command, 287
alignment format, 231
American spellingspellcheck, 265
and operator, 294
angle brackets, 118, 120, 155angles, 284
animations
creating, 219
customizing, 223
Application Center, 42applications
sample documents, 41
apply
character styles, 232paragraph styles, 235
approximation, 77
least-squares, 130
numeric, 287
arguments, 304
arithmetic, 49
finite-precision, 76
interval, 103
matrix and vector, 126
modular, 79, 80
polynomial, 112
Arrays, 271
indexing, 272
large, 273
arrow operator, 69
assign command, 88
assigned command, 291
assignment operator (:=), 68
Assistants
Code Generation, 24
Curve Fitting, 117
eBook Publisher, 24
Import Data, 24, 327
Installer Builder, 24
Library Browser, 24
Maplet Builder, 24
ODE Analyzer, 89
Optimization, 141
overview, 24
Plot Builder, 24, 188
Scientific Constants, 25
Special Functions, 25
Student Practice Sheets, 27
Thermophysical Properties Calculator, 25
Tools menu, 24
Unit Converter, 284
Units Converter, 25, 96
Worksheet Migration, 25
assume command, 106
adding assumptions, 107
and procedure variables, 108
imposing multiple assumptions, 107335

336 • Index

removing assumptions, 107setting relationships between variables, 106setting variable properties, 106
testing property, 107
using with assuming command, 108
viewing assumptions, 107
assuming command, 106, 108, 138, 283
additionally option, 108
and procedure variables, 108
applying to all names, 108
using with assume command, 108
Attributes submenu
character, 230
paragraph, 231
auto-execute, 243
repeating, 244
security levels, 245
Avogadro constant, 100B
bar chart, 146
basis
vector space, 130
binary numbers, 80
Bohr radius, 100
bold format, 229
bookmarks
using, 261
boolean expressions, 288, 294, 298
brackets
angle, 118, 120
break statement, 301
browserMatrix, 120, 273
Task, 66bulletsformat, 231buttonembedding, 263
Button component, 309
by clause, 296
excluding, 296
negative, 297Ccalculus, 139
clickable problem solving, 185
multivariate, 139Student package, 140of variations, 140
packages, 139
study guides, 149teaching, 140, 150

vector, 139Student package, 140calling sequence, 60
caretentering, 81
central tendency, 103
character styles
creating, 233
description, 232
Check Box component, 309
Cholesky decomposition, 128
clickable mathexpressions, 28
Clickable Math, 185
Drag-to-Solve, 160
Smart Popups, 160
Code Edit Region, 306
Code Generation, 24
CodeGeneration
package description, 62
coeff command, 116
coefficientspolynomials, 116
coeffs command, 116
collect command, 116
colon, 58, 59
colorof plots, 213
combine command, 283
errors option, 105
Combo Box component, 309
command completion, 6, 34
Command-line Interface, xiii
commands, 61
and task templates, 66
displaying procedures, 305
entering, 33
help, 38
hiding, 306, 307
iterative, 301
mapping over set or list, 303
package, 61
top, 61
top-level, 60
complex expressions, 288
complex numbers, 21
compoly command, 117
components
adding GUI elements, 263
palette, 263
computations
assistants, 66
commands, 61
context panel, 65Index • 337

errors, 78
avoiding, 78
integers, 81
interrupting, 301
linear algebra, 126
mathematics, 111
numeric, 77
palettes, 63
performing, 75, 111
Real number system, 105
symbolic, 77
syntax-free, 55
task templates, 66
tutors, 66
under assumptions, 106
single evaluation, 108
updating, 49
with uncertainty, 104with units, 98
conditional execution, 293
constants, 46
content command, 117context
of unit, 96
context panel, 65, 128
access tutors, 55
computing with, 50
customizing animations, 222
integer, 65, 90
overview, 27
Plot Builder access, 189
using, 27context-sensitive operation, 28
customize text on arrow, 53
equation, 82
integer, 78
using, 10convert command, 284
base option, 80, 300
degrees option, 284
mathematical functions, 284
set option, 284
temperature option, 97
units option, 96, 284
copy, 228and drag, 10
examples, 40
copy expressions, 10
correlation, 104
coulditbe command, 107
covariance, 104cross product, 128
Curl command, 139
Curve Fitting

package
PolynomialInterpolation command, 117
Curve Fitting Assistant, 117
cut and paste
in tables, 247

D
D operator, 134
data structures, 46, 269
creating, 277
Data Table component, 309
Database Integration, 331
datatype option, 123
degreecommand, 116
polynomials, 116
denom command, 280
derivatives, 133
directional, 135partial, 46, 133
prime notation, 243
Tutor, 150
Dial component, 310
dictionary, 41, 149
for spellcheck, 267
dictionary topic
adding hyperlink to, 260diff command, 90, 133differential equations
ordinary, 89partial, 93
Student package, 140differentiation, 133with uncertainty, 104with units, 98
Differentiation Methods Tutor, 150
Digits environment variable, 77
dimension, 95, 128base, 95
Directional Derivative Tutor, 135
discrim command, 117
display
bookmark, 261
distribution
probability, 144
divide command, 113
divisors, 79
document blocks, 36, 241
Document mode, 45
documents
running, 8DocumentTools, 316
double colon operator, 106

338 • Index

drawing canvas
inserting, 255
drawing canvas stylesketch pad, 256
dsolve command, 92

Ee (exponential)
entering, 46
e-notation, 77
eBook Publisher Assistant, 24
Edit menu
in help system, 40
eigenvalues, 128
eigenvectors, 128
element-wise operators, 289
elementary charge, 100
elements, 99
definition, 101
isotopes, 101
definition, 101
properties, 101
list, 101
properties
list, 101
uncertainty, 102
units, 102
using, 100
value, 102
value and units, 102
elif clauses, 295
order, 295
else clause, 294
email
adding hyperlink to, 259
embedded components, 263, 309
example, 313, 315
inserting, 312
properties, 313
end do keywords, 296, 298
end if keywords, 293
end proc keywords, 304
engineers
portal for, 41Enter key, 48
environment variables
Digits, 77
Order, 136
equationsolving step-by-step, 166
equation labels, 73
displaying, 71
features, 73

formatting, 36
inserting, 35, 71
numbering schemes, 73
overview, 35
versus names, 73
with multiple outputs, 73
Equation Manipulator, 166
equationssolving, 82
for real solutions, 105
numerically, 86
symbolically, 84transcendental, 85
errorsquantities with, 103
Euclidean algorithm, 117eval command, 286, 305
evalb command, 288
evalc command, 288
evalf command, 77, 85, 102, 104, 287
with Int command, 139with Limit command, 132
evaln command, 291
evaluateand display inline, 48
evaluationboolean expressions, 288
complex expressions, 288
delaying, 291
levels of, 290
Maple expressions, 285
of expression at a point, 285
output below, 49
output inline, 48, 51
updated computations, 49
exact
computation, 76
numbers, 76
quantities
converting to floating-point, 77
example worksheets
copy, 40
execute, 48
execution group, 58
execution groups, 14
expandcommand, 283
document block, 242
execution group, 243
series, 136
Exploration Assistant, 30
exponents
entering, 5export, 306

Index • 339

to HTML, 329
to LaTeX, 329
to Maple input, 329
to Maple text, 329
to Maplet application, 329
to other formats, 329
to PDF, 330
to plain text, 330
to Rich Text Format, 330
worksheets, 329
exportingembedded components, 312
expression sequences, 84, 269
creating, 301
expressions, 46, 269
adding, 301
clickable math, 28
evaluating, 285
manipulating, 282
multiplying, 301
versus functional operators, 275

Ffactorintegers, 78
polynomials, 116
QR factorization, 130
factor command, 116, 282
factored normal form, 284
factorial command, 79
FAIL, 294, 298
false, 294, 298
Faraday constant, 100
Favorites palette, 15, 20
files
image formats, 257
reading from, 327
writing to, 325
fill option, 123
finite fields, 80
solving equations, 94
finite rings, 80
floating-pointcomputation, 77
accuracy, 78
hardware, 78
significant digits, 77
numbers, 76
rational approximation, 65
Flux command, 139font color, 229
foot-pound-second (FPS) system, 96
footers, 239

for/from loops, 296
for/in loops, 297
formal power series solutions, 93
format labels, 36
Format menu
bookmarks, 261
quick formatting, 229
frac command, 108
fractionsapproximating, 52
entering, 4frequency plot, 146
Frobenius form
matrix, 130
from clause, 296
excluding, 296
fsolve command, 86
full evaluation, 290, 292
function, 48
FunctionAdvisor command, 60
functional operators, 274differentiating, 134
plotting, 276
versus expressions, 275
functionsconverting between, 284
defining as functional operators, 274
how to define in Maple, 274

G
Gaussian elimination, 130
Gaussian integers, 81
GaussInt package, 81
gcd command, 117
gcdex command, 117
Global Optimization Toolbox, 140
global variables, 304
glossinessof 3-D plots, 213
go tobookmark, 262
gradient, 151
Gradient Tutor, 151
greatest common divisor, 79, 117H
has command, 279
hastype command, 279
HazardRate command, 145
headers, 239
Help Navigator
Using, 39
help page340 • Index

adding hyperlink to, 259
help systemaccessing, 38
description, 41
Edit menu, 40
Help Navigator, 38
manuals, 40
search, 40
table of contents, 40
tasks, 40
View menu, 40
Hermitian transpose
matrix and vector, 128
Hessenberg form, 130
hexadecimal numbers, 80
hideworksheet content, 239
highlight color, 229
Hilbert Matrix, 130
histogram, 146
Homework practice sheet assistant, 27
How Do I ... topics, 41
hyperlinks
in worksheet, 258

Iientering, 21, 82
icons
open as example worksheet, 40
if statement, 293
ifactor command, 78, 79, 283
igcd command, 79
imagesadding hyperlink to, 259
file format, 257
inserting, 257
imaginary unit
entering, 21, 82
implied multiplication, 5
implies operator, 294
Import Data Assistant, 24, 327
indentformat, 231
indeterminates, 281
indets command, 281
indices, 60, 125
inequations
solving, 82
for real solutions, 105
symbolically, 84
infinite loops, 301
infolevel command, 93

input
2-D Math, 58
2-D math notation, 58
Maple notation, 58
prompt, 58
separating, 59
setting default mode, 59
insertbookmark, 261
hyperlink, 258
images, 257
section, 238
sketch pad, 255
table, 245
Installer Builder Assistant, 24
instructor resources, 159
int command, 138
Int command, 139
integers
commands, 79
computations, 81
context panel, 65, 90
factoring, 78
Gaussian, 81
modulo m, 80
solving equations, 94
solving modular equations, 94
integration, 50, 64, 137
definite, 138
functional operators, 277
indefinite, 137
iterated, 138line, 138, 153
numeric, 139
surface, 138with units, 98
interactive commands
Student, 26
interactive documentbuilding, 309
Interactive Linear System Solving tutor, 55
Interactive Plot Builder Assistantcreating animations, 216
creating plots, 188
customizing animations, 222
customizing plots, 209
interface command
rtablesize option, 122verboseproc option, 305
international system (SI), 96
InterquartileRange command, 145interval arithmetic, 103
iquo command, 79
iroot command, 79Index • 341

is command, 107
isprime command, 79
isqrt command, 79
italic format, 229

Jjentering, 82
Jordan form, 128K
keyboard keys
Command Completion, xiii
keystrokes, 5LLabel component, 310
labels, 73
last name evaluation, 291
lcm command, 117lcoeff command, 116
ldegree command, 116
least-squares, 130
left single quotes, 70
left-hand side, 280
levels of evaluation, 290
lexicographic order, 114
lhs command, 280
Library Browser
description, 24
limit command, 132
Limit command, 132
limits, 131
multidimensional, 132line break, 231
line integrals, 153
linear algebra, 129
computations, 126
efficiency, 122, 131
LinearAlgebra package, 129
teaching, 131, 150
Linear System Solving tutor, 55
linear systems
solving, 94, 130
interactive, 55
LinearAlgebra
package description, 62
LinearAlgebra package, 128
commands, 129
numeric computations, 131
LinearSolve command, 94
Linuxcommand complete, 6

List Box component, 310
lists, 126, 270
returning solutions as, 84
local variables, 304
logical operators, 294
loops, 296
general, 300
infinite, 301

MmacOS
command complete, 6
manipulate
equation, 166
map command, 303
Maple Application Center, 149
Maple library, 32
Maple Portal, 41, 149
Maple Student Help Center, 149
Maple Workbook, 4MapleCloud, 333
MaplePrimes, 42
Maplet Builder
description, 24
launching, 320
Maplet authoring, 320
Maplets
adding hyperlink to, 260
authoring, 323
Maplet Builder, 320
Maplets package, 323
launching
Maple worksheet, 319
Maplet file type, 318
Maplets package
Display command, 323
Elements subpackage, 323
Maplet authoring, 323
savingMaple worksheet, 324
maplet file, 324
using, 318
markers
bookmarks, 261
displaying, 37
for document blocks, 241
Math Apps, 27
in help system, 40
math dictionary
description, 41
Math Expression component, 310
Math mode, 14
shortcuts, 6

342 • Index

mathematical functions
list, 60
mathematics
computations, 111
teaching and learning, 159
matrices, 273
arithmetic, 126
context panel, 128
data type, 123, 124
defining, 118
efficiency, 122
filling, 124
Hermitian transpose, 128
image, 122large, 121
multiplication, 127
operations, 128
random, 121
scalar multiplication, 127
selecting submatrices, 125
shape, 122, 124transpose, 127
type, 122
MatrixBrowser, 120, 273
constructor, 124data structure, 118
palette, 94, 118, 122
Matrix command, 118
max command, 79
maximize, 140
maximum, 79
Mean command, 145
Meter component, 310
Microphone component, 310
min command, 79
minimize, 140
minimum, 79
mod command, 79
mod operator, 80
modes
Document, 45
Worksheet, 45
modifytable, 246
modp command, 81
mods command, 81
modular arithmetic, 79, 80
modules, 306
MPS(X) files, 143msolve command, 94
mul command, 301
multiplication
implied, 5Nnames, 46, 69
adding assumptions, 106
and symbols, 21
assigned, 291
assigning values to, 68
logical, 294
previously assigned, 291
protected, 69
removing assumptions, 107
reserved, 69
unassigning, 69, 107, 292
valid, 70
versus equation labels, 73
with assumptions, 107
nops command, 281
norm command, 117, 129
normal command, 284
normal form, 284
not operator, 294
numbers, 46
exact, 76
floating-point, 76
non-base 10, 80
NumberTheory[Divisors] command, 79
numer command, 280
numeric
approximation, 287
computation, 76Oobjects, 306
ODE Analyzer Assistant, 89
ODEs
Student package, 140
online help, 42
operands, 281
selecting, 302
operators, 46
functional, 274
logical, 294
relational, 294
Optimization
package description, 63
optimization, 143
efficiency, 142
plotting, 142
point-and-click interface, 141
Optimization Assistant, 141
Plotter, 142
Options dialog, 15
or operator, 294
Order environment variable, 136

Index • 343

ordinary differential equations
plotting solution, 92
solving, 89
orthogonal matrix, 130
outputsuppressing, 58

Ppackages, 60
accessing commands, 34
definition, 32
help, 38
loading, 61
top, 63
unloading, 62
page break, 231
page headers and footers, 239
palettes, 46, 50, 63, 286
categories, 18
Components, 312
favorites, 15
Favorites, 20
managing, 18
Matrix, 118, 122
overview, 15
saving expressions for ease of reuse, 20
Units, 54, 97
paragraph styles
creating, 236
description, 232parameters, 304
parametric solutions, 86
partial derivative
entering, 46
partial differential equations
solving, 93
paste, 228
examples, 41
PDEs, 93
pdsolve command, 93
pencilsketch pad, 255
Physics
package description, 63
pie chart, 146
piecewise command, 145
Planck constant, 100
Plot Builder
description, 24
Plot component, 310
plot3d command, 276
plots
analyzing, 215

pan, 215
point probe, 215
rotate, 215
scale, 215
creating, 207
context panel, 193
displaying multiple plots, 206
Interactive Plot Builder, 188
plot command, 194
plot3d command, 194
plots package, 202
creating animations
animate command, 217
Interactive Plot Builder, 216
plot3d[viewpoint] command, 219
customizing, 213
context panel, 210
Interactive Plot Builder, 209
plot options, 213
plot3d options, 213
customizing animations, 223
command-line options, 223
context panel, 222
Interactive Plot Builder, 222data, 216
dragging expression to add to a plot, 206
exporting, 225
functional operators, 276
gradient, 153line integral, 153
Live Data Plots palette, 216
ODEs
symbolic solution, 91
optimization problem, 142
playing animations, 221
plots package
animate command, 217
contourplot command, 205
display command, 208
matrixplot command, 203
pointplot command, 202
statistics, 146
viewing animations
animate context bar, 221
plotting
using the context panel, 28
point-and-click, 24
polynomial equations
solving, 85
numerically, 86
polynomials
algebra, 112
arithmetic, 112
coefficients, 116

344 • Index

collecting terms, 116
degree, 116
division, 112, 113
expanding, 113
factoring, 116
implied multiplication, 113
numeric
algebraic manipulation, 117
operations, 117
sorting, 113
pure lexicographic, 114
total degree, 114
PolynomialTools package, 117
IsSelfReciprocal command, 117
powersentering, 5precalculus
study guides, 149teaching, 150
precision, 77
prem command, 117previously assigned, 291
primality testing, 79
primpart command, 117
printcommand, 305
table, 251
printing
embedded components, 312
probability distribution, 144proc key word, 304
procedures, 305
and assumptions, 108calling, 304
defining, 304
displaying, 305
inputs, 304
multiple lines, 304
output, 304
using, 304
product command, 302
products
entering, 5
implied, 5programming, 293
access to the Maple Programming Guide, 41
programs, 293
modules, 306
objects, 306
procedures, 305
promptinput, 58
properties
testing, 107protected names, 69

Q
QPSolve command, 143
QR factorization, 130
quadratic programs, 143
quantities with uncertainty, 103
accessing error, 104
accessing value, 104
computing with, 104constructing, 103
element properties, 104rounding the error, 104
scientific constants, 104with units, 104
quick
character formatting, 229
paragraph formatting, 231
quit statement, 301
quo command, 112
quotesdouble, 277
left single, 70
right single, 69, 291
unevaluation, 291
quotient
integer, 79

RRadio Button component, 310
randommatrices, 121
variables, 144
randpoly command, 117
range
in plots, 211
operator, 126
rank, 128
rational expressions
entering, 4
readfrom files, 327
RealDomain
package description, 63
recurrence relation
solving, 94
referenceequation labels, 73
names, 69
relational operators, 294
rem command, 112remainder
integer, 79Index • 345

remove command, 302
repetition statements, 296
reserved names, 69
resourcesin help system, 40
restart command, 62, 70
resultant command, 117
returnstatement, 301
values, 304
rhs command, 280
right single quotes, 69, 291
right-hand side, 280
RootOf structure, 85
roots
command, 117
of equations, 85
Rotary Gauge component, 310
row vector
creating, 123rsolve command, 94
running
documents, 8
worksheets, 8Ssaving a Maple Document, 13
as a Workbook, 13
scatter plot, 146
scientific constants, 99
list, 100
name, 100
symbol, 100
uncertainty, 102
units, 102
using, 100
value, 102
value and units, 102
Scientific Constants Assistant, 25
ScientificConstants
package description, 63
ScientificConstants package, 100
extensibility, 103
objects, 101
ScientificErrorAnalysis
package description, 63
ScientificErrorAnalysis package, 103
extensibility, 105
objects, 103
searchhelp system, 39
sections
in worksheet, 237

security levels
auto-execute, 245
security tab
options dialog, 245
select command, 302
selection
execute, 8
selectremove command, 302
semicolon, 58, 59
seq command, 301
series, 136
command, 136
plotting, 136
Taylor, 136
type, 136
sets, 270
shape option, 123
Shortcut component, 311
show
worksheet content, 240
show contents dialog
using, 240
significant digits, 77
simplify command, 282, 287
sliderembedding, 263
Slider component, 310
solutionsassigning as expression, 88
assigning as function, 88
details, 93
formal, 93
formal power series, 93
integers, 94
real, 105
series, 93
verifying, 87
solve
equations, 82
for real solutions, 105
numerically, 86
symbolically, 84
inequations, 82
for real solutions, 105
symbolically, 84
integer equations, 94
linear system, 94, 130
modular integer equations, 94
ODEs, 89
PDEs, 93recurrence relation, 94
transcendental equations, 85
solve command, 84, 271
finding all solutions, 85

346 • Index

finding parametric solutions, 86
real solutions, 105
solving procedures, 86
sortlists, 285
polynomials, 113, 285
sort command, 113, 285
plex option, 114
source code
displaying, 305
spacing format, 231
Speaker component, 311
Special Functions Assistant, 25
spellcheck, 265
add word to your dictionary, 267
American spelling, 265
sqrfree command, 117Standard Document Interface, xiii
starting, 2Standard Worksheet Interface, xiii
startup code, 8Startup Code, 307
statements
multiple lines, 304
Statistics package, 147
continuous distributions, 144
description, 63
discrete distributions, 144
plots, 146
strings, 277
StringTools package, 278
Student
package description, 63
Statistics package, 148Student Help Center, 42Student package, 135, 149, 150
calculus subpackages, 140
LinearAlgebra subpackage, 131
Maplets, 149
statistics, 148
Tutors, 149Student Practice Sheets
Assistant, 27
student resources, 159
students
portal for, 149
study guides, 149
style set management, 237
subscripts
entering, 5
format, 229
substitute, 285
sum command, 302
superscript format, 229

Sylvester matrix, 130
symbol completion, 6
symbolic
computation, 76
objects, 76
symbols
entering, 21
names, 21
system of units, 96
controlling, 99
systeme international (SI), 96

T
Tab
inserting, 64
key, 64
Tab key, 241
table of contents
help system, 40
tables, 273
alignment, 249
appearance, 248
borders, 248
contents, 245
editable, 252
execution order, 251
physical dimensions, 248
printing, 251
using, 245
visibility of cell content, 251
Task Browser, 66
task template, 28
task templates, 66, 78, 95, 118, 131
taylor command, 136
Taylor series, 136tcoeff command, 116
Teacher Resource Center, 42teaching with Maple, 159
Technical Support
access, 43temperature conversion, 96
Text Area component, 310
text field
embedding, 263
Text mode, 14
text regions, 67
Thermophysical Properties Calculator Assistant, 25
tilde, 85, 107, 289
to clause, 296
excluding, 296
Toggle Button component, 310
Tolerances package, 103
toolboxes

Index • 347

Global Optimization, 140
Tools menu
assistants, 24
Assistants and Tutors, 66
Tasks, 66
Torsion command, 140
total degree, 114
transparencyof 3-D plots, 214transpose
matrices and vectors, 127
true, 294
Tutorials, 41
Tutors, 149, 150
Derivatives, 150
Differentiation Methods, 150
Directional Derivative, 135
Gradient, 151
Linear System Solving, 55
using, 25tutorsaccessing, 25
type command, 279
types, 106, 278
converting, 284
series, 136
testing, 279
subexpressions, 279

Uunapply command, 88
unassign command, 69
unassigning names, 69, 292
uncertainty, 103
quantities with, 103
underline format, 229
unevaluation quotes, 69, 291
unionof sets, 270
Unit Converter Assistant, 284
units, 54, 95, 284
adding to expressions, 54
applying to expression, 97
computing with, 98
context, 96
converting between, 96
environment, 98
evaluating with, 55
in 1-D Math, 98
inserting, 97
overview, 95
prefixes, 98
system ofcontrolling, 99
systems of, 96
Unitspackage description, 63
Units Converter, 96
Units Converter Assistant, 25
Units package, 95
environments, 98
extensibility, 99
UseSystem command, 99
UsingSystem command, 99
Units palette, 54, 97
universal gravitational constant, 100
until loop, 298
until loops, 298
unwith command, 62
URLadding hyperlink to, 259

Vvariables, 46
variance, 104
VariationalCalculus package, 140
Vectorconstructor
vectorfield attribute, 139data structure, 118
vector fields, 139
vector spaces
basis, 130
VectorCalculus
package description, 63
VectorCalculus package, 139Student version, 140
vectors, 273
arithmetic, 126
column, 120
context panel, 128
cross product, 128
data type, 123
defining, 120
efficiency, 122
filling, 123
large, 121
multiplication, 127row, 120, 123
scalar multiplication, 127
selecting entries, 124
shape, 123transpose, 127
Video Player component, 311
View menu
in help system, 40

348 • Index

markers, 37
Volume Gauge component, 311

W
Webpageadding hyperlink to, 259
Websiteaccess to Maple help pages, 42
Application Center, 42, 149
MaplePrimes, 42
Student Center, 149Student Help Center, 42
Teacher Resource Center, 42
Technical Support, 43
Training, 42
while loops, 298
Windows
command complete, 6with command, 61
word list
for spellcheck, 267
Workbook Attachment
adding hyperlink to, 260
Workbook Fileadding hyperlink to, 261
worksheetadding hyperlink to, 259
Worksheet Environment, 1
Worksheet Migration Assistant, 25
Worksheet mode, 45, 57
worksheetsrunning, 8
write
to files, 325X
xor operator, 294Zzero recognition, 285
zip command, 303