Table of Contents
1. What MAPLE Can Do for You . . . . 1
1.1 Arithmetic . . . . 1
1.2 Numerical Computations . . . . 1
1.3 Polynomials and Rational Functions . . . . 2
1.4 Trigonometry . . . . 3
1.5 Differentiation . . . . 4
1.6 Truncated Series Expansions . . . . 4
1.7 Differential Equations and Systems . . . . 5
1.8 Integration . . . . 6 1.9 Plot of Curves . . . . 7 1.10 Plot of Surfaces . . . . 9 1.11 Linear Algebra . . . 10 2. Introduction . . . 11 2.1 First Steps . . . 11 2.1.1 Keyboarding an Expression . . . 11
2.1.2 Operators, Functions and Constants . . . 13
2.1.3 First Computations . . . 14
2.2 Assignment and Evaluation . . . 16
2.2.1 Identifiers . . . 16
2.2.2 Assignment . . . 16
2.2.3 Free Variables and Evaluation. . . 17
2.2.4 Full Evaluation Rule . . . 19
2.2.5 Use of Apostrophes: Partial Evaluation . . . 20
2.2.6 Evaluation of Function Arguments . . . 22
2.3 Fundamental Operations . . . 23
2.3.1 The Function expand . . . 24
2.3.2 The Function factor . . . 25
2.3.3 The Function normal . . . 27
2.3.4 The Function convert in Trigonometry . . . 28
2.3.5 First Approach to the Function simplify . . . 29
2.3.6 Simplification of Radicals: radnormal and rationalize . . . 33
X Table of Contents
2.4 First Approach to Functions . . . 37
2.4.1 Functions of One Variable . . . 37
2.4.2 Functions of Several Variables . . . 38
2.4.3 The Difference Between Functions and Expressions . . . 39
2.4.4 Links Between Expressions and Functions . . . 40
2.5 Simplification of Power Functions . . . 41
2.5.1 The Functions exp, ln and the Exponentiation Operator. . . 41
2.5.2 The Function simplify . . . 44
2.5.3 The Function combine . . . 47
3. Arithmetic . . . 49
3.1 Divisibility . . . 49
3.1.1 Quotient and Remainder . . . 49
3.1.2 G.c.d. and Euclid’s Algorithm . . . 50
3.1.3 Decomposition into Prime Factors . . . 52
3.1.4 Congruences . . . 52
3.2 Diophantian Equations . . . 54
3.2.1 Chinese Remainder Theorem. . . 54
3.2.2 Solution of Equations Modulo n . . . 54
3.2.3 Classical Equations . . . 55
4. Real Numbers, Complex Numbers . . . 57
4.1 The Real Numbers . . . 57
4.1.1 Display of Real Numbers . . . 57
4.1.2 Approximate Decimal Value of Real Numbers . . . 59
4.2 The Complex Numbers . . . 62
4.2.1 The Different Types of Complex Numbers . . . 62
4.2.2 Algebraic Form of the Complex Numbers . . . 63
4.2.3 Trigonometric Form of the Complex Numbers . . . 65
4.2.4 Computing with Expressions with Complex Coefficients . . . 65
4.2.5 Approximate Decimal Value of the Complex Numbers 67 5. Two-Dimensional Graphics . . . 69
5.1 Curves Defined by an Equation y = f(x) . . . 69
5.1.1 Graphic Representation of an Expression . . . 69
5.1.2 Graphic Representation of a Function . . . 71
5.1.3 Simultaneous Plot of Several Curves . . . 73
5.1.4 Plot of a Family of Curves . . . 73
5.2 The Environment of plot . . . 75
5.2.1 The plot Menu in Windows . . . 76
5.2.2 The Options of plot . . . 77
5.3 Parametrized Curves in Cartesian Coordinates . . . 82
Table of Contents XI
5.3.2 Simultaneous Plot of Several Parametrized Curves . . . . 83
5.3.3 Plot of a Family of Parametrized Curves . . . 84
5.4 Curves in Polar Coordinates . . . 86
5.4.1 Plot of a Curve in Polar Coordinates. . . 86
5.4.2 Plot of a Family of Curves in Polar Coordinates . . . 88
5.5 Curves Defined Implicitly . . . 89
5.5.1 Plot of a Curve Defined Implicitly . . . 89
5.5.2 Plot of a Family of Implicit Curves . . . 90
5.5.3 Precision of the Plot of Implicit Curves . . . 91
5.6 Polygonal Plots . . . 92
5.7 Mixing Drawings . . . 92
5.7.1 How Does plot Work . . . 93
5.7.2 The Function display . . . 93
5.8 Animation . . . 94
5.9 Using Logarithmic Scales . . . 97
6. Equations and Inequations . . . 99
6.1 Symbolic Solution: solve . . . 99
6.1.1 Univariate Polynomial Equations . . . 99
6.1.2 Other Equations in One Variable . . . 103
6.1.3 Systems of Equations . . . 105
6.1.4 Inequations . . . 107
6.2 Approximate Solution of Equations: fsolve . . . 108
6.2.1 Algebraic Equations in One Variable . . . 108
6.2.2 Other Equations in One Variable . . . 109
6.2.3 Systems of Equations . . . 110
6.3 Solution of Recurrences: rsolve . . . 112
6.3.1 Linear Recurrences . . . 112
6.3.2 Homographic Recurrences . . . 114
6.3.3 Other Recurrence Relations . . . 115
7. Limits and Derivatives . . . 117
7.1 Limits . . . 117
7.1.1 Limit of Expressions . . . 117
7.1.2 Limit of Expressions Depending on Parameters . . . 119
7.1.3 Limit of Functions . . . 121
7.2 Derivatives . . . 122
7.2.1 Derivatives of Expressions in a Single Variable . . . 122
7.2.2 Partial Derivatives of Expressions in Several Variables 123 7.2.3 Derivatives of Functions in One Variable . . . 124
XII Table of Contents
8. Truncated Series Expansions. . . 127
8.1 The Function series . . . 127
8.1.1 Obtaining Truncated Series Expansions . . . 127
8.1.2 Generalized Series Expansions . . . 129
8.1.3 Regular Part of a Series Expansion . . . 130
8.1.4 Obtaining an Equivalent . . . 131
8.1.5 Limits of the Function series . . . 132
8.2 Operations on Truncated Series Expansions . . . 133
8.2.1 Sums, Quotients, Products of Truncated Series Expansions . . . 133
8.2.2 Compositions and Inverses of Truncated Series Expansions . . . 134
8.2.3 Integration of a Truncated Series Expansion . . . 135
8.3 Series Expansion of an Implicit Function . . . 136
9. Differential Equations . . . 141
9.1 Methods for Solving Exactly . . . 141
9.1.1 Differential Equations of Order 1 . . . 141
9.1.2 Differential Equations of Higher Order . . . 144
9.1.3 Classical Equations . . . 146
9.1.4 Systems of Differential Equations . . . 147
9.2 Methods for Approximate Solutions . . . 149
9.2.1 Numerical Solution of an Equation of Order 1 . . . 149
9.2.2 Numerical Solution of an Equation of Higher Order . . . 151
9.2.3 Computing a Truncated Series Expansion of the Solution . . . 154
9.3 Methods to Solve Graphically . . . 155
9.3.1 Differential Equation of Order 1 . . . 155
9.3.2 The Options of DEplot for a Differential Equation . . . . 156
9.3.3 Differential Equation of Order n . . . 157
9.3.4 Necessity of the Option stepsize . . . 158
9.3.5 Differential System of Order 1 . . . 158
9.3.6 Study of an Example . . . 160
10. Integration and Summation . . . 163
10.1 Integration . . . 163
10.1.1 Exact Computation of Definite and Indefinite Integrals . . . 163
10.1.2 Generalized Integrals . . . 165
10.1.3 Inert Form Int . . . 166
10.1.4 Numerical Evaluation of Integrals . . . 167
10.2 Operations on Unevaluated Integrals . . . 168
10.2.1 Integration by Parts . . . 168
Table of Contents XIII
10.2.3 Differentiation Under the Integral Sign . . . 171
10.2.4 Truncated Series Expansion of an Indefinite Integral . . 173
10.3 Discrete Summation . . . 174
10.3.1 Indefinite Sums . . . 174
10.3.2 Finite Sums . . . 176
11. Three-Dimensional Graphics . . . 179
11.1 Surfaces Defined by an Equation z = f(x, y) . . . 179
11.1.1 Plot of a Surface Defined by an Expression . . . 179
11.1.2 Plot of a Surface Defined by a Function . . . 181
11.1.3 Simultaneous Plot of Several Surfaces . . . 182
11.2 The Environment of plot3d . . . 183
11.2.1 The Menu of plot3d in Windows . . . 183
11.2.2 The Options of plot3d . . . 185
11.3 Surface Patches Parametrized in Cartesian Coordinates . . . 189
11.4 Surfaces Patches Parametrized in Cylindrical Coordinates . . . 190
11.5 Surface Patches Parametrized in Spherical Coordinates . . . 192
11.6 Parametrized Space Curves . . . 193
11.6.1 Plot of a Parametrized Curve . . . 193
11.6.2 Simultaneous Plot of Several Parametrized Curves . . . . 194
11.7 Surfaces Defined Implicitly . . . 194
11.8 Mixing Plots from Different Origins . . . 196
12. Polynomials with Rational Coefficients . . . 199
12.1 Writing Polynomials . . . 199
12.1.1 Reminders: collect, sort, expand . . . 199
12.1.2 Indeterminates of a Polynomial . . . 201
12.1.3 Value of a Polynomial at a Point . . . 202
12.2 Coefficients of a Polynomial . . . 202
12.2.1 Degree and Low Degree . . . 202
12.2.2 Obtaining the Coefficients . . . 204
12.3 Divisibility . . . 205
12.3.1 The Function divide . . . 205
12.3.2 Euclidean Division . . . 207
12.3.3 Resultant and Discriminant . . . 208
12.4 Computation of the g.c.d. and the l.c.m. . . 209
12.4.1 The Functions gcd and lcm . . . 209
12.4.2 Content and Primitive Part . . . 210
12.4.3 Extended Euclid’s Algorithm: The Function gcdex . . . 212
12.5 Factorization. . . 213
12.5.1 Decomposition into Irreducible Factors . . . 213
12.5.2 Square-Free Factorization . . . 214
XIV Table of Contents
13. Polynomials with Irrational Coefficients . . . 217
13.1 Algebraic Extensions of Q . . . 217
13.1.1 Irreducibility Test . . . 218
13.1.2 Roots of a Polynomial . . . 218
13.1.3 The Function RootOf . . . 219
13.1.4 Numerical Values of Expressions Containing RootOf’s 222 13.1.5 Conversion of RootOf Into Radicals . . . 225
13.2 Computation Over an Algebraic Extension. . . 226
13.2.1 Factorization Over a Given Extension . . . 226
13.2.2 Incompatibility Between Radicals and RootOf . . . 227
13.2.3 Irreducibility, Roots Over a Given Extension . . . 229
13.2.4 Factorization of a Polynomial Over Its Splitting Field 229 13.2.5 Divisibility of Polynomials with Algebraic Coefficients 230 13.2.6 G.c.d. of Polynomials with Algebraic Coefficients . . . 231
13.3 Polynomials with Coefficients in Z/pZ . . . 233
13.3.1 Basic Polynomial Computations in Z/pZ . . . 233
13.3.2 Divisibility of Polynomials in Z/pZ . . . 234
13.3.3 Computation of the G.c.d. of Polynomials in Z/pZ. . . . 235
13.3.4 Euclidean Division, Extended Euclid’s Algorithm . . . 235
13.3.5 Factorization of the Polynomials in Z/pZ . . . 236
14. Rational Functions . . . 239
14.1 Writing of the Rational Functions . . . 239
14.1.1 Irreducible Form . . . 239
14.1.2 Numerator and Denominator . . . 240
14.2 Factorization of the Rational Functions. . . 241
14.2.1 Rational Functions with Rational Coefficients . . . 241
14.2.2 Rational Functions with Any Coefficients . . . 242
14.2.3 Factorization Over an Algebraic Extension . . . 242
14.3 Partial Fraction Decomposition. . . 243
14.3.1 Decomposition of a Rational Function Over Q(x) . . . 243
14.3.2 Decomposition Over R(x) or Over C(x) . . . 244
14.3.3 Decomposition of a Rational Function with Parameters . . . 247
14.4 Continued Fraction Series Expansions . . . 248
15. Construction of Vectors and of Matrices . . . 251
15.1 The linalg Library . . . 251
15.2 Vectors . . . 252
15.2.1 Definition of the Vectors . . . 252
15.2.2 Dimension and Components of a Vector . . . 254
15.3 Matrices . . . 255
15.3.1 Definition of Matrices . . . 255
Table of Contents XV
15.4 Problems of Evaluation . . . 258
15.4.1 Evaluation of Vectors . . . 258
15.4.2 Evaluation of the Matrices . . . 260
15.4.3 Example of Use of Matrices of Variable Size . . . 261
15.5 Special Matrices . . . 263
15.5.1 Diagonal Matrix and Identity Matrix . . . 263
15.5.2 Tri-Diagonal or Multi-Diagonal Matrix . . . 263
15.5.3 Vandermonde Matrix . . . 264
15.5.4 Hilbert Matrix . . . 265
15.5.5 Sylvester Matrix and B´ezout Matrix . . . 265
15.5.6 Matrix of a System of Equations . . . 266
15.6 Random Vectors and Matrices . . . 266
15.6.1 Random Vectors . . . 266
15.6.2 Random Matrices . . . 267
15.7 Functions to Extract Matrices . . . 268
15.7.1 Submatrices . . . 268
15.7.2 Column Vector and Row Vector . . . 269
15.8 Constructors of Matrices . . . 270
15.8.1 Block-Diagonal Matrices . . . 270
15.8.2 Blockmatrices . . . 271
15.8.3 Juxtaposition and Stack of Matrices . . . 272
15.8.4 Copying a Matrix Into Another . . . 273
16. Vector Analysis and Matrix Calculus . . . 275
16.1 Operations upon Vectors and Matrices . . . 275
16.1.1 Linear Combinations of Vectors . . . 275
16.1.2 Linear Combination of Matrices . . . 277
16.1.3 Transposition of Matrices and of Vectors . . . 278
16.1.4 Product of a Matrix by a Vector . . . 279
16.1.5 Product of Matrices . . . 279
16.1.6 Inverse of a Matrix . . . 281
16.1.7 Powers of Square Matrices . . . 282
16.2 Basis of a Vector Subspace . . . 283
16.2.1 Subspace Defined by Generators . . . 283
16.2.2 Kernel of a Matrix . . . 284
16.2.3 Subspace Generated by the Lines of a Matrix . . . 284
16.2.4 Subspace Defined by Equations . . . 285
16.2.5 Intersection and Sum of Vector Subspaces . . . 286
16.2.6 Rank of a Matrix . . . 286
16.2.7 Evaluation Problem . . . 287
XVI Table of Contents
17. Systems of Linear Equations . . . 291
17.1 Solution of a Linear System . . . 291
17.1.1 Linear System Given in Matrix Form . . . 291
17.1.2 Linear System Specified by Equations . . . 294
17.2 The Pivot’s Method . . . 296
17.2.1 Operations on the Rows and the Columns of a Matrix 296 17.2.2 The Function pivot . . . 297
17.2.3 Gaussian Elimination: The Function gausselim . . . 298
17.2.4 Gaussian Elimination Without Denominator: ffgausselim . . . 300
17.2.5 Optional Parameters of gausselim and ffgausselim 301 17.2.6 Gauss–Jordan Elimination . . . 302
18. Normalization of Matrices . . . 305
18.1 Determinant, Characteristic Polynomial . . . 305
18.1.1 Determinant of a Matrix . . . 305
18.1.2 Characteristic Matrix and Characteristic Polynomial . . 306
18.1.3 Minimal Polynomial of a Matrix. . . 307
18.2 Eigenvalues and Eigenvectors of a Matrix . . . 308
18.2.1 Eigenvalues . . . 308
18.2.2 Eigenvectors, Diagonalization . . . 310
18.2.3 Testing if a Matrix Can Be Diagonalized . . . 312
18.2.4 Matrices That Have an Element of Type float . . . 313
18.2.5 The Inert Function Eigenvals . . . 314
18.2.6 Normalization to the Jordan Form . . . 315
19. Orthogonality . . . 319
19.1 Euclidean and Hermitean Vector Spaces . . . 319
19.1.1 Scalar Product, Hermitean Scalar Product . . . 319
19.1.2 Norm . . . 321
19.1.3 Cross Product . . . 321
19.1.4 Gram–Schmidt Orthogonalization . . . 321
19.1.5 Positive Definite and Positive Semidefinite Real Symmetric Matrices . . . 323
19.1.6 Hermitian Transpose of a Matrix . . . 324
19.1.7 Orthogonal Matrix . . . 325
19.1.8 Normalization of Real Symmetric Matrices . . . 325
19.2 Orthogonal Polynomials . . . 326
19.2.1 Chebyshev Polynomials of the First Kind . . . 326
19.2.2 Chebyshev Polynomials of the Second Kind . . . 327
19.2.3 Hermite Polynomials . . . 327
19.2.4 Laguerre Polynomials . . . 328
19.2.5 Legendre and Jacobi Polynomials . . . 329
Table of Contents XVII
20. Vector Analysis . . . 331
20.1 Jacobian Matrix, Divergence . . . 331
20.1.1 Jacobian Matrix. . . 331
20.1.2 Divergence of a Vector Field . . . 332
20.2 Gradient, Laplacian, Curl . . . 333
20.2.1 Gradient . . . 333
20.2.2 Laplacian . . . 333
20.2.3 Hessian Matrix . . . 335
20.2.4 Curl of a Vector Field of R3 . . . 336
20.3 Scalar Potential, Vector Potential . . . 336
20.3.1 Scalar Potential of a Vector Field . . . 336
20.3.2 Vector Potential of a Vector Field . . . 337
21. The MAPLE Objects . . . 339
21.1 Basic Expressions . . . 339
21.1.1 The Types + , * and ˆ . . . 339
21.1.2 The Functions whattype, op and nops . . . 339
21.1.3 The Type function . . . 341
21.1.4 Structure of Basic Mathematical Expressions . . . 342
21.2 Real and Complex Numerical Values . . . 343
21.2.1 The Values of Type numeric . . . 344
21.2.2 The Values of Type realcons . . . 346
21.2.3 The Complex Values . . . 348
21.3 Expression Sequences . . . 349
21.3.1 The Function seq . . . 350
21.3.2 The Operator $ . . . 351
21.3.3 Sequence of Results . . . 351
21.3.4 Sequence of Components of an Expression . . . 352
21.3.5 Sequence of Parameters of a Procedure . . . 352
21.4 Ranges . . . 353
21.5 Sets and Lists . . . 355
21.5.1 The Operators { } and [ ] . . . 355
21.5.2 Operations Upon the Sets . . . 357
21.5.3 Operations on Lists . . . 358
21.5.4 Extraction . . . 359
21.5.5 Back to the Function seq. . . 360
21.6 Unevaluated Integrals . . . 361
21.7 Polynomials . . . 361
21.8 Truncated Series Expansions . . . 364
21.8.1 Taylor Series Expansions . . . 364
21.8.2 Other Series Expansions . . . 365
21.9 Boolean Relations . . . 366
21.9.1 The Type relation . . . 366
XVIII Table of Contents
21.10 Tables and Arrays . . . 368
21.10.1 Tables . . . 368
21.10.2 Tables, Indexed Variables . . . 370
22. Working More Cleverly with the Subexpressions . . . 373
22.1 The Substitution Functions . . . 373
22.1.1 The Function subs . . . 373
22.1.2 The Function subsop . . . 377
22.2 The Function map . . . 378
22.2.1 Using map with a Function Which Has a Single Argument . . . 378
22.2.2 Using map with a Function of Several Arguments . . . 380
22.2.3 Using map Upon a Sequence . . . 381
22.2.4 Avoiding the Use of map . . . 382
23. Programming: Loops and Branches . . . 385
23.1 Loops . . . 385
23.1.1 for Loop with a Numerical Counter . . . 385
23.1.2 for Loop Upon Operands . . . 387
23.1.3 How to Write a Loop That Spans Several Lines . . . 388
23.1.4 Echo of the Instructions of a Loop . . . 389
23.1.5 Nested Loops and Echo on the Screen: printlevel . . . 390
23.1.6 Avoiding for Loops . . . 391
23.1.7 while Loop . . . 392
23.2 Branches . . . 394
23.2.1 The Conditional Branch: if ... then ... elif ... else . . . 394
23.2.2 next and break . . . 396
23.2.3 MAPLE’s Three-State-Logic . . . 397
24. Programming: Functions and Procedures . . . 399
24.1 Functions. . . 399
24.1.1 Definition of a Simple Function . . . 399
24.1.2 Use of a Function . . . 400
24.1.3 Function Using Tests . . . 401
24.1.4 Evaluation Problem for a Function . . . 404
24.1.5 Number of Arguments Passed on to a Function. . . 404
24.1.6 Other Ways to Write a Function . . . 406
24.1.7 Particular Values: remember Table . . . 407
24.2 Procedures . . . 409
24.2.1 Definition of a Procedure . . . 409
24.2.2 Local Variables and Global Variables . . . 411
Table of Contents XIX
24.2.4 remember Table Versus Recursion . . . 417
24.2.5 Structure of an Object Function or Procedure . . . 419
24.3 About Passing Parameters . . . 420
24.3.1 Automatic Verification of the Types of Arguments . . . . 420
24.3.2 Testing the Number and the Kind of Arguments Which Are Passed . . . 420
24.3.3 How to Test a Type . . . 421
24.3.4 Procedure Modifying the Value of Some Parameters . . 423
24.3.5 Procedure with a Variable Number of Arguments . . . 425
24.3.6 Procedure with an Unspecified Number of Arguments 426 24.4 Follow-up of the Execution of a Procedure . . . 427
24.4.1 The Variable printlevel . . . 427
24.4.2 The Functions userinfo and infolevel . . . 429
24.5 Save and Reread a Procedure . . . 431
25. The Mathematical Functions . . . 433
25.1 Catalogue of Mathematical Functions . . . 433
25.1.1 Arithmetical Functions . . . 434
25.1.2 Counting Functions and Γ Function . . . 434
25.1.3 Exponentials, Logarithms and Hypergeometric Function . . . 435
25.1.4 Circular and Hyperbolic Trigonometric Functions . . . 435
25.1.5 Inverse Trigonometric Functions . . . 436
25.1.6 Integral Exponential and Related Functions. . . 437
25.1.7 Bessel Functions . . . 438
25.1.8 Elliptic Functions . . . 440
25.2 How Does a MAPLE Function Work? . . . 441
25.2.1 Numerical Return Values . . . 441
25.2.2 An Example: The Function arcsin . . . 441
25.2.3 Case of the Functions builtin . . . 444
25.2.4 remember Table . . . 444
26. Maple Environment in Windows . . . 447
26.1 The MAPLE Worksheet . . . 447
26.1.1 Text and Maple-input Modes . . . 448
26.1.2 Groups and Sections . . . 449
26.1.3 The Menu Bar . . . 450
26.2 The File Menu . . . 451
26.3 The Edit Menu. . . 453
26.4 The View Menu . . . 454
26.5 The Insert Menu . . . 456
26.6 The Format Menu . . . 457
26.7 The Options Menu . . . 458
XX Table of Contents
26.9 On-line Help . . . 460
26.9.1 The Help Menu . . . 460
26.9.2 Accessing the On-line Help Directly. . . 460
26.9.3 Structure of a Help Page . . . 461