
     New features that have been added for Maple V Release 2
     -------------------------------------------------------

Development of Improved User Interfaces
=======================================

New user interfaces for Maple which include as a minimum 3-dimensional graphics,
and some command line editing facility have been designed since the release of
Maple V.  The new user interfaces for Release 2 will include worksheets, output
real mathematical expressions, and an interactive help browser.

1: Maple worksheets
-------------------
Beginning with the Macintosh user interface for Maple V, the new user
interfaces 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 2.
They provide editable input and text fields, simple commands for re-executing
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.

2: Two-dimensional output
-------------------------
Beginning with Release 2 of the X Window interface, new interfaces will
display output using mathematical, Greek, and italics fonts, with proper
subscripts and superscripts for improved display of mathematical expressions.

3: Unix Maple interface
-----------------------
This interface now supports command line editing using a vi - emacs like editor.
Hitting the interrupt key, Ctrl-C, twice will no longer 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.

4: 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.  Hardcopy output (PostScript) is available for
worksheets including output of mathematical expressions.  Input, text and output
fonts can be set interactively.

5: Help topic browser
---------------------
All Release 2 user interfaces will include a help browser for accessing
the on-line help information.

6: Improved error messages
--------------------------
The new type checking facility results in better 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.

6: On-line tutorial
-------------------

An on-line introductory tutorial has been added for Release 2.  For more
information see ?tutorial .  Note you can write your own tutorial using the
readline, parse and printf commands.



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 contains the points, which then is displayed by
the user interface.  The 3 dimensional 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

1: 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
   color assigned individually.
- a wider choice of colors, with more user control of surface coloring
   (PLOT3D).
- addition of Lighting models
- the PLOT and PLOT3D data structures are now compatible.

2: Device support
-----------------
- encapsulated PostScript, color PostScript and grayscale shading PostScript
  output are now supported
- addition of HP Laserjet output
- a wider selection of output devices for PLOT3D are supported in particular
   any device that is supported in 2 dimensions including tektronics, i300
   imagen laser printer, Unix plot, DEC ln03 laser printer etc.

3: 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 with odeplot
- Plotting of polygons and polyhedra
- Log and log-log plots
- Phase portraits and direction field plots, plotting of 1st order and
   2nd order differential equations (in DEtools package)
- Ability to specify color function for objects in plot3d, tubeplot,
   vectorfield and gradient plots, etc.


New and Enhanced Mathematical Facilities
========================================

1: New mathematical functions known to Maple
--------------------------------------------
- The floor and ceiling functions floor(x) and ceil(x)
- The Elliptic integrals where 0<k<1 and c = sqrt(1-k^2)
  LegendreE(x,k) = int( (1-k^2*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..x )
  LegendreEc(k) = int( (1-k^2*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..1 )
  LegendreEc1(k) = int( (1-k^2*t^2)/sqrt(1-t^2)/sqrt(1-c^2*t^2), t=0..1 )
  LegendreF(x,k) = int( 1/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..x )
  LegendreKc(k) = int( 1/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..1 )
  LegendreKc1(k) = int( 1/sqrt(1-t^2)/sqrt(1-c^2*t^2), t=0..1 )
  LegendrePi(x,k,a) = int( 1/(1-a*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..x )
  LegendrePic(k,a) = int( 1/(1-a*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..1 )
  LegendrePic1(k,a) = int( 1/(1-a*t^2)/sqrt(1-t^2)/sqrt(1-c^2*t^2), t=0..1 )
- Routines for complex numbers Re(z), Im(z), argument(z), conjugate(z), csgn(z)
- Routines for computing the magnitude of a number ilog[b](x), ilog10(x)
- Utility routine polar(z) to allow computing with complex numbers in polar
   form i.e. polar(a,b) = a \cos (b) + i a \sin (b)
- The logarithmic integral Li(x) = Ei(ln(x)) for x > 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 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" notation
   in Abramowitz & Stegun 
- The derivatives of signum, csgn, trunc, frac, round, floor, ceil implemented
   as signum(1,x), csgn(1,x) etc.

2: 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 ulps.
- the Remez algorithm for minimax rational function approximation
- an adaptive double exponential algorithm for numerical integration
- Levin's u transform for the numerical evaluation of infinite
   sums, products and limits
- The routines gauselim, gaussjord, rowspace, colspace, eigenvals, eigenvects,
  inverse, det, in the linalg package now all handle matrices of
  floating point and complex floating point entries

3: 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, Maple can alos 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 Release 2
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).  Examples in the following sections
illustrate other new capabilities in Maple which use the evala facility for
integration, polynomial factorization, and symbolic eigenvector calculation.
See also the sections on computing with field extensions describing the
functions Norm, Trace, Indep, and Primfield.

4: 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.  Release 2 can factor multivariate polynomials over algebraic number
fields.  For example, let's factor the polynomial x^6+y^6 over the rationals
then over Q(i), the complex rationals.

  > factor(x^6+y^6);
                            2    2    4    2  2    4
                          (x  + y ) (x  - x  y  + y )

  > 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)

Release 2 can also factor multivariate polynomials over algebraic
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 closure 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.

5: Symbolic eigenvalue and eigenvector computation.
---------------------------------------------------
The eigenvector routine 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 ]}],

        [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 rational 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 asks Maple
to express roots of polynomials as exact radicals where possible instead of in
terms of the RootOf representation.

6: ODEs with Bessel and hypergeometric function solutions
---------------------------------------------------------
Many more cases of ordinary differential equations are handled with a better
algorithm, which gives results in terms of Bessel functions rather than
hypergeometric functions.  For example,

> (1-x)*x*diff(y(x),x,x) + (1/3- 23/2*x)*diff(y(x),x) -5*y(x);

                    /   2      \
                    |  d       |                  /  d      \
          (1 - x) x |----- y(x)| + (1/3 - 23/2 x) |---- y(x)| - 5 y(x)
                    |   2      |                  \ dx      /
                    \ dx       /

> dsolve(",y(x));

             y(x) = _C1 hypergeom([1/2, 10], [1/3], x)

                         2/3
                  + _C2 x    hypergeom([7/6, 32/3], [5/3], x)

7: 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

8: New limit algorithm
----------------------
The idea behind the new algorithm is the following: 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));

                       /              1                       \
                f := n |GAMMA(n - --------) - GAMMA(n) + ln(n)|
                       \          GAMMA(n)                    /

  > limit( f, n=infinity );
                                      1/2

9: 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 examples
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   )

10: Norms and traces in algebraic number and function fields
------------------------------------------------------------
Norm(alpha,L,K) and Trace(alpha,L,K) compute the norm and trace of an algebraic
number or function in L over field K.  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

11: Computing with field extensions: Indep, Primfield
-----------------------------------------------------
Indep and Primfield are are tools for computing with nested field extensions.
Indep(L) searches for relations between between the set of field extensions
L.  Primfield(L,K) computes a primitive element alpha for a set of
field extensions L over the subfield K of L, e.g.

  > 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 gives 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.

12: 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, 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 -------
                                                     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

13: 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, and 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]

In the non-homogeneous case, that is, 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
=======================================

1: Dirac and Heaviside
----------------------
Integration now knows about the Heaviside and Dirac functions, e.g.

  > int(f(x)*Dirac(x),x=-infinity..infinity);

                                   f(0)

  > int(f(x)*Heaviside(x),x=-3..4);

                                     4
                                    /
                                   |
                                   |  f(x) dx
                                   |
                                  /
                                  0

2: 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

3: Algebraic functions
----------------------
Integration of algebraic functions now uses the Risch-Trager algorithm.
This includes a full implementation of the algebraic part including integrands
which involve parameters and algebraic numbers, for example

  > 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

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)

4: Integration of the W function
--------------------------------
Indefinite integration now uses an inverse function transformation to
transform integrals involving the W function (where W(x) is the function
defined to satisfy exp(W(x))*W(x)=x) of linear arguments to elementary
defined to satisfy e^{W}(x)} W}(x) = x ) of linear arguments to elementary
functions.  Hence the following integrals are now 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)

5: The exponential integral, error function, and related integrals
------------------------------------------------------------------
Indefinite 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 FresnelS(x),
and the cosine and sine integrals Ci(x) and Si(x).  Note that, Maple V can
do these examples, but the answer involves complex error functions and
exponential integrals of complex arguments

  > 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 )

6: 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, for example

  > 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 assumptions
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
              |
             /
             0

in general results in the confluent hypergeomic function, for example

  > 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 of functions involving the error function can now be handled.
For example, 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

7: 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 discontinuities

  > readlib(discont)(",x);
                                {2 Pi _Z1 + Pi}

A second example showing that Maple can prove that this integral diverges,
instead of returning unevaluated -- meaning Maple cannot do it

  > int(1/x^2,x=-1..1);
                                    infinity

Also, the addition of the CauchyPrincipalValue option to int handles

  > int( 1/x, x=-1..1, CauchyPrincipalValue);

                                       0

  > int( exp(-t)/t, t=-2..infinity, CauchyPrincipalValue );

                                    - Ei(2)


New and Enhanced System Facilities
==================================

1: Type declarations for parameters
-----------------------------------
Procedures accept type declarations as illustrated by the following example.
The purpose of this facility is to encourage better type checking by making
it easy to write and efficient.

    proc( a:t ) 
        ....
    end

is equivalent to writing

    proc(a)
        if nargs > 0 and not type(a,'t') then ERROR(message) fi;
        ....
    end

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

2: D extended to computation sequences and programs
---------------------------------------------------
The D operator can now compute partial derivatives of functions which are
defined as procedures.  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 automatic
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 statements and loops.
For example, given the array of the coefficients of a polynomial b,
we can represent the polynomial as a program in Horner 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;
            sx
        end

3: Program optimization -- optimize extended to procedures
----------------------------------------------------------
The optimize routine has been extended to optimize simple Maple procedures.
Currently it does common subexpression optimization on computation sequences,
i.e. procedures with assignment statements to local variables only, for example

  > 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

4: Multiple libraries -- readlib takes multiple pathnames
---------------------------------------------------------
Maple automatically reads code from the Maple library using the readlib
function.  The global variable libname specifies the location of the Maple
library.  This can now be assigned a sequence of names.  For example, if the
the user assigns

  > libname := dir1, libname, dir3;

then 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.

5: 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.  For example, 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 Release 2 is to insist that the user state the
assumption about a, i.e. that a is real and positive, as follows

  > assume(a>0);

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 particular,
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~

  > 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 integration.
We are presently looking at alternative solutions including prompting the
user for help or returning a solution along with the assumptions made.

6: Automatic complex numeric arithmetic
---------------------------------------
Complex arithmetic in Maple V had to be done with the evalc function.
Now, complex numeric arithmetic is automatic, for example

  > (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

The evalc function is now used only for exact symbolic expansions 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~)

7: 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;

8: 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 scientific
   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 **
 
9: Restart facility
-------------------
The restart statement will clear all user and system variables and
reinitialize the kernel, essentially allowing you to start your Maple
session from scratch without having to exit Maple.

10: 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 and Efficiency Improvements
=======================================

1: Integration of rational functions
------------------------------------
The Trager-Rothstein algorithm computes 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.

  > 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

That is, 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 2 is in handling coefficient fields which are
function fields, and not just number fields.  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.
A second improvement due to Lazard and Trager allows for more efficient
computation of the terms inside the logarithms.  A third improvement by Rioboo
improves the presentation of the result.  An example of the latter is

> f := (x^4-3*x^2+6)/(x^6-5*x^4+5*x^2+4);

                                     4      2
                                    x  - 3 x  + 6
                           f := --------------------
                                 6      4      2
                                x  - 5 x  + 5 x  + 4
> int(f,x);

The Trager-Rothstein algorithm (Maple V) obtains this result

       1/2 I ln(x  + I x  - 3 x - 2 I) - 1/2 I ln(x  - I x  - 3 x + 2 I)

Rioboo's algorithm (Release 2) yields this real result which has no new poles

           arctan(- 3/2 x  + 1/2 x  + 1/2 x) + arctan(x ) + arctan(x)

2: Bivariate polynomial GCDs over Z
------------------------------------
We have implemented the dense modular method of Collins for computing GCDs of
polynomials with in two variables with integer coefficients.  This improves the
efficiency of simplifying rational expressions in two variables.  The method
works by computing many GCDs of polynomials in one 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
polynomials in many variables it is not a good method.  Comparing this with
the default EEZ-GCD 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 the gcd(a*g, b*g).

    n                   10     15      20
    Maple V             65.0   1,877   18,763
    Release 2          10.6   33.7    393.7

3: Factorization over algebraic number fields
---------------------------------------------
We have implemented Lenstra's algorithm for factorization of polynomials over an
algebraic number field.  For some polynomials it runs considerably faster than
the default algorithm.  But it depends very much on the polynomial.

4: 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, and tan use repeated argument
reduction to obtain an O(n^(5/2)) algorithm.  The same idea is now used
by the arctrig functions, e.g.

        Digits    arcsin(Pi/4)                arctan(Pi/4)
              Maple V    Release 2        Maple V    Release 2

         500      25       3.0                 23       2.5
        1000     176      11.0                148      11.2
        2000    1245      50.4               1038      45.2
                 \multicolumn{2}{c|}{ \tan ^{-1} \pi / 4 } \\

5: Optimized the evaluation of numerical arithmetic
---------------------------------------------------
Evaluation of numerical expressions like 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 calculations.
Consider the following two routines 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          Release 2
         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

6: 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 ulps.  We have
also implemented 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 nth Chebyshev polynomial of the first kind which has all real roots.
F(n,x) is the nth Fibonacci polynomial which has all complex roots except 0.
The jump in times indicates where hardware precision is no longer sufficient.

                Maple V                 Release 2
        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

7: Character tables for Sn
--------------------------
In computing the character table for S_n the symmetric group on n letters we
are now making use of the conjugate partitions 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 combinat[character](n)

                Maple V         Release 2
        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
- ceil: ceiling function
- csgn: complex sign
- discont: compute a set of possible discontinuities 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
- makehelp: for making a Maple help page from a file of text
- maxorder: an integral basis for an algebraic number or function field
- Norm: computes the norm of the algebraic number or function
- 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
- tutorial: on-line tutorial facility
- Trace: computes the trace of the algebraic number or function
- 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 packages and modifications to existing packages.

1: numapprox (Numerical Approximation Package)
----------------------------------------------
- pade: computes a Pade rational function approximation
- infnorm: compute the (weighted) infinity norm of an approximation
- minimax: compute a (weighted) minimax numerical approximation
- remez: Remez algorithm for minimax rational function approximation
- chebpade: compute a Chebyshev-Pade rational function approximation
- chebyshev: compute a Chebyhev series numerical approximation
- confracform: convert a rational function to a continued fraction
- hornerform: convert a polynomial or rational function to Horner form

The call minimax(f(x),x=a..b,[m,n],w) uses the Remez algorithm to
compute the best minimax rational function with numerator of degree <= m and
denominator of degree <= n (Note: n can be zero meaning a polynomial) to the
function f(x) on the range [a,b].  The optional 4th paramter w specifies
a weight function (default 1).  For example, here is a [4,3] rational
approximation to erf(x) on [0,3] which we've rounded to 7 decimal digits.
The approximation is accurate to 4 digits on [0,3].

  > evalf(minimax(erf(x),x=0..3,[4,3]), 7);

    - .000088319 + (1.132571 + ( - .4507723 + (.1724417 - .0209750 x) x) x) x
   --------------------------------------------------------------------------
                1. + ( - .3706125 + (.4051100 - .04578747 x) x) x


2: DEtools (Differential Equation Tools Package)
------------------------------------------------
A package for plotting differential equations including systems of ODE's
and some special PDE's, allowing the associated vector field and solution
curves for different initial conditions, to be plotted.
- DEplot: plot a single ODE or a system of first order ODEs
- DEplot1: plot a first order ODE
- DEplot2: plot a system of two first order 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 linear ODEs

3: Gauss
--------
A package which allows one to create "domains" of computation in a similar way
that the AXIOM system allows.  The advantage is that routines for computing
with polynomials, matrices, and series etc. can be parameterized by any
coefficient ring.  For example, 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.

4: GaussInt (Gaussian Integer Package)
--------------------------------------
This is a set of routines for computing 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)

5: 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
- Wronskian: computes the Wronskian matrix

6: 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 polynomial
- kronecker: Diophantine approximation in the inhomogeneous case
- minkowski: Diophantine approximation in the homogeneous case
- nthnumer: returns the denominator of the nth convergent
- nthdenom: returns the numerator of the nth convergent	
- nthconver: returns the nth convergent of a simple continued fraction
- thue: compute the resolutions of Thue equations or Thue inequalities
- sq2factor: factorization in the UFD Z[sqrt(2)]

7: padic (P-adic Number Package)
-------------------------------
A package for computing P-adic approximations 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 )

8: 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: plot of a 2 dimensional vector field, e.g.
   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);
- fieldplot3d: plot of a 3 dimensional vector field, e.g.
   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 function, 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`]});

9: 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.

  > 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.  For example,
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 )


Share Library
=============

1: Contributions from Maple users
---------------------------------
The share library is a repository of applications codes, contributed primarily
by Maple users.  It is distributed with each version of Maple in both src and
Maple ".m" format.  The share library is being reorganized.  Beginning with
this version, it also includes
- TeX/LaTeX introductory documents on using Maple
- TeX/LaTeX support documentation for applications routines
- 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.

2: 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 statement

  > libname := libname, sharename;

Now Maple's readlib command and with command will automatically search the
share library after first searching the Maple library.  If unsuccessful, the
user can locate the share library and set the libname variable 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);
   
                               2
                  .4999999997 t  - .5000000001 t - 1.874999999


Documentation for the code is in the file, i.e. after reading the file, ?fit
will print out a regular Maple style help file.  Note, in many cases,
additional documentation is included in TeX/LaTeX files.
See ?share,contents for a summary of the contents of the share library.

3: 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 periodically,
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.

4: Policy of the contributions to the share library
---------------------------------------------------
The code in the share library has been contributed 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 documentation and
a test file.  Authors will also be asked to sign a non-exclusive agreement to
let us distribute your code, and to change it 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
  - use appendto instead of writeto to append output to a file instead of
    overwriting it
  - both now translate subscripts 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 can cause
     some compilers to break

- Changes to dsolve/numeric
  The output of dsolve({...},{...},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 the point of expansion
  > 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. signum(Pi-4*sin(1));

- the for loop clauses by, to, from and while can now
  appear in any order

- Changes to automatic simplifications
  - 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 > 0 is provable
  - 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 x<0) is being
    fixed for the next version (this 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);

                        1/2 1/2       1/2                  1/2 1/2
              1/2 (2 - 2   )   , 1/4 5    - 1/4, 1/2 (2 - 3   )

- given a file of text, the makehelp function makes a Maple TEXT object out
  of it, i.e. an on-line help page.  I.e. you can make your own help pages
  which can be displayed using the ? command using this.

- Additional simplifications for Dirac and Heaviside, and the arc
  trigonomentric functions are provided through the simplify facility, e.g.
  > simplify( Heaviside(x-1)*Heaviside(x-3) );

                                Heaviside(x - 3)

  > simplify( F(x+3)*Dirac(x) );

                                 F(3) Dirac(x)

  > simplify( arctan(x)+arctan(1/x) );

                                1/2 signum(x) Pi


End of Release 2 notes

