New Features in Maple Version 4.3, Version V and Version V Release 5.2 UIC ADN Computer Center Document #2632007 62 Pages May 17, 1993, Note Updated December 29, 1993 ABSTRACT Maple is a program that is used to perform symbolic mathematical compu- tations. At UIC, Maple is available on a variety of platforms, includ- ing Maple V for RS/6000, MS-DOS and Apple Macintosh machines, and Maple 4.3 is available on UICVM CMS; enter GETDISK MAPLE then enter MAPLE to enter Maple. Maple 4.2 is also available on UICVM CMS; enter: GETDISK MAPLEOLD before entering Maple. (If necessary, enter GETDISK MAPLE (FREE to release the Version 4.3 disk before attaching the Version 4.2 disk.) This document lists the updates and additions to Maple in Version 4.3, V and V.II. The information in this document was obtained from Maple, running on a RS/6000, under Maple V, Release 2, by entering the com- mands: ?updates,v5.2 ?updates,v5 ?updates,v4.3 New Maple Features Since Version 4.2 page ii ======================================================================== Contents New Features in Maple for Version V Release II . . . . . . . . . . . 1 Development of Improved User Interfaces . . . . . . . . . . . . . 1 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 New and Enhanced Mathematical Facilities . . . . . . . . . . . . . 3 New and Enhanced Integration Facilities . . . . . . . . . . . . . 10 New and Enhanced System Facilities . . . . . . . . . . . . . . . . 15 Algorithmic Improvements . . . . . . . . . . . . . . . . . . . . . 20 New Library Functions . . . . . . . . . . . . . . . . . . . . . . 23 Library Packages . . . . . . . . . . . . . . . . . . . . . . . . . 24 Share Library . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Changes in Functionality . . . . . . . . . . . . . . . . . . . . . 33 New Features in Maple for Version V . . . . . . . . . . . . . . . . . 35 Development of Improved User Interfaces . . . . . . . . . . . . . 35 New and enhanced mathematical facilities . . . . . . . . . . . . . 37 New library functions . . . . . . . . . . . . . . . . . . . . . . 42 New library packages . . . . . . . . . . . . . . . . . . . . . . . 43 New functionality in library packages . . . . . . . . . . . . . . 43 New and enhanced system facilities . . . . . . . . . . . . . . . . 44 Algorithmic improvements . . . . . . . . . . . . . . . . . . . . . 46 Miscellaneous changes . . . . . . . . . . . . . . . . . . . . . . 47 New Features in Maple for Version 4.3 . . . . . . . . . . . . . . . . 50 Development of improved user interfaces . . . . . . . . . . . . . 50 3-D plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 New prettyprinter . . . . . . . . . . . . . . . . . . . . . . . . 51 Improved help facility . . . . . . . . . . . . . . . . . . . . . . 51 Macro and alias facilities . . . . . . . . . . . . . . . . . . . . 51 Rule-based facility for function definition . . . . . . . . . . . 51 Internal support for polynomials over the integers modulo n . . . 52 Hardware floating-point evaluation . . . . . . . . . . . . . . . . 52 Numerical computation facilities . . . . . . . . . . . . . . . . . 52 New mathematical functions and constants known to Maple . . . . . 52 Enhanced integration facilities . . . . . . . . . . . . . . . . . 53 New simplification routines . . . . . . . . . . . . . . . . . . . 53 Combine function . . . . . . . . . . . . . . . . . . . . . . . . . 54 New features of fsolve . . . . . . . . . . . . . . . . . . . . . . 54 Type expressions and structured types . . . . . . . . . . . . . . 54 The interface function . . . . . . . . . . . . . . . . . . . . . . 55 Miscellaneous new features in version 4.3 . . . . . . . . . . . . 55 New functions . . . . . . . . . . . . . . . . . . . . . . . . . . 57 New functions in packages . . . . . . . . . . . . . . . . . . . . 58 New packages . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 New Maple Features Since Version 4.2 page 1 ======================================================================== New Features in Maple for Version V Release II Development of Improved User Interfaces New user interfaces which include as a minimum 2 and 3-dimensional graphics, and some command line editing facility have been designed since the release of Maple V for the X Window system, Sunview, PC MS-DOS, Macintosh, Amiga DOS, Vax VMS, NeXT, and the PC under Windows. The new user interfaces for Maple V release II will include worksheets, real mathematical formulae output, and a help browser. Maple Worksheets: Beginning with the Macintosh user interface for Maple V, the new user interfaces will all support the concept of a "worksheet" which integrates text, Maple input commands, Maple output, and graphics into one document. Worksheets have been standardized and are being ported to other platforms for release II, notably X windows. They pro- vide editable input and text fields, simple commands for recalculating parts of worksheets etc. A collection of examples of applications of Maple will be now be distributed in the form of worksheets. A new save facility is being added that will also save the state of a worksheet as well as the display. Two-dimensional output: Beginning with release II of the X Window interface, new interfaces will display output using mathematical, Greek, and italics fonts for improved display of mathematical formulae. Help topic browser: Beginning with Sunview user interface in Maple V, new user interfaces will include a help browser for accessing the on- line help information. Unix Maple interface: Now supports command line editing using a vi and emacs like editor. Hitting the interrupt key Ctrl-C twice will no long- er kill a Maple session, it will only interrupt the current calculation. The quit key Ctrl-\ can be used to immediately kill the Maple session. Also, running a Maple session in a shell under the X Window system, interface(plotdevice=x11); will allow you to access the X plotting facilities. X Window interface: The interface has been redesigned to follow Motif style conventions. The help index is accessible from a menu. The user input fields and the Maple output fields are completely separated. Improved error messages: The new type checking facility results in bet- ter error messages, e.g. > f := proc(n:integer) if n < 0 then 0 else n fi end: > f(x); Error, f expects its 1st argument, n, to be of type integer, but received x Not all Maple functions have been updated yet to make use of this new facility. This should be completed by the next version of Maple. New Maple Features Since Version 4.2 page 2 ======================================================================== Graphics The Maple plotting facility consists of two parts, the rendering of the picture which is written in C, and the point generation which is done in Maple. The basic 2 dimensional plotting command is plot(f(x),x=a..b); It creates a PLOT data structure which is then displayed. The 3 dimen- sional plotting command is plot3d(f(x,y),x=a..b,y=c..d); It creates a PLOT3D data structure. Thus the PLOT and PLOT3D data structures define the what can be displayed. Details on these data structures can be obtained from ?plot3d,structure Improvements to rendering and the PLOT and PLOT3D data structures: - better (more robust but slower) hidden line removal algorithm - the PLOT3D data structure supports text and polygon primitives - PLOT and PLOT3D include support for 2 and 3 D frame sequence animation - the PLOT3D data structure supports a contour plot style option, which is also accessible interactively from the style menu - The plotting primitives in the PLOT and PLOT3D data structures have been made more flexible e.g. each object can have its style and colour assigned individually. - a wider choice of colours, with more user control of surface colouring (PLOT3D). - addition of Lighting models - We have also made the PLOT and PLOT3D data structures compatible. Device support: - encapsulated postscript, colour postscript and grayscale shading post- script output are now supported - addition of HP Laserjet output - a wider selection of output devices for PLOT3D are supported in par- ticular any device that is supported in 2 dimensions including tek- tronics, i300 imagen laser printer, Unix plot, DEC ln03 laser printer etc. New plotting facilities and improvements (plots package): This is a list of the new plotting tools. All are written in Maple, making use of the PLOT and PLOT3D data structures. For details see the section on the plots package in the section on the Library Packages. - 2d and 3d animation - 2d and 3d implicit plotting - 2d and 3d vectorfield and gradient plots - Density plots - Plotting of dsolve(..,numeric) procedures in ODEplot - Plotting of polygons and polyhedra - Log and log-log plots e.g. - Phase portraits and direction field plots, plotting of 1-st order and 2-nd order differential equations (in DEtools package) - Ability to specify color function for objects in plot3d, tubeplot, vectorfield and gradient plots, etc. New Maple Features Since Version 4.2 page 3 ======================================================================== New and Enhanced Mathematical Facilities New Mathematical functions known to Maple: - The floor and ceiling functions floor(x) and ceil(x) - The Elliptic integrals where 0 1 - The exponential integrals Ei(n,x) = int(exp(t)/t^n,t=1..infinity) for Re(x)>0; extended by analytic continuation to the entire complex plane except for 0 when n=1). Note Ei(x) is the Cauchy principle value. - Ssi(x) the shifted sine integral - W(n,x), the W function satisfying exp(W(x))*W(x) = x where n, any integer specifies a branch cut. Note W(x) is the principle branch - erfc(n,x) = int(erfc(n-1,t),t=x..infinity), for n=1,2,... where erfc(0,x) = erfc(x). Note erfc(n,z) corresponds to "i^n erfc z" nota- tion in Abramowitz & Stegun - The derivatives of signum, csgn, trunc, frac, round, floor, ceil implemented as signum(1,x), csgn(1,x) etc. Enhanced numerical facilities: - automatic complex numerical arithmetic, i.e. +, -, *, /, ^ - extend evalf to the complex domain for all elementary functions and erf(z), erfc(z), erfc(n,z), GAMMA(z), GAMMA(a,z) (incomplete Gamma function), Beta(u,v), Psi(z), Psi(n,z), W(z), W(n,z) (all branches), Ei(z), Ci(z), Si(z), Chi(z), Shi(z), Ssi(z) - Dawson's integral dawson(x) = exp(-x^2) * int(exp(t^2),t=0..x) - Elliptic integrals, LegendreE(x,k), LegendreEc(k), LegendreEc1(k), LegendreF(x,k), LegendreKc(k), LegendreKc1(k), LegendrePi(x,k,a), LegendrePic(k,a), LegendrePic1(k,a) - Li(x) = Ei(ln(x) the logarithmic integral defined only for real x > 1 - fsolve has a new algorithm for solving a univariate polynomial over R or C which should always succeed and, all digits should be accurate to 0.6 u lps. - Addition of the remez algorithm for minimax rational function approxi- mation - Addition of an adaptive double exponential algorithm for numerical integration New Maple Features Since Version 4.2 page 4 ======================================================================== - Addition of Levin's u transform for the numerical evaluation of infi- nite sums, products and limits - The routines gauselim, gaussjord, rowspace, colspace, eigenvals, eigenvects, inverse, det, in the linalg package now all handle matri- ces of floating point and complex floating point entries Algebraic numbers and algebraic functions: The evala facility in Maple V supports polynomial operations over algebraic number fields. This facility is used in indefinite integration, eigenvectors, and solving polynomial equations. E.g. Maple can factor the polynomial 3 1/2 2 1/2 1/2 x + (- 28 + 16 2 ) x + (- 288 2 + 384) x - 1792 + 1280 2 over the algebraic number field Q(sqrt(2)) as follows > a := x^3+(-28+16*sqrt(2))*x^2+(-288*sqrt(2)+384)*x-1792+1280*sqrt(2): > factor(a,sqrt(2)); 1/2 1/2 (x - 8) (x - 8 + 8 2 ) (x - 12 + 8 2 ) Because Maple can do this factorization, it means Maple can compute the eigenvalues (also the eigenvectors -- see below) of the following matrix, e.g. > A := matrix( [[5-5*sqrt(2), -2+4*sqrt(2), 5+sqrt(2)], > [-5+sqrt(2), 10-4*sqrt(2), 3+3*sqrt(2)], > [-3+3*sqrt(2), -2+4*sqrt(2), 13-7*sqrt(2)]] ): > eigenvals(A); 1/2 1/2 8, 12 - 8 2 , 8 - 8 2 The generalization of the evala facility to algebraic functions in Maple V release II means that we can replace the sqrt in the above problem by a sqrt of a formula and not just an integer, e.g. sqrt(a). Many parts of Maple work better because of this. The examples in the following sections on integration, polynomial factorization, and symbolic eigen- vectors, Norms and Traces, etc. illustrate other new capabilities in Maple which build on this facility. Polynomial factorization over algebraic number and function fields: Maple V can factor multivariate polynomials over the rational numbers Q and univariate polynomials over algebraic number fields Q(alpha) as in the above example. Maple V release II can factor multivariate polynomi- als over algebraic number fields. For example let's factor the polyno- mial x^6+y^6 first over the rationals Q then over Q(i) i.e. the complex rationals. > factor(x^6+y^6); 2 2 4 2 2 4 (x + y ) (x - x y + y ) New Maple Features Since Version 4.2 page 5 ======================================================================== > factor(x^6+y^6,I); 2 2 2 2 (x - I x y - y ) (x + I x y - y ) (x - I y) (x + I y) Maple V release II can also factor multivariate polynomials over alge- braic function fields e.g. let's factor the following polynomial over Q(sqrt(a)). > f := x^3 + (16*a^(1/2)-28)*x^2 + (64*a-288*a^(1/2)+256)*x > -512*a+1280*a^(1/2)-768: > factor(f,sqrt(a)); 1/2 1/2 (x - 12 + 8 a ) (x + 8 a - 8) (x - 8) Two new factorization routines split and AFactor have been added to the library. split(a,x) factors a univariate polynomial in x into linear factors over its splitting field. evala(AFactor(a)) does a complete factorization of a multivariate polynomial, i.e. over the algebraic clo- sure of Q, e.g. > evala(AFactor(x^2-2*y^2)); 2 2 (x - RootOf(_Z - 2) y) (x + RootOf(_Z - 2) y) The RootOf value that you see in the output above is Maples notation for the algebraic numbers which are the solutions to the polynomial equation _Z^2 - 2 = 0. In this case, the solutions are +- sqrt(2), i.e. they can be written in terms of exact radicals. The user can convert from (and to) the RootOf notation to the radical notation using the convert func- tion > convert(",radical); 1/2 1/2 (x - 2 y) (x + 2 y) Symbolic Eigenvalue and Eigenvector computation.: The eigenvector rou- tine linalg[eigenvects] returns the eigenvectors of a matrix represented exactly in terms of the roots of the characteristic polynomial. For example, for our matrix A used previously, we obtain the eigenvectors > A := matrix( [[5-5*sqrt(2), -2+4*sqrt(2), 5+sqrt(2)], > [-5+sqrt(2), 10-4*sqrt(2), 3+3*sqrt(2)], > [-3+3*sqrt(2), -2+4*sqrt(2), 13-7*sqrt(2)]] ): > eigenvects(A); 1/2 1/2 1/2 [8 - 8 2 , 1, {[ -1, - 2 , 1 ]}], [12 - 8 2 , 1, {[ 1, -1, 1 ]}], New Maple Features Since Version 4.2 page 6 ======================================================================== [8, 1, {[ 1, 1, 1 ]}] The output is a sequence of lists [e,m,b] where e is the eigenvalue, m its multiplicity, and b a basis for the eigenspace for e. In Maple V, the eigenvects command could handle algebraic numbers, including ration- al numbers. Now it can handle algebraic functions, hence matrices of polynomials, e.g. > A := matrix(4,4,[[a,a,a,0], [b,b,0,c], [b,0,c,c], [0,a,a,a]]); [ a a a 0 ] [ ] [ b b 0 c ] A := [ ] [ b 0 c c ] [ ] [ 0 a a a ] > factor(charpoly(A,x)); 3 2 2 2 2 2 (x - a) (x - x a - c x - b x + b c x - c a x - b x a + c a + b a + a b c) > alias(alpha=RootOf(op(2,"),x)): # Denote the roots of the cubic by alpha > eigenvects(A); [a, 1, {[ - c/b, 0, 0, 1 ]}], 2 2 b a - alpha + alpha c + alpha a + c a [alpha, 1, {[ 1, - ----------------------------------------, a (b - c) 2 b a + alpha b - alpha + alpha a + 2 c a ----------------------------------------, 1 ]}] a (b - c) Note: the optional argument 'radical' to the eigenvects command can asks Maple to express roots of polynomials as exact radicals where possible instead of in terms of the RootOf representation. ODEs with Bessel and Hypergeometric function solutions: Many more cases are handled with a better algorithm, which gives results in terms of Bessel functions rather than hypergeometric functions, e.g. > diff(y(x),x,x) + (4*k+1)/(x+2)*diff(y(x),x) + (4*(x+2)^6 + 3/(x+2)^2)*y(x); / d \ / 2 \ (1 + 4 k) |---- y(x)| | d | \ dx / / 6 3 \ |----- y(x)| + --------------------- + |4 (x + 2) + --------| y(x) | 2 | x + 2 | 2| \ dx / \ (x + 2) / New Maple Features Since Version 4.2 page 7 ======================================================================== > dsolve(",y(x)); (- 2 k) 2 1/2 4 y(x) = (x + 2) (_C1 BesselJ(1/4 (4 k - 3) , 1/2 (x + 2) ) 2 1/2 4 + _C2 BesselY(1/4 (4 k - 3) , 1/2 (x + 2) )) Symbolic Fourier transform: The call fourier(f(s),s,w) computes the fourier transform infinity / | - I t w F(w) = | f(t) e dt | / - infinity For example, > fourier(s,s,w); 2 I Pi Dirac(1, w) > fourier(1/(4 - I*t)^(1/3),t,w); 1/2 3 GAMMA(2/3) exp(- 4 w) Heaviside(w) --------------------------------------- 2/3 w New limit algorithm: The idea behind the new algorithm is the follow- ing. First locate the most varying part of the expression. Treat this indeterminate as a symbol and compute a series expansion in this symbol alone. If there is no constant coefficient in the resulting series, you are done, otherwise, recurse on that constant coefficient. Here are some examples > f := exp(exp(exp(Psi(Psi(Psi(n))))))/n; exp(exp(exp(Psi(Psi(Psi(n)))))) f := ------------------------------- n > limit(f,n=infinity); 0 > f := n*(GAMMA(n-1/GAMMA(n))-GAMMA(n)+ln(n)); New Maple Features Since Version 4.2 page 8 ======================================================================== / 1 \ f := n |GAMMA(n - --------) - GAMMA(n) + ln(n)| \ GAMMA(n) / > limit( f, n=infinity ); 1/2 Symbolic simplifications for min, max, trunc, round, ceil, floor, Re, Im: These routines now do quite a number of symbolic simplifications. Note, interval arithmetic is used by the signum function in these exam- ples to prove that the constant Pi < sqrt(10) and that cos(2) < 0. > min( min(Pi,sqrt(10)), min(a+1,a-1), a ); min(Pi, a - 1) > Re( ln(Pi-sqrt(10)) + sqrt(cos(2)) ); 1/2 ln(- Pi + 10 ) Norms and Traces in algebraic number and function fields: Norm(alpha,L,K) and Trace(alpha,L,K) compute the norm (trace) of an algebraic number or function in L over field K. I.e. the input is over the field L and the output is over the field K a subfield of L. The fields L and K are specified by sets of RootOf's which define the field extensions. For example > alias( s2 = RootOf(x^2-2=0), s3 = RootOf(x^2-3=0) ): > L := {s2,s3}: # so L = Q(sqrt(2),sqrt(3)) and > K := {s2}; # K = Q(sqrt(2)) > evala(Trace(x-s2-s3,L,K)); 2 x - 2 s2 > evala(Norm(x-s2-s3,L,K)); 2 x - 2 s2 x - 1 > evala(Norm(x-s2-s3)); # K = Q 4 2 x - 10 x + 1 Computing with field extensions: Indep, Primfield: These are tools for computing with nested field extensions. Indep(L) searches for relations between between the set of field extensions (RootOfs) L. Primfield(L,K) computes a primitive element alpha for a set of field extensions L over the subfield K of L, e.g. New Maple Features Since Version 4.2 page 9 ======================================================================== > evala(Primfield({s2,s3})); 3 3 [ [%1 = s3 + s2], [s3 = 11/2 %1 - 1/2 %1 , s2 = - 9/2 %1 + 1/2 %1 ]] 4 2 %1 := RootOf(_Z - 10 _Z + 1) The result is a list of two elements. The first element defines the primitive element alpha as a RootOf the minimal polynomial over K. We see that the minimal polynomial in this example is x^4-10*x^2+1. It equates alpha in terms of L, i.e. here alpha = sqrt(3)+sqrt(2). The second entry expresses the field extensions of K in terms of alpha. Here sqrt(2) = alpha^3/2-9*alpha/2, and sqrt(3) = 11/2*alpha-alpha^3/2. Continued fractions: The cfrac routine in the numtheory package now computes continued fraction expansions for real numbers, polynomials, series, and formulae. Several forms are available including simple, regular, simregular, etc. The utility routines nthconver, nthnumer, nthdenom return the nth convergent, numerator, denominator e.g. here is the continued fraction for Pi, and the first few convergents > with(numtheory): > cf := cfrac(Pi,5); 1 cf := 3 + -------------------------- 1 7 + ---------------------- 1 15 + ----------------- 1 1 + ------------- 1 292 + ------- 1 + ... > seq( nthconver(cf,i), i=0..5 ); 333 355 103993 104348 3, 22/7, ---, ---, ------, ------ 106 113 33102 33215 > cf := cfrac(exp(x),x,4,simregular); x cf := 1 + ------------------------------- x 1 - 1/2 ----------------------- x 1 + 1/6 --------------- x 1 - 1/6 ------- New Maple Features Since Version 4.2 page 10 ======================================================================== 1 + ... > seq(nthconver(cf,i),i=0..3); 2 1 + 1/2 x 1 + 2/3 x + 1/6 x 1, 1 + x, ---------, ------------------ 1 - 1/2 x 1 - 1/3 x Diophantine approximation: The functions minkowski and kronecker in the number theory package solve the linear diophantine approximation problem, namely, given real or p-adic numbers a[i][j] and epsilon[i], and m equations of the form || sum( a[i][j]*x[j], j=1..m ) || <= epsilon[i], for i=1..m where || z || means, in the real case, the distance between z and the nearest integer z, for p-adic case || z || means p-adic valuation (see function valuep in padic package), solve for integers x[j]. I.e. find integers x[j] and y[i] such that abs( sum(a[i][j]*x[j],j=1..n) - y[i] ) <= epsilon[i] for i=1..m (in the real case). This homogeneous case is solved by the minkowski function where the equations are input in the form abs( sum( a[i][j]*x[j], j=1..m ) - y[i] ) <= epsilon[i], for i=1..m For example > eqn1 := abs( E*x1 + 2^(1/2)*x2 - y1 ) <= 10^(-2): > eqn2 := abs( 3^(1/3)*x1 + Pi*x2 - y2 ) <= 10^(-4): > minkowski( {eqn1,eqn2}, {x1,x2}, {y1,y2} ); [x1 = 7484], [x2 = -2534], [y1 = 16760], [y2 = 2833] The non-homogeneous case (more difficult) i.e. for real or p-adic alpha[i], equations of the form || sum( a[i][j]*x[j], j=1..n ) + alpha[i] || <= epsilon[i], for i=1..m are solved by the kronecker function. New and Enhanced Integration Facilities Dirac and Heaviside: Integration now knows about the Heaviside and Dirac functions, e.g. > int(f(x)*Dirac(x),x=-infinity..infinity); f(0) New Maple Features Since Version 4.2 page 11 ======================================================================== > int(f(x)*Heaviside(x),x=-3..4); 4 / | | f(x) dx | / 0 Elliptic integrals: Integration now recognizes Elliptic integrals and reduces them to a normal form in terms of Legendre functions > f := sqrt( (1-x^2) * (1/25 + x^2/4) ); 2 1/2 2 1/2 f := 1/10 (1 - x ) (4 + 25 x ) > int(1/f,x=1/2..1); 10 1/2 1/2 1/2 ---- 29 LegendreF(1/2 3 , 5/29 29 ) 29 > evalf("); 2.327355206 Algebraic functions: Integration of algebraic functions is now using the Risch-Trager algorithm. This includes a full implementation of the algebraic part including integrands which involve parameters and alge- braic numbers, e.g. > alias(alpha=RootOf(y^3-x^2-a,y); # i.e. alpha = (x^2+a)^(1/3) > f := (4*alpha^2*x^3+(5*x^4+3*x^2*a)*alpha-3*x^2-3*a)/(x^2+a)/x^2; 2 3 4 2 2 4 alpha x + (5 x + 3 x a) alpha - 3 x - 3 a f := ------------------------------------------------ 2 2 (x + a) x > int(f,x); x - 1 2 - 3 ----- + 3 x alpha + 3 alpha x New Maple Features Since Version 4.2 page 12 ======================================================================== and an implementation of the transcendental part for algebraic functions which do not contain parameters, e.g. > alias(alpha=RootOf(y^2-x^3-1,y)); # i.e. beta = sqrt(x^3+1) > f := (3*x^4-6*x^3+5*x^2-2*x+2)/(x^5-2*x^4-x+2*x^3+1)*beta > +(3*x^4+5*x^2-5*x^3-2*x)/(x^5-2*x^4-x+2*x^3+1); 4 3 2 4 2 3 (3 x - 6 x + 5 x - 2 x + 2) beta 3 x + 5 x - 5 x - 2 x f := ----------------------------------- + ------------------------ 5 4 3 5 4 3 x - 2 x - x + 2 x + 1 x - 2 x - x + 2 x + 1 > int(f,x); 2 3 x + x + 1 - 2 x beta 2 beta - ln(----------------------) 3 2 2 (x - x + 1) Integration of the W function: Indefinite integration now uses an inverse function transformation to transform integrals involving the W function (where note W(x) is the function defined to satisfy exp(W(x))*W(x)=x ) of linear arguments to elementary functions, hence the following integrals are computed > int(x/W(x),x); 2 2 x x 1/2 ---- + 1/4 ----- W(x) 2 W(x) > int(1/W(x),x); x ---- - Ei(1, - W(x)) W(x) The Exponential integral, error function, and related integrals: Indef- inite integration of the forms g(x)*sin(f(x)) and g(x)*cos(f(x)) where g(x) is a rational function in x and f(x) is a quadratic polynomial in x are expressed in terms of the Fresnel integrals FresnelC(x) and Fres- nelS(x), and the cosine and sine integrals Ci(x) and Si(x). Note, Maple V can do these examples, but the answer involves complex error functions and Exponential integrals of complex arguments New Maple Features Since Version 4.2 page 13 ======================================================================== > int( 5*x^4*sin(2*x^2+1), x ); 3 2 15 2 - 5/4 x cos(2 x + 1) + ---- x sin(2 x + 1) 16 15 1/2 / x x \ - ---- Pi |cos(1) FresnelS(2 -----) + sin(1) FresnelC(2 -----)| 32 | 1/2 1/2 | \ Pi Pi / > int( sin(u*x^2-v)/x, x ); 2 2 1/2 cos(v) Si(u x ) - 1/2 sin(v) Ci(u x ) New classes of definite integrals: Several new classes of infinite indefinite integrals are now handled. These are computed by evaluating derivatives of special functions and exploiting symmetry. For example, for p>0 and q>0, the class infinity / | (a - 1) s q | x exp(- p x - ----) dx | s / x 0 in general can be expressed in terms of the Bessel K function e.g. > assume(p>0); > assume(q>0); > int( x^2*exp(-p*x^3-q/x^3), x=0..infinity ); 1/2 1/2 1/2 q~ BesselK(1, 2 p~ q~ ) 2/3 ------------------------------- 1/2 p~ Note, the appearance of p~ and q~ in this answer indicates that assump- tions about p and q have been made. Also, several classes involving Bessel functions e.g. for u>0,v>0, the class infinity / | s w s/2 | exp(- u t ) t BesselJ(v , c t ) dt | New Maple Features Since Version 4.2 page 14 ======================================================================== / 0 in general results in 1 F 1, the confluent hypergeomic function, e.g. > int( exp(-t)*t^2*BesselJ(1,sqrt(t)), t=0..infinity ); 15 1/2 ---- Pi hypergeom([7/2], [2], -1/4) 16 Also classes involving the error functions, e.g. for u>0 > assume(u>0); > Int( exp(-u*x^2)*erf(b*x), x=0..infinity ) = > int( exp(-u*x^2)*erf(b*x), x=0..infinity ); b infinity arctan(-----) / 1/2 | 2 u~ | exp(- u~ x ) erf(b x) dx = ------------- | 1/2 1/2 / Pi u~ 0 Handling singularities in an indefinite integral: Definite integration now uses a new algorithm to resolve integrals which have discontinuities (removable or non-removable) in the result from indefinite integration. For example, > int( 1/(5+3*cos(x)), x=0..13*Pi/2 ); 1/2 arctan(1/2) + 3/2 Pi This result was obtained by first computing the indefinite integral > int( 1/(5+3*cos(x)), x ); 1/2 arctan(1/2 tan(1/2 x)) then by taking limits given the following information about the dison- tinuities > readlib(discont)(",x); {2 Pi _Z1 + Pi} A second example showing that Maple can prove that this integral diverg- es, instead of returning unevaluated -- meaning I don't know. > int(1/x^2,x=-1..1); New Maple Features Since Version 4.2 page 15 ======================================================================== infinity Also, the addition of the CauchyPrincipalValue option to int handles this one > int( 1/x, x=-1..1, CauchyPrincipalValue); 0 > int( exp(-t)/t, t=-2..infinity, CauchyPrincipalValue ); - Ei(2) Numerical integration uses exponential quadrature: An adaptive, double- exponential routine has been implemented to handle those integrals for which the default Clenshaw-Curtis quadrature routine (based on Chebyshev series) does not succeed. This new routine replaces the use of an 8'th order adaptive Newton-cotes routine, which, being a fixed order method, does not perform well at high precision. User interface for indefinite integration: An interface for indefinite integration has been added to allow users to teach Maple about how to compute the indefinite integral of an expression f(x) involving the function g(x) by writing a Maple procedure for `int/g` just as one would write `diff/g` for differentiating g(x). The call int(g(x),x) will result in the calling `int/g`(f(_X)) i.e. the whole expression in terms of the global _X will be passed to `int/g`. The routine should return FAIL if it cannot compute the integral. New and Enhanced System Facilities Type declarations for parameters: Procedures accept type declarations as illustrated by the following example. The purpose of this facility note is to encourage better type checking. proc( a:t ) .... end is equivalent to writing proc(a) if nargs > 0 and not type(a,'t') then ERROR(message) fi; .... end New Maple Features Since Version 4.2 page 16 ======================================================================== Note, the type checking is not static, it is done when the procedure is called. The error message generated automatically is illustrated by this example > f := proc(n:integer) if n < 0 then 0 else n fi end: > f(x); Error, f expects its 1st argument, n, to be of type integer, but received x D extended to computation sequences and programs: The D operator can now compute partial derivatives of functions which are defined as proce- dures. This is known as automatic differentiation. Consider > f := proc(x) local t1,t2; > t1 := x^2; > t2 := sin(x); > 3*t1*t2+2*x*t1-x*t2 > end: > # The following computes the derivative of f wrt x, the first argument > D[1](f); proc(x) local t1x,t2x,t1,t2; t1x := 2*x; t1 := x^2; t2x := cos(x); t2 := sin(x); 3*t1x*t2+3*t1*t2x+2*t1x*x+2*t1-t2x*x-t2 end The reader can check that this really does compute the derivative of f by verifying that diff(f(x),x) - D(f)(x) = 0. The advantage of automat- ic differentiation is twofold. Firstly, it is much more efficient, in general, to represent a function as a program instead of as a formula. Secondly, it is more general as functions can have conditional state- ments and loops. For example, given the array(0..n) of the coefficients of a polynomial b, we can represent the polynomial as a program in Hor- ner form as follows. > f := proc(x,b,n) local i,s; > s := 0; > for i from n by -1 to 0 do s := s*x+b[i] od; > s > end: > f(x,b,4); (((b[4] x + b[3]) x + b[2]) x + b[1]) x + b[0] > fx := D[1](f); fx := proc(x,b,n) local sx,i,s; sx := 0; s := 0; for i from n by -1 to 0 do sx := sx*x+s; s := s*x+b[i] od; New Maple Features Since Version 4.2 page 17 ======================================================================== sx end Program optimization -- optimize extended to computations sequences: The optimize routine has been extended to optimize Maple procedures. Currently it does common subexpression optimization on computation sequences, i.e. procedures with assignment statements to local variables only, e.g. > f := proc(x) local t; t := x^2; 3*t*sin(x)+2*x*t-x*sin(x) end: > readlib(optimize)(f); proc(x) local t,t1; t := x^2; t1 := sin(x); 3*t*t1+2*x*t-x*t1 end Multiple libraries -- readlib takes multiple pathnames: Maple automati- cally reads code from the Maple library using the readlib function. The global variable libname specifies where the Maple library is. This can now be assigned a sequence of names. E.g. if the user does > libname := dir1, libname, dir3; this means that when readlib(f) is executed, Maple will search for f first under dir1, and if unsuccessful, it will search under the Maple library, and if unsuccessful under dir3. This means users can have their own development library and have it override the Maple library. Assume facility: One of the deficiencies of Maple and other systems is in handling problems which contain symbolic parameters where the result depends on the domain or range of values that the symbolic parameter(s) takes. E.g. consider > Int( exp(-a*t)*ln(t), t=0..infinity ); infinity / | | exp(- a t) ln(t) dt | / 0 The answer to this integral depends on the value of the parameter a. If a is real and positive, the answer is finite. If a is real and non- positive, the answer is infinite. How can the user tell Maple that a is real and positive? The solution adopted in Maple V release II is to state the assumption about a, i.e. that a is real and positive as fol- lows > assume(a>0); New Maple Features Since Version 4.2 page 18 ======================================================================== The result of this assumption is that the variable a has been assigned a new value which prints as a~ which Maple knows is real (implicitly) and positive. > a; a~ > about(a); Originally a, renamed a~: is assumed to be: RealRange(Open(0),infinity) The assume facility is presently being integrated into Maple, in partic- ular, Maple can now compute the definite integral above because Maple can determine that a is positive because signum(a) returns 1. > signum(a); 1 > int( exp(-a*t)*ln(t), t=0..infinity ); ln(a~) gamma - ------ - ----- a~ a~ Note: Maple V users should stop using signum(a) := 1; because this is a side effect and does not work in conjunction with option remember. The assume facility includes a data base of known properties, and a deduc- tion facility for answering questions like > is(a+1>0); true A deficiency of the assume facility is that the user needs to know what to assume in order to get answers out of facilities like definite inte- gration. This is a topic of current research and future versions of Maple will provide different tools for this. Automatic complex numeric arithmetic: Complex arithmetic in Maple V had to be done with the evalc function. Now, complex numeric arithmetic is automatic. The evalc function is used only for symbolic arithmetic. Example This includes complex rational arithmetic > (2+I/3)^2; 35/9 + 4/3 I And complex floating point arithmetic > sin( (2.0+I/3)^2 ); - 1.378776230 - 1.294704958 I New Maple Features Since Version 4.2 page 19 ======================================================================== The evalc function is now used only for exact symbolic expandsions e.g. > evalc(exp(2+Pi/3*I)); 1/2 1/2 exp(2) + 1/2 I exp(2) 3 > evalc( sqrt(a+I*b) ); 2 2 1/2 1/2 2 2 1/2 1/2 (1/2 (a + b ) + 1/2 a) + I csgn(b - I a) (1/2 (a + b ) - 1/2 a) > assume(a>0); > assume(b>0); > evalc(sqrt(a+b*I)); 2 2 1/2 1/2 2 2 1/2 1/2 (1/2 (a~ + b~ ) + 1/2 a~) + I (1/2 (a~ + b~ ) - 1/2 a~) Arrow operators now accept if statements: The arrow operators, e.g. x -> x/(x^2-1); have been extended to handle if statements so that they can be used to define piecewise functions. E.g. x -> if x < 0 then 0 elif x < 1 then x else 0 fi; I/O facilities and changes: - printf: output a given expression with format (as in the "C" printf, with the added option of %a for algebraic), and also includes the C escapes: \b for backspace, \t for tab, \n for newline, e.g. > printf(`n = %d\tvar = %s\tresult = %a\n`, 10, y, 3*y^2+1); n = 10 var = y result = 3*y^2+1 - sscanf: decode a string according to a format ("inverse" of printf, identical to the "C" sscanf function). - input (tty and read) and output (lprint and save) of numbers in scien- tific E/e notation e.g. 1.2e+3 versus Float(12,2) or 1.2*10^3 - readline: read a line of an arbitrary file and return it as a string - parse: parse a string into a Maple expression - readdata: reads a file of numerical data arranged in columns - output (lprint and save) of powers using ^ instead of ** New types: - type(a,arctrig) tests if a is an arc trigonometric function - type(a,complex(t)) tests if an expression of the form a + b*I where a and b are of type t. Typical cases of t are complex(integer), i.e. Z[i], the Gaussian integers, complex(rational), i.e. Q(i), com- plex(float), i.e. a complex floating point number, and com- plex(numeric) which is any of these. - type(a,nothing) always returns false New Maple Features Since Version 4.2 page 20 ======================================================================== - type(f,mathfunc) tests if a function is a "math" function The defini- tion is that f is either an operator, or evalf/f exists, i.e. Maple knows how to evaluate it in floating point. This includes abs, exp, erf, BesselJ, etc. but also int, sum, limit, and arrow procedures with option operator e.g. x -> sin(x)*cos(x); - type(a,TEXT) tests if a is a TEXT object (used for help files) What is Maple doing?: The userinfo facility, that was introduced in Maple V as a replacement for assigning printlevel to 2, 3, or 4, has been completed. For information on what Maple is doing, and what algor- ithms it is using for a specific function, e.g. integration, one does infolevel[int] := 4; For information on all functions one does infolev- el[all] := 4; Single library archive: On the personal computers, the Macintosh, PC, Amiga and NeXT, the Maple V library is now being distributed as a single file. This saves a significant amount of storage, and avoids problems with systems which have difficulty maintaining large numbers of files. This will be done on other platforms as well. An override mechanism is also provided so files can be updated. The library archive file also resolves problems on systems which have limited filename lenghts and case insensitive filenames. errorbreak: Maple has added some user control for how Maple responds on encountering errors when reading in a file. This is provided by the interface option errorbreak. - With interface(errorbreak=0); the entire input file is read and all errors that are encountered are displayed. This was the Maple V behaviour. - With interface(errorbreak=1); processing stops after the first syntax error thus avoiding nonsensical multiple syntax error messages that are often consequences of the first one. This is the new default behaviour. - With interface(errorbreak=2); processing stops after the first error, whatever it is, i.e. syntax (parse time) or semantic (execution) errors. Algorithmic Improvements Integration of rational functions: The Trager-Rothstein algorithm com- putes the integral of a rational function f(x) over a field K as a sum of logs over K(alpha), an algebraic extension of K of minimial degree. E.g. consider the following rational function in Q(x) where note the denominator is irreducible over Q. New Maple Features Since Version 4.2 page 21 ======================================================================== > f := (6*x^5+6*x^2-4*x+8*x^3-4)/(x^6+2*x^3+1-2*x^2); 5 2 3 6 x + 6 x - 4 x + 8 x - 4 f := ---------------------------- 6 3 2 x + 2 x + 1 - 2 x Applying the Trager-Rothstein algorithm yields the following result ----- \ 3 (1 + alpha) ) ln(x - alpha x + 1) / ----- 2 (alpha - 2) = 0 I.e. there are two logs corresponding to two roots +- sqrt(2) of the polynomial alpha^2-2 = 0. Hence, Maple gets the following nice result > int(f,x); 1/2 3 1/2 1/2 3 1/2 (1 + 2 ) ln(x - 2 x + 1) + (1 - 2 ) ln(x + 2 x + 1) The first improvement in release II is in handling coefficient fields which are function fields, and not just number fields. I.e. the input rational function could involve parameters as well as numbers. This is because of the extension of evala to handle algebraic functions and not just algebraic numbers. The Lazard-Trager improvement allows this answer to be obtained directly without having to compute in the more complicated field K(alpha), i.e. in this example, it doesn't have to compute over Q(sqrt(2)), only Q. Bivariate polynomial Gcd's over Z: We have implemented the dense modu- lar method of Collins for computing Gcds of polynomials with in 2 vari- ables with integer coefficients. The method works by computing comput- ing many gcd's of polynomials in 1 variable modulo different primes and combining these solutions using polynomial interpolation and the Chinese remainder theorem. Note, in Maple V, we implemented this method for univariate polynomials. Also, this is a dense method. For sparse poly- nomials in many variables it is not a good method. Comparing this with the default EEZGCD algorithm in Maple V, we obtain the following improvement. We created three dense bivariate polynomials g,a,b each of degree n with random n digit coefficients and computed gcd(a*g, b*g). n 10 15 20 Maple V 65.0 1,877 18,763 Maple V rel II 10.6 33.7 393.7 New Maple Features Since Version 4.2 page 22 ======================================================================== Integer version of the LLL lattice reduction algorithm: The LLL (Lens- tra Lenstra Lovasz) lattice reduction algorithm has been sped up by a factor of 3 or so for the case of an integer matrix. Factorization over algebraic number fields: We have implemented Lens- tra's algorithm for factorization of polynomials over an algebraic num- ber field. For some polynomials it runs considerably faster than the default algorithm. But it depends very much on the polynomial. Faster numerical evaluation of the arctrig functions: The running time of the algorithms used for the numerical evaluation of exp(x) and ln(x) at high precision is O(n^2 log_2 n) for n digits. This is O(log_2 n) integer multiplications each of which is O(n^2). The algorithms for the trig functions sin, cos, tan use repeated argument reduction to obtain an O(n^(5/2)) algorithm. The same idea is now used by the arctrig func- tions, e.g. Digits arcsin(Pi/4) arctan(Pi/4) Maple V Maple V rel II Maple V Maple V rel II 500 25 3.0 23 2.5 1000 176 11.0 148 11.2 2000 1245 50.4 1038 45.2 Optimized the evaluation of list and set subscripts: List and set sub- scripts i.e. s[i] where s is a list or set have been sped up by a factor of 3 to 5. Optimized the evaluation of numerical arithmetic: Evaluation of numeri- cal expressions e.g. n-i+1, 2*n-2*j+2, has been sped up to avoid the creation of an intermediate data structure. This is a significant improvement in the cases of small integers, e.g. array subscript calcu- lations. Consider these two codes for computing the Fibonacci numbers F(n) > F1 := proc(n) if n < 2 then n else F1(n-1)+F1(n-2) fi end; > F2 := proc(n) F2(n-1)+F2(n-2) end; F2(0) := 0; F2(1) := 1; The improvement in the arithmetic that occurs in F(n-1)+F(n-2) yields Maple V Maple V rel II n F1 F2 F1 F2 16 1.05 0.73 0.78 0.47 18 2.73 2.17 2.17 1.32 20 7.30 5.20 5.92 3.55 22 20.17 13.45 15.20 8.53 New Maple Features Since Version 4.2 page 23 ======================================================================== Floating point solutions to polynomials: We have rewritten the code for computing floating point approximations to roots of polynomials. The new code will increase the intermediate precision so that the roots found are fully accurate, i.e. accurate to 0.6 ulp. We have also imple- mented a routine in the kernel in C to use hardware floating point arithmetic. If the roots found using this routine are accurate then the fsolve routine will execute faster, as illustrated in the following examples. T(n,x) is the n'th Chebyshev polynomial of the first kind. It has all real roots. F(n,x) is the n'th Fibonacci polynomial which has all complex roots except 0. The jump in times indicates where hard- ware precision is no longer sufficient. Maple V Release II n T(n,x) F(n,x) T(n,x) F(n,x) 10 1.68 1.86 0.45 0.23 20 8.95 11.43 2.17 1.43 30 FAIL 36.72 6.08 3.47 40 FAIL 34.22 7.57 50 106.2 50.45 Character tables for Sn: In computing the character table for Sn the symmetric group on n letters we are now making use of the conjugate par- titions and symmetry in the table. The improvement is better than a factor of 2 for large n. Note the table has dimension p(n) by p(n) where p(n) is the number of partitions of n so requires exponential space in n to store. The data here are for computing combi- nat[character](n) Maple V Release II n 8 6.6 3.5 10 26.0 12.6 12 102.0 43.4 14 446.8 160.3 New Library Functions AFactor, AFactors -- absolute factorization over the complex numbers argument -- complex argument of a complex number assume -- for making assumptions about variables e.g. assume(a>0); ceil -- ceiling function csgn -- complex sign discont -- compute a set of possible discontinutities of an expression floor -- floor function fourier, invfourier -- symbolic fourier transform and inverse ilog, ilog10 -- IEEE integer logarithm function Indep -- test algebraic extensions over Q for independence invfunc -- table of inverse functions is, isgiven -- for testing properties against the assume database New Maple Features Since Version 4.2 page 24 ======================================================================== Norm -- computes the norm of the algebraic number or function over a field K Primfield -- computes a primitive element over a given algebraic number field powmod -- computes a(x)^n mod b(x) using binary powering ratrecon, Ratrecon -- rational function reconstruction (Euclidean algorithm) readdata -- reads a file of numerical data arranged in columns spline -- computes a natural cubic spline from a set of data split -- splits a polynomial into linear factors over its splitting field sqrfree -- a square free factorization of a multivariate polynomial symmdiff -- symmetric difference of sets Trace -- computes the trace of the algebraic number or function over a field K unload -- unload a Maple library function Library Packages The package mechanism has been extended to support an initialization routine. The initialization routine should be placed either in the package as the routine package[init], or as the routine `package/init` in the library in the file `package/init.m`; This routine is executed by with(package); It is up to the initialization routine to decide what to do if it is called a second time. Below is a list of the new packag- es and modifications to existing packages. approx (Numerical Approximation Package): - infnorm: compute the (weighted) infinity norm of an approximation - minimax: compute a (weighted) minimax numerical approximation - remez: Remez algorithm for minimax rational function approximation The main function in this package is minimax which has the following functionality: minimax(f,x=a..b,n,w) or minimax(f,x=a..b,[m,n],w); It uses the Remez algorithm to compute the best minimax polynomial of degree <= n, or rational function with numerator of degree <= m, and denominator of degree <= n to the function f on the range [a,b]. The optional 4'th paramter w specifies a weight function (default 1). For example, here is a [4,4] rational approximation to erf(x) on [0,3] which I've rounded to 7 decimal digits. The approximation is accurate to almost 5 digits on [0,3]. > evalf(minimax(erf(x),x=0..3,[4,4]), 7); .00002407481 + (1.127063 + ( - .2493939 + (.09458902 + .06665265 x) x) x) x --------------------------------------------------------------------------- 1. + ( - .2313770 + (.4509384 + ( - .06758241 + .08086507 x) x) x) x combinat (Combinatorial Functions Package): - conjpart: conjugate partition New Maple Features Since Version 4.2 page 25 ======================================================================== DEtools (Differential Equation Plots Package): A package for plotting differential equations including systems of ODE's and some special PDE's, allowing the associated vector field to be plotted and solution curves for different initial conditions. - DE1: plot a first order linear ODE for given initial conditions - DE2: plot a system of two first order linear ODEs - PDEplot: plot the surface of a first order, quasi-linear PDE of the form P(x,y,u) * D[1](u)(x,y) + Q(x,y,u) * D[2](u)(x,y) = R(x,y u) - dfieldplot: plot a field plot for a single or two first order linear ODEs - phaseportrait: plot a phase plot for a single or two first order lin- ear ODEs Gauss: A package which allows one to create "domains" of computation in a similar way that the AXIOM system allows. The advantage is that rou- tines for computing with polynomials, matrices, and series etc. can be parameterized by any coefficient ring. E.g. given a ring R, the Gauss statement > P := DenseUnivariatePolynomial(R,x): creates a dense univariate polynomial domain P which contains all the routines needed to do arithmetic with polynomials over R. The advantage is that the the code supplied by the DenseUnivariatePolynomial function works for any coefficient domain R which is a ring, i.e. has operations +, -, *, etc. It is expected that many Maple library routines will be recoded in Gauss over the next few versions. The initial implementation includes basic facilities for computing with polynomials, matrices and series over number rings, finite fields, polynomial rings, and matrix rings. GaussInt (Gaussian Integer Package): This is a set of routines for com- puting with Gaussian (complex) integers, i.e. numbers of the form a + b I where a and b are integers. Included are routines for computing the Gcd of two Gaussian integers, the factorization of a Gaussian integer, and a test for primality, e.g. > GIfactor(13); (3 + 2 I) (3 - 2 I) linalg (Linear Algebra Package): - blockmatrix: utility routine to create a block matrix - gausselim, gaussjord, rowspace, colspace: now handle matrices of floats, complex floats, and complex rationals - eigenvals, eigenvects: now handle matrices of floats and complex floats - entermatrix: utility routine for entering the entries of a matrix - randvector: utility routine to create a random vector - ratform: (synonym for frobenius) computes the rational canonical form New Maple Features Since Version 4.2 page 26 ======================================================================== - Wronskian: computes the Wronskian matrix numtheory: (Number Theory Package): - cfrac: modified to handle different forms of continued fractions real numbers, series, polynomials. - cfracpol: computes continued fractions for the real roots of a polyno- mial - kronecker: Diophantine approximation in the inhomogeneous case - minkowski: Diophantine approximation in the homogeneous case - nthnumer: returns the denominator of the n'th convergent - nthdenom: returns the numerator of the n'th convergent - nthconver: returns the n'th convergent of a simple continued fraction - thue: compute the resolutions of Thue equations or Thue inequalities - sq2factor: factorization in the UFD Z[sqrt(2)] padic (Padic Number Package): A package for computing P-adic approxima- tions to real numbers, e.g. > with(padic): > evalp(sqrt(2),7); 2 3 4 5 6 7 8 9 3 + 7 + 2 7 + 6 7 + 7 + 2 7 + 7 + 2 7 + 4 7 + O(7 ) > evalp(exp(3),3); 2 3 4 6 8 9 1 + 3 + 3 + 2 3 + 2 3 + 3 + 3 + O(3 ) plots (Plots Package): - animate: animate one or more functions in 2 dimensions, e.g. a) sine - cosine waves animate({sin(x*t),cos(x*t)},x=-2*Pi..Pi,t=0..2*Pi); b) a polar coordinate unraveling animate([sin(x*t),x,x=-4..4],t=1..4,coords=polar,numpoints=100,frames=100); - animate3d: animate one or more curves or surfaces in 3 dimensions, e.g. animate3d(cos(t*x)*sin(t*y), x=-Pi..Pi, y=-Pi..Pi,t=1..2); - conformal: routine is typically 3 times faster - contourplot: contour plot of a 3 dimensional surface, e.g. contourplot(sin(x*y),x=-Pi..Pi,y=-Pi..Pi,grid=[30,30]); - densityplot: density plot, e.g. densityplot(sin(x*y),x=-Pi..Pi,y=-Pi..Pi,grid=[30,30]); - fieldplot: field plot of a linear first order ODE vfield := [x/(x^2+y^2+4)^(1/2),-y/(x^2+y^2+4)^(1/2)]: fieldplot(vfield,x=-2..2,y=-2..2); New Maple Features Since Version 4.2 page 27 ======================================================================== - fieldplot3d: field plot of a linear first order ODE fieldplot3d([2*x,2*y,1],x=-1..1,y=-1..1,z=-1..1, grid=[10,10,5],arrows=THICK,style=patch); - gradplot: plot the gradient vector field of a 2 dimensional function - gradplot3d: plot the gradient vector field of a 3 dimensional func- tion, e.g. gradplot3d( (x^2+y^2+z^2+1)^(1/2),x=-2..2,y=-2..2,z=-2..2); - implicitplot: plot a curve defined implicitly by F(x,y) = 0, e.g. implicitplot( x^2 + y^2 = 1, x=-1..1,y=-1..1 ); - implicitplot3d: plot a surface defined implicitly by F(x,y,z) = 0, e.g. implicitplot3d( x^2+y^2+z^2 = 1, x=-1..1, y=-1..1, z=-1..1 ); - logplot: log plot, e.g. logplot(10^(20*exp(-x)),x=1..10); - loglogplot: log log plot, e.g. loglogplot(10^(20*exp(-x)),x=1..100); - odeplot: plot the solution of an ODE from dsolve p := dsolve({D(y)(x) = y(x), y(0)=1}, y(x), numeric): odeplot(p,[x,y(x)],-1..1); - polygonplot: draw one or more polygons in 2 dimensions ngon := n -> [seq([ cos(2*Pi*i/n), sin(2*Pi*i/n) ], i = 1..n)]: polygonplot(ngon(8)); - polygonplot3d: draw one or more polygons in 3 dimensions - polyhedraplot: for plotting tetrahedrons, octahedrons, hexahedrons, dodecahedrons,icosahedrons e.g. polyhedraplot([0,0,0],polytype=dodecahedron); - surfdata: plot a surface input as a grid of data points cosdata := [seq([ seq([i,j,evalf(cos((i+j)/5))], i=-5..5)], j=-5..5)]: F:= (x,y) -> x^2 + y^2: surfdata( cosdata, axes=frame, color=F ); - textplot: for plotting labelled points in 2 dimensions, e.g. textplot([1,2,`one point in 2d`],align={ABOVE,RIGHT}); - textplot3d: for plotting labelled points in 3 dimensions, e.g. textplot3d({[1,2,3,`one point in 3d`],[3,2,1,`second point in 3d`]}); networks: (Graph Networks Package): A package of routines for creating, manipulating and computing properties of graphs, i.e. graphs with edges and vertices. Primitives exist for computing properties such as edge connectivity, biconnected components, and edge or vertex set induced subgraphs. The graphs may have loops or multiple edges, both directed and undirected, and arbitrary weights can be associated with both edges and vertices. Graphs can be drawn as a picture (a plot) for display. For example, here we create the Petersen graph and compute and factor its characteristic polynomial. New Maple Features Since Version 4.2 page 28 ======================================================================== > with(networks): > factor(charpoly(petersen(),x)); 4 5 (x - 3) (x + 2) (x - 1) The spanpoly(G,p) function computes a polynomial for the undirected graph G where p is a probability of failure associated with each edge. When G is connected, this is the all-terminal reliability polynomial of G. Here is the all-terminal reliability polynomial for the complete graph on 4 vertices. > spanpoly(complete(4),p); 3 2 3 - p (- 16 + 33 p - 24 p + 6 p ) liesymm: (Lie Symmetries Package): This package is for characterizing the contact symmetries of a system of partial differential equations. The basic routines makeforms() and annul() for automatic translation to and from differential forms now maintain and make use of additional information which allow the full reconstruction of the original system of PDE's, and handle a broader class of systems of PDE's. > with(liesymm): > e1 := Diff(h(t,x),x,x) = Diff(h(t,x),t): > makeforms(e1,h(t,x),w); [d(h) - w1 d(t) - w2 d(x), (d(w2) &^ d(t)) - w1 (d(x) &^ d(t))] > annul("); / 2 \ | d | / d \ {|----- h(t, x)| - |---- h(t, x)| = 0} | 2 | \ dt / \ dx / In addition, knowledge of the original system of equations has been maintained and used to carry out some basic simplifications of the sys- tem of PDE's characterizing the contact symmetries. New routines include: - indepvars, depvars: routines for enquiring or setting the independent and dependent variables for the current problem. E.g. indepvars(); returns [t, x] and depvars(); returns [h] in the example. This infor- mation is established through use of commands like makeforms() and determine() - choose: analogous to isolate() but for wedge products. New Maple Features Since Version 4.2 page 29 ======================================================================== - reduce: makes use of knowledge of the dependencies to simplify the resulting determining equations. - autosimp: carries out some simple integrations and uses the results to simplify the given system of PDE's. - TD, Eta, extgen, prolong: for generating the extended operator - value, dvalue: the value routine has been renamed to dvalue to avoid conflict with the main value routine. This routine evaluates inert derivatives (Diff) and returns its result in the inert form . Share Library Contributions from Maple users: The share library is a repository of applications codes, contributed primarily by Maple users. It is dis- tributed with each version of Maple in both src and Maple ".m" format. However, our ambitions have expanded. The share library has been com- pletely reorganized. Beginning with this version, it also includes - TeX/LaTeX introductory documents on using Maple - TeX/LaTeX support documentation for applications codes - updates to library routines, i.e. bug fixes, efficiency improvements etc. - examples of applications of Maple to problem solving We have also endeavoured to ensure that each contribution comes with on-line Maple style help files, and Maple style test files to help us ensure that the code is working correctly. How to access code from the share library from inside Maple: Users can access routines in the share library by reading them in directly from the files using the read command. Also, where appropriate, one can now access them directly from inside Maple using the with command. The command with(share); looks to see if the share library exists, i.e. it is adjacent to the Maple library (it simply tries to read a file from it). If successful, it assigns the global variable "sharename" to the path where it found the share library, and then it executes the state- ment > libname := libname, sharename; Now Maple's readlib command and with command will automatically search the share library after first searching the Maple library. If unsuc- cessful, the user can locate the share library and set the libname vari- able directly. For example, the fit routine in the share library can be used to "fit" a formula to some data in the least squares sense. > with(share): # locate the share library > readlib(fit): # now finds the fit routine from the share library > fit([-1.5,0.5,1.5],[0,-2,-1.5], a*t^2+b*t+c, t); New Maple Features Since Version 4.2 page 30 ======================================================================== 2 .4999999997 t - .5000000001 t - 1.874999999 Documentation for the code is in the file. After reading in the fit routine, additional documentation is included in TeX/LaTeX files. See ?share,contents for a summary of the contents of the share library. Electronic distribution version of the Maple share library: The share library will also be distributed electronically, firstly, over the internet by using anonymous ftp, and secondly, by electronic mail, with an electronic mail server. The electronic version is be updated period- ically, about once every 3 months, with new contributions, corrections to previous contributions etc. Unlike the Maple version, it contains a directory of updates to the Maple library, primarily simple bug fixes. For directions on how to get code using anonymous ftp, electronic mail, and how to install it and use it, see ?share for details. Policy of the contributions to the share library: The code in the share library has been contributed freely by the authors to be made freely available to all Maple users. It is not to be sold for profit or changed without the author's permission. Authors who contribute code to the share library will be asked to write Maple style on-line help docu- mentation and a test file. Authors will also be asked to sign a non- exclusive agreement to let us distribute your code, and to let us change your code to maintain it. Miscellaneous - the catenation operator . now expands in ``.(a,b,c).(1..3) to yield a1, a2, a3, b1, b2, b3, c1, c2, c3 - expand of @ and @@ now handled e.g. expand((sin@@)(2)(x) ); ==> sin(sin(x)) - evalf of @ and @@ now handled e.g. evalf((sin@@2)(2)); ==> .7890723436 - anames(t) returns all names of type t - a[1] := x; is dissallowed if a is assigned an object other than an array or table - f()[1] is now allowed; it returns unevaluated - Changes to fortran and C - both now use appendto instead of writeto to append output to a file instead of overwriting it New Maple Features Since Version 4.2 page 31 ======================================================================== - both now translate subsripts e.g. a[i-2*j] where the 2 here is understood to be an integer - both now convert symbolic constants e.g. Pi to floating point - optional parameter digits = n for specifying the precision to be used in converting constants to floating point - C now also breaks up large expressions which otherwise cause some compilers to break - Changes to dsolve/numeric The output of dsolve({equations in x},{functions of x},numeric) is a procedure f where f(x) returns a tuple of values. E.g dsolve({...},{y(x),z(x)},numeric); returns f a procedure where f(1) returns x=1, y(x)=y(1), z(x)=z(1) The odeplot routine in the plots package can be used to plot the result. - Mellin speeded up by a factor of 4-30 - ifactor has been sped up for the case of a perfect power - series(f(x),x=a); now allows +-infinity for a > series(ln(1-x),x=-infinity); 1 1 1 1 1 - ln(- 1/x) - 1/x - ---- - ---- - ---- - ---- + O(----) 2 3 4 5 6 2 x 3 x 4 x 5 x x - signum(f) where f is a symbolic constant will use interval arithmetic at Digits precision to determine the sign of f, e.g. sig- num(Pi-4*sin(1)); - the for loop clauses "by", "to", "from" and "while" can now appear in any order - Changes to automatic simplifictions - the ln(1/x) ==> -ln(x) automatic simplification has been turned off. ln(a^n) ==> n ln(a) is now done iff signum(a) = 1, i.e. x is prov- ably +ve - the ln(exp(x)) ==> x automatic simplification has been turned off. ln(exp(x)) ==> x is now down iff Im(x) returns 0, i.e. x is provable real - the automatic simplification sqrt(x^2) ==> x (incorrect for -ve x) is being fixed for the next version (the change is more difficult than the others) - the arcsin(sin(x)) ==> x arctrig simplifications have been turned off - inverse functions simplifications have been added e.g. sin@@(-1) ==> arcsin - trig simplifications for multiples of Pi/8, Pi/10, Pi/12 have been added > sin(Pi/8), sin(Pi/10), sin(Pi/12); New Maple Features Since Version 4.2 page 32 ======================================================================== 1/2 1/2 1/2 1/2 1/2 1/2 (2 - 2 ) , 1/4 5 - 1/4, 1/2 (2 - 3 ) - Changes to evalhf - can now be interrupted - now accepts break/next in for loops - now understands round, floor, ceil, Dirac and Heaviside. - improved error messages - rounding on input to 1/2 ulp - rounding on output to less than 1/2 ulp (except that result is trun- cated to 4 words later and this may cause up to 2.0 ulps) - arrays passed as local arguments now work - a primitive printlevel debugging facility added for tracing assign- ments though note this may yield a large output - now understands true and false - the old library file name limit of 9 characters has been removed. The limit is now 55 characters for the path e.g. int/rischalg/intbasis - fsolve recognizes the option real as well as complex. The default is to compute the real roots. - Additional simplifications for Dirac and Heaviside are provided through the general purpose simplify facility, e.g. > simplify( Heaviside(x-1)*Heaviside(x-3) ); Heaviside(x - 3) > simplify( F(x+3)*Dirac(x) ); F(3) Dirac(x) - Additional simplification routines for the arctrig functions are pro- vided through the general purpose simplifier, e.g. > simplify( arctan(x)+arctan(1/x) ); 1/2 signum(x) Pi - A new description field has been added to procedures for stating a short description of what a procedure computes. The idea is that most of the time, people use the ? help facility to remind them of what the parameters are, their order, the options, and what the computes, in particular, the return type. The print facility provides this in con- junction with the new parameter type declarations, and the description field, e.g. a library routine > F := proc(n:integer) > option `Copyright 1990 by the University of Waterloo` > description `computes the n'th Fibonacci number, an integer`; > if n < 2 then n else F(n-1)+F(n-2) fi; New Maple Features Since Version 4.2 page 33 ======================================================================== > end: > print(F); proc(n:integer) description `computes the n'th Fibonacci number, an integer`; ... 1/2 (2 - 2 ) , 1/4 5 - 1/4, 1/2 (2 - 3 ) Changes in Functionality We have endeavoured NOT to change the functionality of existing func- tions in the system, language, and library from version V release I to release II so that users' code will work, and the new manuals will remain accurate. In some cases it was necessary to make a change in order to fix a problem or inconsistency. We have listed the changes that are most likely to affect users below. Please note however that the .m format has changed, so all users will need to reload any code from Maple V or Maple 4.3. Complex numerical arithmetic is now automatic, i.e. +, -, *, /, ^, of: complex integers, complex rationals, and complex floats is done automat- ically. Also evalf now works over the complex floats. Consequently many functio ns now work better, and faster, with complex numbers. Simple partial derivatives use the diff notation not the D notation, i.e.: the output of diff(f(x,y),x,y,x); which used to return D[1,1,2](f)(x,y) now returns diff(diff(diff(f(x,y),x),x),y) which is displayed as follows 3 d -------- f(x, y) 2 dy dx Release II still assumes that partial derivatives commute as did Maple V. This is coded in the routine `diff/diff` and can be changed as nec- essary. Note, use convert to convert between the two representations, i.e. convert(...,D); and convert(...,diff); The function combinat[combine] has been renamed combinat[choose] to not: collide with the combine function and the trace function has been renamed debug to not collide with linalg[trace], i.e. the trace of a matrix. New Maple Features Since Version 4.2 page 34 ======================================================================== The meaning of x in plot(..., x=a..b); and plot(..., a..b) has changed to: be consistent with the 3-dimensional case. If you give a range as the 2nd argument, i.e. plot(f,0..1); and plot3d(g,0..1,0..1); then Maple understands this to mean: treat f and g as functions or mappings, e.g. plot( sin, -3..3 ); and plot( binomial, -3..3, -3..3 ); On the other hand, if you give an equation/range as the second argument, i.e. plot(f(x),x=0..1); or plot3d(g(x,y),x=0..1,y=0..1); then this is understood to mean plot the expression or formula f(x) and g(x,y), e.g. plot( sin(x), x=-3..3 ); and plot( binomial(n,k), n=-3..3, k=-3..3 ); Hence you can plot Maple procedures and operator expressions e.g. plot( x -> if x < 0 then 1 else cos(x) fi, -2..2 ); plot( sin^2+cos@log, 0..3 ); The output from dsolve/numeric has changed to include the variables, e.g.: > sys := diff(y(x),x)=z(x),diff(z(x),x)=-y(x): fcns := {y(x), z(x)}: > p:= dsolve({sys,y(0)=0,z(0)=1},fcns,numeric): > p(0.5); {x = .5000000000, y(x) = .4794255401, z(x) = .8775825652} This can be plotted by by then doing > plots[ODEplot](p,[[x,y(x)],[x,z(x)]],0..10); Output from lprint and save of powers now uses ^ instead of ** and of: floating point numbers now uses scientific e/E notation instead of Float(m,e) Some automatic simplifications have been turned off e.g. ln(1/x) ==> -ln(x): A complete list is given in the section Changes to automatic simplifictions below under Miscellaneous. The ones most likely to affect users are those simplifications which have been turned off -- because they are not correct for all complex values of parameters. Hitting the interrupt key twice will no longer kill a Maple session, it: will only interrupt the current calculation. The quit key can be used to kill Maple. On Unix this usually is ^\ by default. New Maple Features Since Version 4.2 page 35 ======================================================================== Indefinite integrals which require the exponential integral now return: in terms of Ei(1,x) not Ei(x) which is the Cauchy principle value. E.g. > int( exp(-x)/x^3, x ); exp(- x) exp(- x) - 1/2 -------- + 1/2 -------- - 1/2 Ei(1, x) 2 x x New semantics of evalf(f,n). The old semantics was first evaluate f,: then simplify the result (at Digits precision) yielding f', then evalu- ate and simplify n yielding n' and assign Digits to n'. Now evalf f' at n' digits precision, simplify the result and return. The new semantics is, first evaluate n to n' and assign Digits to n', then evaluate f and simplify the result (at precision Digits = n') yielding f', then evalf f' at Digits = n' precision. This example illustrates what is going on here x := 7.0; evalf( 2/x*Pi, 20 ); In Maple V, 2/x*Pi evaluates to 2/7.0*Pi, and simplifying 2/7.0 is done at Digits = 10 (the default) precision yielding .2857142857*Pi. Then evalfing this at 20 digits we get .89759790129493458131 . In Maple V release II all the arithemetic is being done at 20 digits precision and we get .89759790102565521098 . The fsolve command, when given a range, now solves on the closed inter- val: not the open interval. E.g. for the polynomial 1-x^2 with roots at +- 1, fsolve(1-x^2,x,-1..1) now returns -1 and +1. New Features in Maple for Version V Development of Improved User Interfaces X Window interface: A user interface for X Window has been designed. The X Window user interface provides separate help and plot windows, allows editing of input expressions, maintains a log of a Maple session, and supports an assortment of other options. The various methods of setting defaults, key bindings, etc. are documented in the help file for X11. 3-Dimensional graphics: Maple V supports 3-D surface plots under sever- al software platforms, including X Window. Printed output is provided for a variety of printers, including Postscript devices. Surfaces can be described either by a single function of two variables or paramet- rically. The coordinate system can be either cartesian, spherical, or New Maple Features Since Version 4.2 page 36 ======================================================================== cylindrical. The surface can be rendered as surface patches, a wire frame plot (with optional hidden line removal), or a collection of points. There is also a "plots" package which contains a number of spe- cialized plotting facilities e.g. matrix plots, conformal plots, tube plots etc. Additional documentation is available on-line for the plots package. New arrow syntax for specifying operators (functions): In addition to the "proc ... end" and the angle bracket < ... > notations for defining functions (procedures), the following "arrow" notation has been adopted as an alternative syntax f := x -> x^2 g := (x,y) -> sin(x+exp(y)) Sorting polynomials: Expressions in Maple are usually stored in the order they were created. Consequently polynomials often appear in a seemingly random order. The sort command can now be applied to sort any polynomials that appear in an expression. Univariate polynomials are sorted in descending order. Multivariate polynomials may be sorted by "total degree" (default) with ties broken by lexicographical order, or in pure lexicographical order. An optional argument may be given to specify the variable ordering. Example: > a := y^3+y^2*x^2+x^3; 3 2 2 3 a := y + y x + x > sort(a,[x,y],tdeg); 2 2 3 3 x y + x + y > sort(a,[x,y],plex); 3 2 2 3 x + x y + y Improved display of output: The output of matrices, vectors, and repeated composition has been improved. Example: compute a Taylor series expansion for an unknown function F > s := taylor(f(x),x=0,4); (2) 2 (3) 3 4 s := f(0) + D(f)(0) x + 1/2 D (f)(0) x + 1/6 D (f)(0) x + O(x ) > linalg[vector]( 4, i -> coeff(s,x,i-1) ); (2) (3) [ f(0), D(f)(0), 1/2 D (f)(0), 1/6 D (f)(0) ] New Maple Features Since Version 4.2 page 37 ======================================================================== User defined formatting routines: Maple's pretty printer understands how to display certain objects such as polynomials, plots, matrices, vectors, integrals, subscripts, etc. Users may now specify how their own functions are to be displayed as follows: To format a function foo(...) the user may assign to the name `print/foo` a Maple procedure. The Maple procedure will be invoked during output of a Maple expression once for each different instance of foo in the output. The procedure can return any expression. Example: > `print/complex` := proc(r,i) r+i*I end: > complex(1,2); 1 + 2 I New help syntax and user defined help routines: Help is now also avail- able using the ? syntax. For example, to get help for the mod operator, one types simply > ?mod The searching component of the help system has been much improved. The help files themselves now include the actual Maple output. The user may tell Maple how to generate help for a function "foo" by assigning the name `help/text/foo` to a TEXT object, e.g. > `help/text/foo` := TEXT(`this is line 1`, `and this is line 2`): > ?foo this is line 1 and this is line 2 New and enhanced mathematical facilities New Mathematical functions known to Maple: - Complementary error function erfc(z) = 1-erf(z) (diff/erfc, limit/ erfc, evalf/erfc, series/erfc) - Airy wave functions Ai(x) and Bi(x) (evalf/Ai, evalf/Bi) - The 3 argument limiting case only of the Meijer G function (diff/ MeijerG, evalf/MeijerG, series/MeijerG) - The Dirac delta function Dirac(x) and its derivatives Dirac(n,x) - The generalized Riemann Zeta function Zeta(0,x,s) and its derivatives Zeta(n,x,s). New Maple Features Since Version 4.2 page 38 ======================================================================== Enhanced numerical facilities: - Asymptotic series are now used to numerically evaluate the following functions for large x: Si(x) and Ci(x) (Sine and Cosine integrals), Ai(x) and Bi(x) (Airy wave functions), erfc(x) (complementary error function), BesselJ and BesselY (Bessel functions J(v,x) and Y(v,x)). - Evalf of sum(f(r),r=RootOf(a(x),x)) sums f(r) over the complex roots of a polynomial a(x). - Dsolve has been extended to use a Runga Kutta based numerical method for solving initial value ODE's. - The library routines shake and evalr provide a model of interval arithmetic which is used for simplifications of signum of exact real constants. Enhanced integration facilities: Definite integration has been extended to handle more integrands of the following form: int( R(t)*exp(-u*t^s)*ln(b*t)^m*cos(c*t^r), t=a..infinity ) or sin where r in {0,s,2*s,s/2} and other restrictions on the constants apply. In general these integrals can be expressed in terms of the Gamma func- tion, incomplete Gamma function GAMMA(a,x), and the Polygamma function Psi(x), the Riemann Zeta function Zeta(x), the error function and Fres- nel integrals, and the Meijer G function. Examples where R(t) is a pow- er of t (possibly negative and/or fractional): > int( exp(-t^2)*cos(2*t)*t^2, t=0..infinity ); 1/2 - 1/4 Pi exp(-1) > int( exp(-sqrt(2*Pi)*t)*sin(t^2), t=0..infinity ); 1/2 1/2 1/2 1/2 1/4 2 Pi - 1/2 2 Pi FresnelS(1) > int( exp(-t)/t^(1/3), t=1..infinity ); GAMMA(2/3, 1) > int( exp(-t)*ln(t)/t, t=1..infinity ); MeijerG(3, 0, 1) > int( exp(-t)*ln(t)/t^(1/2), t=1..infinity ); MeijerG(3, 1/2, 1) Maple can do some cases where the denominator of R(t) is of the form 1-exp(-v*t^s), e.g. New Maple Features Since Version 4.2 page 39 ======================================================================== > int( exp(-t)*t^2/(1-exp(-2*t)), t=0..infinity ); 7/4 Zeta(3) And also a few cases where R(t) includes an error function, e.g. > int( t*exp(-t^2)*erf(2*t+1), t=0..infinity ); 1/2 1/2 1/2 erf(1) + 1/5 exp(-1/5) erfc(2/5 5 ) 5 > int( ln(2*t^2)*erf(t/2)/t^(3/2), t=0..infinity ); 1/2 1/2 1/2 ln(2) Pi Pi Pi Psi(1/4) 6 ----------- + 8 ---------- + 2 -------------- GAMMA(3/4) GAMMA(3/4) GAMMA(3/4) The derivative operator D: The D operator has been extended to handle partial derivatives. The notation D[i](f) means the derivative of f with respect to the i'th argument. The chain rule is applied and by default and it is assumed that partial derivatives commute. Examples: > g := (x,y) -> sin(x+cos(y)): > D[1](g); (x,y) -> cos(x + cos(y)) > D[1,2](g); (x,y) -> sin(x + cos(y)) sin(y) Consequently the mtaylor function (for multivariate Taylor series) will now expand an unknown function of more than one argument, e.g. > mtaylor(f(x,y),[x=0,y=0],3); 2 f(0, 0) + D[1](f)(0, 0) x + D[2](f)(0, 0) y + 1/2 D[1, 1](f)(0, 0) x 2 + D[1, 2](f)(0, 0) x y + 1/2 D[2, 2](f)(0, 0) y Enhanced limit and series facilities: Asymptotic series have been extended to allow exponential terms to appear in the resulting series. Example: > asympt( Psi(2*exp(x))-x, x, 4 ); 1 1 1 ln(2) - -------- - ---------- + O(-------) 4 exp(x) 2 4 48 exp(x) exp(x) New Maple Features Since Version 4.2 page 40 ======================================================================== > limit( Psi(2*exp(x))-x, x=infinity ); ln(2) Series expansions for erfc(x), GAMMA(a,x) for a > 0, and MeijerG(a,b,x) for a > 1, a an integer have been added. Also asymptotic expansions for the GAMMA and binomial functions have been added. Examples: > asympt( GAMMA(x)*Ei(x)/x^x/sqrt(2*Pi), x ); 1 13 601 319721 60973877 1 ---- + ------- + -------- + ---------- + ------------- + O(-----) 3/2 5/2 7/2 9/2 11/2 13/2 x 12 x 288 x 51840 x 2488320 x x # An indefinite summation using Gosper's algorithm > s := sum( binomial(2*n,n)/(n+1)/(2^n)^2, n ); binomial(2 n, n) s := - 1/2 ---------------- (n - 1) 2 (2 ) > asympt(s,n,3); 2 1 1 1 - ---------- + ------------ - ------------- + O(----) 1/2 1/2 1/2 3/2 1/2 5/2 7/2 Pi n 4 Pi n 64 Pi n n # Hence since s = -2 at n = 0, we have > sum( binomial(2*n,n)/(n+1)/(2^n)^2, n=0..infinity ); 2 Definite sums and products over roots of polynomials: Let alpha denote the set of roots of the polynomial a(x). In Maple, the roots of a(x) are expressed as RootOf( a(x), x ). Let sum(f(k),k=alpha) mean the sum of f over the roots of a(x). Likewise let product(f(i),k=alpha) be the product of f over the roots of a(x). Then Maple can evaluate such sums and products when f is a polynomial or rational function in k, e.g. > alpha := RootOf(x^5+x+11,x): > sum( 1/(k^2+1), k=alpha ); 35/57 > product( k^2+1, k=alpha ); 1/171 New Maple Features Since Version 4.2 page 41 ======================================================================== Polynomial factorization and root finding: The factor command now accepts an additional argument, an algebraic extension which specifies an algebraic number field over which the polynomial is to be factored. The extension can be specified as a single RootOf or radical, or in the case of multiple extensions, a list or set of such. Example: factor the polynomial y^4+2 over Q(sqrt(2)) > factor(y^4-2,sqrt(2)); 2 1/2 2 1/2 (y + 2 ) (y - 2 ) > alias(alpha = RootOf(x^2-2)); > factor(y^4-2,alpha); 2 2 (y + alpha) (y - alpha) An algebraic extension can also be given to the roots and irreduc func- tions. Similarly for finite fields (see below). Arithmetic over finite fields (Galois fields): A special representation for univariate polynomials over finite fields defined by a single alge- braic extension over Z mod p has been implemented. The new facility includes support for computing polynomial gcd's, factorization and root finding. It is accessed via the mod function. Example: factor the polynomial x^6+x^5+x^4+x^3+1 over GF(2) then GF(4) > f := x^6+x^5+x^4+x^3+1: > Factor(f) mod 2; 2 4 (x + x + 1) (x + x + 1) > alias(alpha=RootOf(x^2+x+1)): > Factor(f,alpha) mod 2; 2 2 (x + alpha) (x + x + alpha + 1) (x + alpha + 1) (x + x + alpha) An algebraic extension can also be given to the Roots and Irreduc func- tions, e.g. > Roots(f,alpha) mod 2; [[alpha, 1], [alpha + 1, 1]] Future work will see the functionality extended to multivariate polyno- mials and/or over finite fields defined by multiple algebraic exten- sions. New Maple Features Since Version 4.2 page 42 ======================================================================== Transforms: The Mellin, Z, and discrete fast Fourier transforms have been added to the library. The Mellin transform of f(t) is g(s) = int( f(t)*t^(s-1), t=0..infinity ) The Z transform for f(n) is g(z) = sum( f(n)/z^n, n=0..infinity ) The discrete Fourier transform of a complex vector $z$ is the vector [ sum( exp(-2*Pi*j*k*I/n )*z[k], k=0..n-1) for j=0..n-1 ] The Laplace transform package has been taught about Bessel functions. New library functions ellipsoid: surface area of an ellipsoid evalr: evaluation over a range(s) fnormal: floating point normalization galois: computes the galois group of a (univariate) polynomial (up to degree 7) history: a history mechanism (an alternative to Maple "'s) iratrecon: rational reconstruction mellin: mellin transform poisson: poisson series expansion irreduc: irreducibility test of a (multivariate) polynomial roots: computes the roots of a (univariate) polynomial shake: real interval arithmetic (to Digits precision) sturm: use the Sturm sequence to find the number of real roots in an interval sturmseq: compute the Sturm sequence of a polynomial over Q or R thiele: continued fraction interpolation userinfo: generate user information ztrans, invztrans: the Z-transform and it's inverse C: Maple to C language translator FFT: Fast Fourier transform Hermite: computes the Hermite normal form of a matrix over a finite field Irreduc: irreducibility test of a (univariate) polynomial mod p MOLS: generates mutually orthogonal Latin squares Nullspace: computes the nullspace of a matrix over a finite field Primitive: tests if a univariate polynomial over a finite field is primitive Randpoly: random univariate polynomial of degree k mod p Randprime: random monic irreducible univariate polynomial of degree k mod p Smith: computes the Smith normal form of a matrix over a finite field New Maple Features Since Version 4.2 page 43 ======================================================================== New library packages 1. bianchi (3-d Lie algebra classification package) 2. cartan (special-purpose relativity tensor package -- Cartan's for- malism) 3. debever (special-purpose relativity tensor package -- Debever's for- malism) 4. finance (amortization and Black Scholes stock call option pricing) 5. geom3d (3-d geometry package) 6. heap (priority queue data structure) 7. liesymm: (Lie symmetries package -- obtains the determining equa- tions for the Lie symmetries of a system of partial differen- tial equations) 8. logic (boolean algebra package) 9. oframe (orthonormal frame package using the Ellis-MacCallum formal- ism) 10. petrov (Weyl tensor classification package) 11. plots (2-d and 3-d special plots package) 12. tensor (relativity tensor package) New functionality in library packages linalg (linear algebra package): backsub -- back substitution in an augmented triangular matrix companion -- constructs the companion matrix for a monic polynomial concat -- concatenate matrices and/or column vectors together ffgausselim -- "fraction-free" Gaussian elimination gausselim -- changed to do "ordinary Gaussian elimination" over a field GramSchmidt -- Gram-Schmidt orthogonalization innerprod -- the inner product of a sequence of matrices and vectors JordanBlock -- constructs a Jordan block matrix linsolve -- extended to solve A*X = B where B is a matrix matrix -- utility routine for creating a matrix minor -- utility routine for picking off the i,j'th minor of a matrix randmatrix -- utility routine to generate matrices with random entries pivot -- do one row elimination step on a matrix stack -- stack matrices and/or row vectors on top of each other vector -- utility routine for creating a vector rank, rowspace, colspace -- generalized to work for rational functions New Maple Features Since Version 4.2 page 44 ======================================================================== eigenvects -- has been modified to return a sequence of lists of the form [e[i],m[i],{v[i,1],...,v[i,n[i]]}] where e[i] is the eigenvalue, m[i] it's multiplicity, and {v[i,1], ..., v[i,n[i]]} a set of vectors for the basis for the eigenspace of e[i]. It has also been generalized to work for a matrix over any algebraic number field. combinat (combinatorial functions package): character -- character table for Sn the symmetric group on n letters cartprod -- iterator for the cartesian product of two lists fibonacci -- extended to compute the fibonacci polynomials F[n](x) numbcomb -- replaces combinations (computes the number of combinations) numbpart -- replaces partitions (computes the number of partitions) numbperm -- replaces permutations (computes the number of permutations) randcomb -- generate a random combination of m objects from s objects randpart -- generate a random partition of and integer subsets -- iterator for a powerset (iterates over the subsets of a set) vectoint, inttovec -- bijection of the monomials represented as exponent vectors using the total degree reverse lexicographical ordering with the non-negative integers numtheory (number theory package): mipolys(n,p,k) -- computes the number of monic irreducible polynomials of degree n over a finite field with p^k elements sigma -- now accepts a subscript sigma[k](n) and computes the sum of the kth powers of divisors order(n,m) -- solves n^k == 1 mod m for the first integer k > 0 stats (statistics package): Added random variate generators for the following distributions: RandUniform(a..b): Uniform distribution on [a,b) RandNormal(u,s): Normal distribution with mean u, standard deviation s RandExponential(l): Exponential distribution with mean l RandGamma(a): Gamma distribution of order a RandBeta(a,b): Beta distribution of order a and b RandChiSquare(v): X-square distribution with v degrees of freedom RandFdist(v1,v2): F-distribution with v1 and v2 degrees of freedom New and enhanced system facilities Type testing in Maple V: In Maple version 4.3, we extended the notion of a "type" to include "structured" types. A structured type is a Maple expression that describes the type of a composite object. The type "set" specifies a set, but not the type of the objects in the set. The type set(`=`) however specifies a set of equations. And the type set(name=algebraic)) specifies a set of equations whose left hand sides New Maple Features Since Version 4.2 page 45 ======================================================================== are (variable) names, and whose right hand sides are algebraic expres- sions. In Maple V, all types are now structured types. The old polyno- mial type test type( p, polynom, [x,y], rational ) which tests if p is a polynomial in x and y with rational coefficients becomes type( p, polynom(rational,[x,y]) ) Because all types are now single objects, one can describe the type of arbitrarily complex objects very concisely. For example, the type matrix( polynom(algnum), square ) specifies a square matrix whose entries are polynomials (in any number of variables) over an algebraic number field, and the type [ exp(anything}, {name,name=constant..constant} ] specifies a list of exactly two objects, the first an exponential (of any type), the second either a variable name, or an equation of the form indicated -- the set brackets denote alternation. For a more detailed description see type[structure]. Debugging facilities: On an ERROR condition, if printlevel is higher than 1 the statement being executed and the values of the local vari- ables are all printed. Sequences and for loops: A new "seq" operator (for constructing sequences) has been added to the language. It has the same evaluation semantics as the Maple for loop and as such should be easier to use and understand than the $ operator which it will eventually replace. There are two versions, modelled on the two kinds of for loops as indicated by the comments below. > s := seq( bernoulli(i), i=1..10 ); # for i to 10 do bernoulli(i) od; s := -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30, 0, 5/66 > seq( abs(x), x=s ); # for x in s do abs(x) od; 1/2, 1/6, 0, 1/30, 0, 1/42, 0, 1/30, 0, 5/66 Table and array entries: Arrays and tables can now be descended (picked apart) using the "op" function. Hence the only objects in Maple now which cannot be descended are procedures. In addition to the indices function (which computes a sequence of a tables indices (keys)) the entries function computes a sequence of a tables entries. Example: > t := table([red = rot, blue = blau, yellow = gelb, grey = grau]): > indices(t); [blue], [yellow], [grey], [red] > entries(t); [blau], [gelb], [grau], [rot] New Maple Features Since Version 4.2 page 46 ======================================================================== > op(op(t)); [blue = blau, yellow = gelb, grey = grau, red = rot] Procedure execution: This version includes a new implementation of non- local goto's (as generated by ERROR, RETURN, interrupts and system errors). The new implementation results in a lower overhead for proce- dure invocation. Simple procedure calls execute 4 times faster in Maple V. Language translation facilities: The library routine C translates Maple expressions and arrays into C code. There is an optional code optimiza- tion facility. The library routine fortran has been fixed to break up expressions which exceed the 19 line continuation limit of Fortran. The library routine latex for typesetting Maple output in TeX now handles products, composition, vectors, tables and some operators. The library routine eqn for troff output now handles products and operators. Algorithmic improvements Polynomial gcd's: Univariate polynomial gcd's over the integers are now computed using the following modular method. For n word size prime mod- uli p[1], ..., p[n], the gcd is computed over Z/(p[k]) efficiently using in-place machine arithmetic. The n modular gcd's are then combined by application of the Chinese remainder theorem. This new method is an order of magnitude more efficient for large problems. This improves the performance of arithmetic in Q(x). Polynomial resultants: Bivariate polynomial resultants over the inte- gers are now computed using using the following modular method. For n word size prime moduli p[1], ..., p[n], the resultant is computed in Z/(p[k])[x,y], and these images are combined using the Chinese remainder theorem. Each resultant calculation in Z/(p)[x,y] is reduced to d resultant calculations in Z/(p)[x] by polynomial evaluation and interpo- lation. This method (due to George Collins) gives better performance for polynomials of large degree. Arbitrary precision floating point arithmetic: A routine for evaluating hypergeometric functions to arbitrary precision has been added to the kernel. Since an elementary function can be expressed as a hypergeome- tric function, this routine is used to evaluate elementary functions as well. The time to compute sin(1) and ln(3) to 1000 digits, for example, is reduced from 70 to 26 and 120 to 8 seconds respectively on a Sun 3/280 computer. New Maple Features Since Version 4.2 page 47 ======================================================================== Computation of Pi: Maple is now using the Chudnovsky's formula for com- puting Pi to high precision. Their formula is infinity ----- 1 6541681608 \ ( 13591409 ) (6*k)! (-1)^k --- = -------------- ) (----------- + k) -------------- ------------- Pi 640320^(3/2) / ( 545140134 ) (3*k)!*(k!)^3 640320^(3*k) ----- k = 0 To implement this formula, the series has been expressed as a 4, 3 argu- ment hypergeometric function which is computed using the routine men- tioned in point 3 above. This method is about 30% faster in Maple than the previous method (a similar formula due to Ramanujan). Integration of rational functions: Integration of rational functions now returns a sum of logarithms over the roots of a polynomial a(x) of smallest possible degree in the form sum( f(alpha)*log(x+g(alpha)), alpha=RootOf(a(x)) ) The resulting sum, if evaluated in floating point, will be expressed as an explicit sum of logarithms over the complex roots of alpha. The above can also be manipulated as a function of x, i.e. differentiated, expanded as a series in x etc. The new form is much more concise and usable than the old technology which produced a "mess" of nested radi- cals. Polynomial root finding over finite rings: The Roots function has been extended to work for a composite modulus n. The roots are computed mod each prime factor of n then lifted using padic lifting and combined by application of the Chinese remainder theorem. The result returned is a list of the roots and their multiplicities. Example: find the roots of the polynomial x^2 mod 72 > Roots(x^2) mod 72; [[36, 2], [24, 1], [12, 1], [60, 1], [0, 2], [48, 1]] Miscellaneous changes - Maple no longer has two representations for the complex unit i . The unique representation is (-1)^(1/2) and the symbol I is initially an alias for (-1)^(1/2). - Radical powers of rationals are now automatically reduced, e.g. > (2/3)^(-3/2); 1/2 1/2 3/4 3 2 New Maple Features Since Version 4.2 page 48 ======================================================================== - Different radicals are no longer automatically combined so as to preserve a canonical form. The combine function can be used to com- bine radicals except the imaginary constant I, e.g. > a := I+2^(1/2)+3^(1/2): > a := expand(a^2); 1/2 1/2 1/2 1/2 a := 4 + 2 I 2 + 2 I 3 + 2 2 3 > combine(a,power); 1/2 1/2 1/2 4 + 2 I 2 + 2 I 3 + 2 6 - The library routine userinfo can be used to generate user information messages for a function during the course of a computation. In future versions of Maple, this facility will be exploited in the Maple library to generate information about what Maple is doing. - The library routine log has been extended to allow for different bas- es. The syntax is log[b](x) meaning log base b of x. - The mtaylor function (multivariate taylor series) now returns a Maple sum of products and accepts integral weights for the variables. - Addition of norm and trace operations to GF (Galois Field package) - Addition of Bessels equation to dsolve. - The solve command for solving systems of equations now accepts an additional argument "split" which directs solve to try to split a sys- tem into one or more simpler systems using factorization at every step. - The coeff function has been extended to understand coeff(p,x^n) for n<>0 to be equivalent to coeff(p,x,n) meaning the coefficient of x^n in p. - The alias and macro facilities no longer affect parameters and locals. I.e. one can have an alias I and a local variable I simultaneously. Also, alias now will return a sequence of all current alias's. - The POINT option in the 2-dimensional plotting has been improved to print crosses + instead of dots. - Map map's onto named arrays and tables, e.g. map(simplify,A); i.e sim- plify each entry in the array - All entries of an antisymmetric array can now be assigned. - Saving procedures in src format inserts back-quotes where necessary. - Since the neutral operator &* is being used for matrix multiplication it has been given the same precedence as * (multiplication) - New Iris variable "endcolon" returns true iff the last statement was terminated with a colon (instead of a semi-colon). - These functions that previously existed are now readlib defined: all- values, compoly, discrim, eqn, fortran, latex, norm, plot3d, select. - The semantics of the read statement inside a Maple procedure has changed from stacking the input to reading and executing the input immediately. - The rsolve function now takes an optional directive "ztrans" to solve recurrences or systems of recurrence equations using Z transforms. New Maple Features Since Version 4.2 page 49 ======================================================================== - The rsolve function can now solve a large class of 1st order equations and more complicated nonhomogeneous linear equations, e.g. > rsolve( {y(n) = n*y(n-1) + (n-1)!, y(0) = 1}, y(n) ); GAMMA(n + 1) (Psi(n + 1) + gamma + 1) - The isolve function (for integer solutions to equations) can now solve a single equation of Pythagorean type, i.e. a x^2 + b y^2 + c z^2 = 0 . where a, b, c are integers. In the example below, the % labels stand for repeated common subexpressions, and _N1, _N2, _N3 stand for arbitrary integers. > isolve(2*x^2-7*y^2+5*z^2); _N3 %1 _N3 %3 _N3 %2 {z = ----------------, x = ----------------, y = ----------------} igcd(%1, %2, %3) igcd(%1, %2, %3) igcd(%1, %2, %3) 2 2 %1 := - 5 _N1 - 4 _N1 _N2 + 2 _N2 2 2 %2 := 5 _N1 + 2 _N2 2 2 %3 := 5 _N1 - 10 _N1 _N2 - 2 _N2 - The rules for last-name evaluation have changed. Recall that the pur- pose of last-name evaluation is to allow vectors, matrices and arrays to have one (or more) as yet undefined entries, e.g. > A := array(1..2,1..2): > linalg[det](A); A[1, 1] A[2, 2] - A[1, 2] A[2, 1] > A; A > op(A); [ ?[1, 1] ?[1, 2] ] [ ] [ ?[2, 1] ?[2, 2] ] In Maple V this has been extended to subscripted names e.g. replace A by t[1] in the above. > t[1] := array(1..2,1..2): > linalg[det](t[1]); t[1][1, 1] t[1][2, 2] - t[1][1, 2] t[1][2, 1] New Maple Features Since Version 4.2 page 50 ======================================================================== However, to access the array object one cannot use op, since op(t[1]); would then yield 1, the index. The way to access the array object now is to use the eval function, e.g . > eval(t[1]); [ ?[1, 1] ?[1, 2] ] [ ] [ ?[2, 1] ?[2, 2] ] Finally, a reminder not to make the following mistake. # Interchange matrices A and B t := A; A := B; B := t; If A and B are assigned arrays, tables or procedures, one must write t := eval(A); A := eval(B); B := eval(t); New Features in Maple for Version 4.3 Development of improved user interfaces The user interface, known as Iris, is programmed separately from the Maple "algebra engine". Availability of particular features is workstation-dependent. All implementations of Maple include a new ver- sion of the pretty-printer (see below) and a new lexical scanner. The lexical scanner now provides improved error messages, with a caret sym- bol pointing to the most likely place where a syntax error has occurred and the line number at which it occurred is also specified (for input from a file). Versions of Iris which exploit workstation features such as windows, mouse selection, session history, and editing have been developed. An Iris facility with these advanced features is available for the Macin- tosh and will soon be released for X-Windows and SunView. 3-D plotting A 3-D plotting facility has been developed. Availability of this facil- ity is workstation-dependent. The 3-D plotting facility will soon be released for X-Windows, SunView, and the Macintosh. Both 2-D and 3-D plotting exploit the new `evalhf` function (see below) to achieve improved efficiency of point generation. New Maple Features Since Version 4.2 page 51 ======================================================================== New prettyprinter The generic Iris facility available on all host systems now uses a new prettyprinter. The new prettyprinter supports the following: 1) break on interrupt -- the new prettyprinter is interruptible; 2) prettyprinting of Maple procedures; 3) columns of matrices are aligned where possible; 4) automatic labelling of common subexpressions in large output as %1, %2, ... ; 5) the labelled subexpressions can be used for subsequent input. Improved help facility The help facility has been improved so that the information is displayed one screenfull at a time, when such a facility is supported by the host system. In addition, when the help system fails to find information for the word specified, a list of "nearby names" is displayed. The defini- tion of "nearby names" is all names known to help which match the given name in the first three characters. For example, help(f) will display all names known to help which begin with the letter f. A facility to generate examples of Maple expressions is also available. Macro and alias facilities A macro facility and an alias facility provide the user with a mechanism for macros and abbreviations, respectively. For example, a user may state: alias(J=BesselJ); This allows the user to use the abbreviation J on input, Maple receives the value BesselJ which it understands, and the abbreviation J will be used on output. Rule-based facility for function definition A new facility allows functions to be defined via the specification of a sequence of rules which will be applied based on pattern and type match- ing. For example, the following defines a linear operator: define( L, forall( [x,y], L(x+y) = L(x)+L(y) ), forall( [constant(n),x], L(n*x) = n*L(x) ) ); Operators may also be defined in terms of properties such as commuta- tive, associative, antisymmetric, etc. See help(define) and its subtop- ics. New Maple Features Since Version 4.2 page 52 ======================================================================== Internal support for polynomials over the integers modulo n An internal routine called 'modp1' provides support for arithmetic in Zn[x], i.e. univariate polynomials over the integers modulo n. Modp1 greatly enhances the performance of many operations including greatest common divisors, resultants, and factorization of univariate polynomials over the integers. Modp1 is designed to compute with both small primes (word-size primes) and large primes. All the basic arithmetic opera- tions are supported including Quo, Rem, Eval, Interp, Gcd, Gcdex, Resul- tant, Discrim, Irreduc, Roots, and Factors. Modp1 also makes possible an efficient implementation of Galois fields (see GF and evalgf). Hardware floating-point evaluation A new function 'evalhf' is available. Like 'evalf' its purpose is to evaluate an expression in floating-point mode but the new function eval- uates using the hardware floating-point capabilities (if available) of the host system. In particular, it uses the fixed-precision numerical accuracy of the "double precision" hardware floats. The argument may be an expression involving the invocation of built-in functions or Maple procedures but all data must evaluate to numeric values (unlike evalf which allows mixed symbolic and numeric data). Evalhf achieves much faster numeric evaluation than evalf which uses a software floating- point facility. Numerical computation facilities The numerical integration facility `evalf/int` exploits the new evalhf function to achieve improved speed of execution (at moderate precision requirements). There have also been functionality improvements in singularity-handling and infinite-range capabilities. The inert func- tion name Int is known to evalf and therefore the invocation evalf(Int(f,x)) can be used to apply numerical integration without first invoking symbolic integration. New numerical computation facilities include Eigenvals (eigenvalue compu- tation) and Svd (singular value decomposition). The floating- point solver (fsolve) has been enhanced to handle a wider class of prob- lems, including the computation of all complex roots of a polynomial. New mathematical functions and constants known to Maple - the Bessel functions BesselJ, BesselY, BesselI, BesselK - the Beta function Beta - the generalized Gamma constants gamma(1), gamma(2), ... (replacing the former notation gamma1, gamma2, ...) - the Fresnel integrals C and S have been renamed FresnelC and FresnelS New Maple Features Since Version 4.2 page 53 ======================================================================== - the evalf knowledge of the Psi function has been enhanced to handle the n-th derivative Psi(n,x) - the incomplete GAMMA function GAMMA(a,x) = int( exp(-t)*t^(a-1), t = x..infinity) Enhanced integration facilities The Risch integration algorithm now handles some cases of radical func- tions. The Risch-Norman method is now applied prior to the standard Risch algorithm, providing a fast heuristic method which deals with tri- gonometric functions in real form rather than in complex exponential form. New capabilities for definite integration have been added, particularly for infinite ranges when the integrand involves exponential, logarith- mic, and trigonometric functions. New simplification routines A facility for simplification with respect to side relations (rewrite rules) has been installed. For example, e := -1/3*x^5*y + x^4*y^2 + 1/3*x*y^3 + 1; simplify( e, {x^3 = x*y, y^2 = x+1} ); causes the rewrite rules (specified as a set of equations) to be applied to the expression e via an algorithm which uses a Grobner basis, result- ing in the simplified expression: x^2*y + x^2 + x + 1 . See help(simplify,siderels) for further information. The following special functions are now known to simplify -- see help(simplify) for the complete list of simplification procedures: BesselJ,BesselY Bessel functions BesselI,BesselK Modified Bessel functions Ei Exponential integral dilog Dilogarithm function Other simplification enhancements: - simplify/GAMMA extended; it now knows Gauss's multiplication for- mula, the reflection formula, and it handles quotients of GAMMA func- tions - simplify/power now does a^x*(-a)^y ==> (-1)^y*a^(x+y) - simplify/hypergeom now includes all summation theorems given in Appendix III of L.J.Slater's Generalized Hypergeometric Functions New Maple Features Since Version 4.2 page 54 ======================================================================== - simplify(..,infinity) simplifies expressions which contain infin- ity when there are no ambiguities Combine function The new function "combine" provides another class of transformations which are a form of simplification. Its purpose is to combine terms of specific forms, in a sense which is generally the inverse of expand. It handles trigonometric functions, exponentials, logarithms, powers, lim- its, sums, and integrals. For example: combine( sin(x)*cos(x), trig ); ==> 1/2*sin(2*x) expand( 1/2*sin(2*x) ); ==> sin(x)*cos(x) New features of fsolve - incorporation of the option "complex" to compute complex roots of polynomials - new options and new formats (ranges can use "infinity" now, and a single range is used for all variables) - a new algorithm for a Newton iteration on systems of equations - a new algorithm for systems of equations based on reducing the sys- tem (with the symbolic solver) for all the "simple" substitutions, and then solving numerically for what is left - a new algorithm for polynomials works in three stages: a heuristic method based on a Newton-type iteration complemented with bisection, a complex Newton iteration to find complex quadratic factors, and a routine for refining the roots found; the refinement of roots is done for each root over the original polynomial before deflating and hence relative errors should be significantly reduced - for scalar equations, the scalar zero finder has been made faster by recognizing the case of slow convergence and accelerating the steps in such a case. Type expressions and structured types The notion of a type (as defined by the type function) has been extended to include "structured types". A structured type is a Maple expression which is interpreted as a composite type; for example, list(algebraic), name=integer..integer . Structured types allow for more concise and complete argument checking and type analysis. For example, type( expr, name=algebraic..algebraic ); returns true iff expr is an equation whose left-hand side is a name and whose right-hand side is a range of algebraic's. See help(type,structured) for details. Additionally, the following new types are known: type/RootOf a RootOf expression type/anything matches any type type/even an even integer New Maple Features Since Version 4.2 page 55 ======================================================================== type/odd an odd integer type/negative a negative number type/nonneg a nonnegative number type/positive a positive number type/square a perfect square type/type a valid Maple type expression The interface function The interface function allows one to set or inquire about values relat- ing to the user interface. This provides a unique mechanism for commu- nication between the Iris interface and the Maple "algebra engine". The variables relating to the interface are: variable type/value description ============================================================================= echo 0,1,2,3,4 for echoing of input indentamount integer indentation for multiline expressions/procedures labelling true/false labelling of expressions on output labelwidth integer minimum size to be labelled prettyprint true/false for two dimensional output printfile string system command for displaying a file prompt string user prompt quiet true/false suppress auxiliary printing screenheight integer screen height in characters screenwidth integer screen width in characters plotdevice string name of the plotting device plotoutput string file name for plot output preplot list(integer) terminal escape sequence postplot list(integer) terminal escape sequence terminal string terminal setup for plotting verboseproc 0,1,2 controls printing of procedure bodies version string name of the interface expand( 1/2*sin(2*x) ); ==> sin(x)*cos(x) Miscellaneous new features in version 4.3 - series expansion of unknown functions now uses the D operator - enhanced computation of generalized series, particularly for the case of trigonometric functions with non-analytic function arguments - asymptotic series with respect to expressions other than names; e.g. asympt( sin(1/ln(n)), ln(n) ) - gcd now has special code for the case of a very small against a very large argument; it factors