Maple 8 Learning Guide
Total Page:16
File Type:pdf, Size:1020Kb
command the brilliance of a thousand mathematicians Waterloo Maple Inc. 57 Erb Street West Waterloo, Ontario | Canada N2L 6C2 Learning Guide tel: 1.519.747.2373 | fax: 1.519.747.5284 [email protected] | www.maplesoft.com North American Sales: 1.800.267.6583 Learning Guide © 2002 Waterloo Maple Inc. Maple is a registered trademark of Waterloo Maple Inc. M-0028-00-E Printed in Canada Maple 8 Learning Guide Based in part on the work of B. W. Char c 2002 by Waterloo Maple Inc. ii ¯ Waterloo Maple Inc. 57 Erb Street West Waterloo, ON N2L 6C2 Canada Maple and Maple V are registered trademarks of Waterloo Maple Inc. Maplets is a trademark of Waterloo Maple Inc. c 2002, 2001, 2000, 1998, 1996 by Waterloo Maple Inc. All rights reserved. The electronic version (PDF) of this book may be downloaded and printed for personal use or stored as a copy on a personal machine. The electronic version (PDF) of this book may not be distributed. Information in this document is subject to change without notice and does not repre- sent a commitment on the part of the vendor. The software described in this document is furnished under a license agreement and may be used or copied only in accordance with the agreement. It is against the law to copy software on any medium except as specifically allowed in the agreement. The use of general descriptive names, trade names, trademarks, etc., in this publication, even if the former are not especially identified, is not to be taken as a sign that such names, as understood by the Trade Marks and Merchandise Marks Act, may accordingly be used freely by anyone. Windows is a registered trademark of Microsoft Corporation. Java and all Java based marks are trademarks or registered trade- marks of Sun Microsystems, Inc. in the United States and other countries. Waterloo Maple Inc. is independent of Sun Mircosystems, Inc. All other trademarks are property of their respective owners. This document was produced using a special version of Maple that reads and updates LATEX files. Printed in Canada ISBN 1-894511-26-3 Contents 1 Introduction to Maple 1 1.1 Manual Set . 3 2 Mathematics with Maple: the Basics 5 2.1 Introduction . 5 2.2 Numerical Computations . 7 Integer Computations . 7 Exact Arithmetic—Rationals, Irrationals, and Constants . 8 Floating-Point Approximations . 11 Arithmetic with Special Numbers . 13 Mathematical Functions . 14 2.3 Basic Symbolic Computations . 16 2.4 Assigning Expressions to Names . 17 2.5 Basic Types of Maple Objects . 19 Expression Sequences . 19 Lists . 21 Sets . 22 Operations on Sets and Lists . 24 Arrays . 25 Tables . 29 Strings . 30 2.6 Expression Manipulation . 31 The simplify Command . 31 The factor Command . 33 The expand Command . 33 The convert Command . 34 The normal Command . 35 The combine Command . 36 The map Command . 36 The lhs and rhs Commands . 38 iii iv Contents ¯ The numer and denom Commands . 38 The nops and op Commands . 38 Common Questions about Expression Manipulation . 39 2.7 Conclusion . 41 3 Finding Solutions 43 3.1 Simple solve ......................... 43 Verifying Solutions . 45 Restricting Solutions . 47 Exploring Solutions . 48 The unapply Command . 49 The assign Command . 51 The RootOf Command . 52 3.2 Solving Numerically: fsolve . 53 Limitations on solve ..................... 55 3.3 Other Solvers . 57 Finding Integer Solutions . 57 Finding Solutions Modulo m . 58 Solving Recurrence Relations . 58 3.4 Polynomials . 58 Sorting and Collecting . 59 Mathematical Operations . 61 Coeácients and Degrees . 62 Root Finding and Factorization . 62 3.5 Calculus . 64 3.6 Differential Equations: dsolve . 70 3.7 The Organization of Maple . 76 3.8 The Maple Packages . 78 List of Packages . 78 The Student Calculus1 Package (Single Variable) . 83 The LinearAlgebra Package . 88 The Matlab Package . 90 The Statistics Package . 91 The Linear Optimization Package . 94 3.9 Conclusion . 96 4 Graphics 97 4.1 Graphing in Two Dimensions . 97 Parametric Plots . 99 Polar Coordinates . 101 Functions with Discontinuities . 104 Contents v ¯ Multiple Functions . 107 Plotting Data Points . 109 Refining Plots . 111 4.2 Graphing in Three Dimensions . 112 Parametric Plots . 114 Spherical Coordinates . 114 Cylindrical Coordinates . 117 Refining Plots . 118 Shading and Lighting Schemes . 119 4.3 Animation . 120 Animation in Two Dimensions . 121 Animation in Three Dimensions . 123 4.4 Annotating Plots . 124 4.5 Composite Plots . 127 Placing Text in Plots . 129 4.6 Special Types of Plots . 130 4.7 Manipulating Graphical Objects . 135 4.8 Code for Color Plates . 140 4.9 Conclusion . 143 5 Evaluation and Simplification 145 5.1 Mathematical Manipulations . 145 Expanding Polynomials as Sums . 146 Collecting the Coeácients of Like Powers . 148 Factoring Polynomials and Rational Functions . 150 Removing Rational Exponents . 153 Combining Terms . 154 Factored Normal Form . 155 Simplifying Expressions . 157 Simplification with Assumptions . 158 Simplification with Side Relations . 159 Sorting Algebraic Expressions . 160 Converting Between Equivalent Forms . 162 5.2 Assumptions . 163 The assume Facility . 163 The assuming Command . 168 5.3 Structural Manipulations . 169 Mapping a Function onto a List or Set . 169 Choosing Elements from a List or Set . 172 Merging Two Lists . 173 Sorting Lists . 174 vi Contents ¯ The Parts of an Expression . 177 Substitution . 185 Changing the Type of an Expression . 189 5.4 Evaluation Rules . 191 Levels of Evaluation . 191 Last-Name Evaluation . 192 One-Level Evaluation . 195 Commands with Special Evaluation Rules . 196 Quotation and Unevaluation . 197 Using Quoted Variables as Function Arguments . 200 Concatenation of Names . 201 5.5 Conclusion . 203 6 Examples from Calculus 205 6.1 Introductory Calculus . 205 The Derivative . 205 A Taylor Approximation . 211 The Integral . 223 Mixed Partial Derivatives . 227 6.2 Ordinary Differential Equations . 231 The dsolve Command . 232 Example: Taylor Series . 247 When You Cannot Find a Closed Form Solution . 251 Plotting Ordinary Differential Equations . 252 Discontinuous Forcing Functions . 256 6.3 Partial Differential Equations . 261 The pdsolve Command . 261 Changing the Dependent Variable in a PDE . 263 Plotting Partial Differential Equations . 265 6.4 Conclusion . 267 7 Input and Output 269 7.1 Reading Files . 269 Reading Columns of Numbers from a File . 270 Reading Commands from a File . 272 7.2 Writing Data to a File . 273 Writing Columns of Numerical Data to a File . 273 Saving Expressions in Maple's Internal Format . 275 Converting to LATEX Format . 276 7.3 Exporting Whole Worksheets . 278 Plain Text . 278 Contents vii ¯ Maple Text . 278 LATEX ............................. 279 HTML and HTML with MathML . ..