updatesR4/symbolic - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : updatesR4/symbolic

New Symbolic Features That Have Been Added to Maple V for Release 4

 

New and Improved Packages:

New and Improved Functionalities:

Other improvements:

New and Improved Packages:

• 

Integral transforms:

  

The new integral transform package inttrans includes: inttrans[laplace], inttrans[invlaplace], inttrans[mellin], inttrans[fourier], inttrans[invfourier], inttrans[fouriersin], inttrans[fouriercos], inttrans[hankel], inttrans[hilbert].

inttrans[fouriersin](3/(t + a),t,w);

32cosawSsiaw+sinawCiawπ

(1)

assume(a>0);

inttrans[hilbert](exp(I*a*x),x,y);

IⅇIya~

(2)

a := 'a':

  

User defined lookup tables are added to the Fourier and Laplace transforms via routine inttrans[addtable]. Table entries can have an arbitrary number of constant parameters:

with(inttrans):

addtable(mellin,f1(t),F1(s),t,s);

addtable(mellin,f2(t),F2(s),t,s);

inttrans[mellin](t^a*int(x^b*f1(t/x)*f2(x),x=0..infinity),t,s);

F1s+aF2s+a+b+1

(3)
  

Recognition and transformation of general convolution integrals is added to all three transforms:

addtable(mellin,f(t),F(s),t,s);

inttrans[mellin](diff(f(t),t),t,s);

s1Fs1

(4)

inttrans[mellin](int(f(x),x=t..infinity),t,s);

Fs+1s

(5)
  

Functions which are being integrated and differentiated with respect to parameters other than the transform parameter are now simplified using Leibniz and Fubini's theorem.

inttrans[fourier](diff(f(t,u),u),t,s);

fourierdiffft,u,u,t,s

(6)

inttrans[laplace](int(f(t,u),u=a..b),t,s);

intlaplaceft,u,t,s,u=a..b

(7)
  

Transforms can now return multiple integrals, allowing for expressions of the form f(t)/t^n to be transformed for n>1:

inttrans[laplace](f(t)/t^4,t,s);

laplaceftt4,t,s

(8)
  

In many cases, hypergeometric functions are returned where formerly only definite integrals were returned:

inttrans[fourier]((1+I*t)^(-1/2)*(1+2*I*t)^(-3/2),t,w);

2πⅇwwhypergeom32,2,w2Heavisidew2

(9)
• 

DEtools: Differential Equations Tools package

  

There are significant changes over release 3 version. Some new functionalities include:

DEtools[Dchangevar]

handle a variety of substitutions and

 

transformations in DEs.

DEtools[PDEchangecoords]

allow users to change independent

 

variables in a PDE to a new coordinate system.

DEtools[reduceOrder]

either return an ODE of reduced order or

 

solve the ODE explicitly by the method of

 

reduction of order.

DEtools[convertsys]

convert a system of differential equations

 

to a first order system.

DEtools[PDEchangecoords](D[1,2](w)(x,y,z)-D[1](w)(x,y,z), [x,y,z],
cylindrical,[r,phi,theta]);

sinφ2r2cosφ2r2+sinφrD2wr,φ,θ+cosφsinφrcosφD1wr,φ,θcosφsinφD2,2wr,φ,θr2+sinφ2r+cosφ2rD1,2wr,φ,θ+sinφcosφD1,1wr,φ,θ

(10)
• 

combstruct: Combinatorial Structures package

  

The package combstruct is used to define, count and generate combinatorial structures.

  

A combinatorial class is defined by writing a grammar specification that describes it. In this way, an extensive collection of different classes may be defined. For example, the system applies to all regular and context-free grammars, grammars to define binary trees, plane general trees, necklaces, functional graphs, expression trees etc.

with(combstruct):

  

Model alcohol molecules, C_n H_{2n+1} OH.

  

Define the grammar for an alkyl, C_n H_{2n+1}, which is a ternary rooted tree that moves freely in space.

molecule := {alkyl = Union(H, Prod(C, Set(alkyl, card=3))), H=Atom, C=Atom}:

count([alkyl, molecule], size=6+2*6+1);

17

(11)
  

Thus we see that there are 17 different alcohol molecules with 6 carbon atoms. Here is one of them.

draw([alkyl, molecule], size=6+6*2+1);

ProdC,SetProdC,SetProdC,SetProdC,SetH,H,H,ProdC,SetH,H,H,H,H,H,ProdC,SetH,H,H,H

(12)
• 

tensor: Tensor Analysis and General Relativity Computations

  

The tensor package deals with tensors, their operations, and their use in General relativity both in the natural basis and in a rigid moving frame. Some utilities to manipulate tensors are also provided, as well as a mechanism for customizing the way simplification is done in multi-step calculations.

  

Compute the curvature in the natural basis for the Schwarzschild solution:

with(tensor):

g := create([-1,-1], array(1..4, 1..4, symmetric, sparse, [(1,1) = 1-2*M/r,
(2,2) = -1/(1-2*M/r), (3,3) = -r^2, (4,4) = -r^2*sin(theta)^2])):

coord := [t, r, theta, phi]:

`tensor/simp` := proc(a) simplify(a); end:

con_g := invert(g, 'det_g'):

d1_g := d1metric(g, coord):

d2_g := d2metric(d1_g, coord):

Cf1 := Christoffel1(d1_g):

Cf2 := Christoffel2(con_g, Cf1):

Rm := Riemann(con_g, d2_g, Cf1):

Rc := Ricci(con_g, Rm):

  

Display the non-zero independent components of the covariant Riemann and Ricci tensors:

displayGR('Riemann', Rm);

The Riemann Tensor

non-zero components :

R1212=2Mr3

R1313=r+2MMr2

R1414=r+2MMsinθ2r2

R2323=Mr+2M

R2424=Msinθ2r+2M

R3434=2Msinθ2r

character : [-1, -1, -1, -1]

(13)

displayGR('Ricci', Rc);

The Ricci tensor

non-zero components :

None

character : [-1, -1]

(14)
  

Notice that the last result confirms the fact that the Schwarzschild solution is indeed a vacuum solution.

  

Verify the Bianchi identity by computing the covariant derivatives of the Riemann components and anti-symmetrizing them on the last three indices:

D_Rm := cov_diff(Rm, coord, Cf2):

asymm_D_Rm := antisymmetrize(D_Rm, [3,4,5]):

act('display', asymm_D_Rm);

_____________________________________________________

No non-zero independent components.

  CHARACTER :

−1,−1,−1,−1,−1

_____________________________________________________

(15)
  

Since all of the components are zero, the Bianchi identity is verified.

• 

geometry: 2D Euclidean Geometry Package

  

The geometry package is re-designed, and has more functionalities: the conic section is completely implemented, more transformations, graphical visualization is also provided.

with(geometry):

conic(h,9*y^2-4*x^2=36,[x,y]):

detail(h);

GeometryDetailname of the object,h,form of the object,hyperbola2d,center,0,0,foci,0,13,0,13,vertices,0,2,0,2,the asymptotes,y+23x=0,y23x=0,equation of the hyperbola,4x2+9y236=0

(16)

draw(h);

  

Illustration of glide reflection transformation:

circle(c1,[point(o,-3/2,0),1]):

dsegment(AB,[point(A,0,0),point(B,0,2)]):

line(l,[A,B]):

for i from 2 to 10 do
   GlideReflection(c.i,c.(i-1),l,AB)
od:
draw([seq(c.i,i=1..10),l(thickness=2)],filled=true,color=maroon,
printtext=false,scaling=constrained);

Error, (in geometry:-GlideReflection) wrong type of arguments

Error, (in geometry:-draw) unknown geometric object  c

• 

linalg: Linear Algebra Package

  

Matrix decompositions: linalg[cholesky], linalg[LUdecomp], linalg[QRdecomp]

with(linalg):

A := matrix(3,3, [1,2,3,0,0,1,2,3,4]):

linalg[QRdecomp](A, Q='q', rank='r');

58551155055255001

(17)
  

The linalg[hermite] and linalg[smith] functions are faster over polynomials with rational coefficients;  the old algorithm for hermite and smith did not admit polynomial time and complexity bounds.  By contrast, the new algorithms admit good time and space bounds.

  

The linalg[inverse] and linalg[rank] functions are faster over polynomials with integer coefficients.  For an input matrix with dimension n and entries which are degree d polynomials with integer coefficients bounded in length by B bits, the new algorithm for rank and inverse are O(n) faster than the old. In the case where input matrix has full column or row rank, the new algorithm for rank is O(n^2*B^2) faster.

  

The following is a summary of results:

  

Input Matrices:

  

A1: 12x12, entries=randpoly(x,degree=4,terms=3,coeffs=rand(-1000..1000)) A2: 8x8, entries=randpoly(x,degree=5,terms=2,coeffs=rank(-10^20..10^20)) A3: 10x10, entries=randpoly(x) A4: 10x50, entries=randpoly(x) A5: 5x4, entries=randpoly(x)

  

Timing for inverse: (cpu seconds on DEC ALPHA UNIX)

Input matrix

R3

R4

Speedup Factor

A1

247.2

37.8

6.7

A2

373.0

27.1

13.8

A3

75.2

20.2

3.8

  

Timings for rank:

Input matrix

R3

R4

Speedup Factor

A1

13.4

1.2

11.2

A2

13.8

.28

49.3

A3

7.3

.87

8.4

A4

100.3

6.7

15.0

  

Compare the performance of hermite(A5,x) in release 3 and release 4:

Maple V, Release 3, DEC ALPHA UNIX, Apr 22 1994, SerialNumberSerialNumber

bytes used=134300024, alloc=12580608, time=399.87

TTY Iris, Research, DEC ALPHA UNIX, Jun 11, 1995

bytes used=22076000, alloc=3669344, time=11.72

  

Compare the performance of smith(A5,x) in release 3 and release 4:

Maple V, Release 3, DEC ALPHA UNIX, Apr 22 1994, SerialNumberSerialNumber

bytes used=106607176, alloc=12318512, time=350.33

TTY Iris, Research, DEC ALPHA UNIX, Jun 11, 1995

bytes used=3048504, alloc=1703624, time=1.4

• 

LREtools:

  

manipulation and solution of linear recurrence equations The package LREtools is for manipulation and solution of linear recurrence equations.

with(LREtools):

rec:=a(n+2)=-a(n)/(n+1)/(n+2):

REtoDE(rec,a(n),{},f(x));

DESolfD2f,f

(18)

REplot(rec,a(n),{a(0)=1,a(1)=0},0..8);

• 

sumtools:

  

The package sumtools is a collection of routines for computing indefinite and definite sums. The principal routines are Gosper's algorithm for indefinite summation and Zeilberger's algorithm, and extensions to both algorithms.

with(sumtools,[gosper,sumtohyper]):

gosper(1/(k^2-1),k);

k+11+2k2kk21

(19)

sumtohyper(binomial(n,k)^2,k);

hypergeomn,n,1,1

(20)

with(sumtools,extended_gosper):

extended_gosper(pochhammer(b,k/2)/factorial(k/2),k);

kpochhammerb,k22bk2!+k+1pochhammerb,k2+122bk2+12!

(21)
• 

Domains: (previously "Gauss")

  

Quotient fields (both factored normal form FNFQF and expanded normal form ENFQF), Groebner base (GB) are implemented. The routine evaldomains provides a Maple-like user-interface, data-encapsulation and type-checking for the arguments of Domains-functions.

with(Domains):

---------------------- Domains version 1.0 ---------------------
Initially defined domains are Z and Q the integers and rationals
Abbreviations, e.g. DUP for DenseUnivariatePolynomial, also made

C := DUP(Q, x):

R1 := FNFQF(C):

F := (x^2+2*x+1)^2/x:

f1 := R1[Input](F):

R1[Output](R1[Diff](f1));

313+x4+83x3+2x2x2

(22)
  

The following is an example of the interface-routine evaldomains:

Dup := DUP (Zmod(7), x):

  

Create a Dup-evaluator using the alias statement

alias (dup = evaldomains[Dup]):

dup (Rem (-x^7+4*x^3-2, x^3+3*x) * (x^3+x-6));

x4+5x3+x2+6x+5

(23)
  

Note that it is quite clumsy to obtain the same result without evaldomains:

Dup['Output'](Dup[`*`](Dup['Rem'](Dup['Input'](-x^7+4*x^3-2),
Dup['Input'](x^3+3*x)),Dup['Input'](x^3+x-6)));

x4+5x3+x2+6x+5

(24)
  

See Domains.

• 

padic: Package p-adic Expansions of Rational Functions:

  

padic[orderp]: the order of a p-adic expansion of a rational function.

f := (x^3+1)/(x^2+3*x+5):

padic[expansion](f,1/x,x);

p_adic1x,−1,1,−3,4,4,−32,76311x+p_adic1x,−1,1,−3,4,4,−32,76321x2+p_adic1x,−1,1,−3,4,4,−32,76331x3+p_adic1x,−1,1,−3,4,4,−32,76341x4+p_adic1x,−1,1,−3,4,4,−32,76351x5+p_adic1x,−1,1,−3,4,4,−32,76361x6+O1x5

(25)

padic[orderp](f,1/x,x);

−1

(26)
  

padic[lcoeffp]: the leading coefficient of a p-adic expansion of a rational function.

padic[lcoeffp](f,1/x,x);

1

(27)
• 

numtheory: Number Theory Package

  

numtheory[invcfrac]: convert a simple periodic continued fraction expansion to a quadratic surd.

numtheory[cfrac]((31)^(1/2), periodic);

5+11+11+13+15+13+11+11+110+11+11+13+15+13+11+11+110+...

(28)

numtheory[invcfrac] ((28));

31

(29)
  

numtheory[pdexpand]: compute the periodic expansion of a rational number.

numtheory[pdexpand](-83/74);

PDEXPAND−1,1,1,2,1,6

(30)

convert((30),rational);

8374

(31)
  

The routine legendre in previous releases was actually computing the "generalized" quadratic residue (it worked even if the two input arguments are not co-prime). It is now modified to compute the Legendre symbol.

  

A new routine quadres is used to compute the "generalized" quadratic residue.

New and Improved Functionalities:

• 

piecewise:

  

A new implementation of piecewise functions which has significant increase in functionalities. The new piecewise function is built upon a new theory of algebraization of distributions based on being able to compute with normal forms of these distributions.

p:=piecewise(x<0, -1, x>1, 2*x, x^2);

p−1x<02x1<xx2otherwise

(32)
  

support for integration,

int(p,x);

xx0x33x1x2231<x

(33)
  

differentiation,

diff(p,x);

0x<0undefinedx=02xx<1undefinedx=121<x

(34)
  

ordinary differential equations

dsolve( diff(y(x),x)+p*y(x), y(x));

yx=&ExponentialE;xc__1x<0&ExponentialE;x33c__1x<1&ExponentialE;23x2c__11x

(35)
  

simplification

simplify(p*x);

−1x<0x2x12x1<xx

(36)
• 

Solve:

  

A new solver which handles many new classes of problems has been written.

  

The canonical example for the new algorithm:

eqns := {x^a*y^b-U, 1+mu*x^a*a/x*y^b, 1+mu*x^a*y^b*b/y};

eqns1+μxaaybx&comma;1+μxaybby&comma;xaybU

(37)

solve( eqns, {x,y,mu} );

μ=&ExponentialE;lnbaa+lnUb+aUb&comma;x=&ExponentialE;lnbablnUb+a&comma;y=&ExponentialE;lnbaa+lnUb+a

(38)
  

solving systems of inequalities:

solve( {x^2<1, y^2<=1, x+y<1/2}, {x,y} );

−1y&comma;y12&comma;−1<x&comma;x<1,y1&comma;−1<x&comma;12<y&comma;x<12y

(39)
  

equations with inverse trigonometric functions:

solve(arccos(x) - arctan(x), {x});

x=2+252

(40)
• 

PDE solver, ODE solver:

  

The PDE solver pdesolve produces closed form solutions for certain classes of partial differential equations.

  

Lagrange equations: Non-homogeneity affine in the dependent variable.

A:='A': B:='B': C:='C':

pdsolve( (x+A)*diff(U(x,y),x) + (y+B)*diff(U(x,y),y) = U(x,y)+C, U(x,y) );

Ux&comma;y=f__1y+Bx+AA+f__1y+Bx+AxC

(41)
  

The ODE solver dsolve is now able to solve Riemann-Papperitz equations.

eq:=18*(x-1)^2*(x-4)*diff(y(x),x,x)+27*(x-1)*(x-2)*
diff(y(x),x)+(x+80)*y(x):

dsolve(eq,y(x));

yx=c__1hypergeom56&comma;23&comma;32&comma;x313x1+c__2x132hypergeom53&comma;116&comma;72&comma;x313

(42)
• 

Integration:

  

Significant improvements to elliptic integration. These provide more elegant and robust solutions to a wider range of problems.

assume(k>1,1-k^2<0);

int(1/sqrt((1-x^2)*(1-k^2*x^2)),x=0..1);

IEllipticKk~21k~k~+EllipticK1k~k~

(43)

k := 'k':

  

Integrals containing a general hypergeometric function.

int(z*hypergeom([3,4],[5],z),z);

2zhypergeom2&comma;3&comma;4&comma;z3hypergeom1&comma;2&comma;3&comma;z

(44)
• 

limit:

  

Limit now does a better job in zero recognition.

f := [sec,csc,sinh,cosh,tanh,coth,sech,csch]:

f := map(proc(a) (a(x+h)-a(x))/h end,f):

g := map(limit, f, h=0);

gsinxcosx2&comma;cosxsinx2&comma;&ExponentialE;x2+&ExponentialE;x2&comma;&ExponentialE;x2&ExponentialE;x2&comma;4&ExponentialE;2x&ExponentialE;2x2+2&ExponentialE;2x+1&comma;4&ExponentialE;2x&ExponentialE;2x22&ExponentialE;2x+1&comma;2&ExponentialE;x+2&ExponentialE;x&ExponentialE;x2+2&ExponentialE;x&ExponentialE;x+&ExponentialE;x2&comma;2&ExponentialE;x2&ExponentialE;x&ExponentialE;x22&ExponentialE;x&ExponentialE;x+&ExponentialE;x2

(45)
  

It is also better at recognizing undefined limits.

limit((-1+W+1/(1+W))^(1/2)/W, W=0);

undefined

(46)

limit(sqrt(1-cos(x))/x*sqrt(2),x=0);

undefined

(47)
• 

sum:

  

With the implementation of the Moenck algorithm, Maple is able to sum every rational polynomial with an ever expanding coefficient field.

sum(1/(x^3+x+1), x);

_&alpha;=RootOf_Z3+_Z+1631_&alpha;2931_&alpha;+431Ψx_&alpha;

(48)
• 

product:

  

The product function is improved so that many more infinite products are now computed.   Option "continuous" is added to instruct product not to look for discontinuities.

product((n^2-4)/(n^2-1),n=3..infinity);

14

(49)

product(1+(z-z^2)/(n+n^2),n=1..infinity,continuous);

sinπ1+zzz1π

(50)
• 

Special functions:

  

Many more special functions are implemented and integrated into Maple: Bessel family:AiryAi, AiryBi, BesselI, BesselJ, BesselK, BesselY, HankelH1, HankelH2, KelvinBer, KelvinBei, KelvinKer, KelvinKei, KelvinHer, KelvinHei, StruveH, StruveL, AngerJ, WeberE.

  

FresnelC, FresnelS.

  

dawson.

  

Elliptic and Inverse Elliptic: EllipticK, EllipticE, EllipticPi, EllipticF, EllipticE, EllipticPi, EllipticCK, EllipticCE, EllipticCPi, EllipticNome

  

Jacobi Amplitude and  Elliptic functions: JacobiAM, JacobiSN, JacobiCN, JacobiDN, JacobiNS, JacobiNC, JacobiND, JacobiSC, JacobiCS, JacobiSD, JacobiDS, JacobiCD, JacobiDC

  

Jacobi Theta Functions: JacobiTheta1, JacobiTheta2, JacobiTheta3, JacobiTheta4

  

Weierstrass P, P', zeta and sigma functions: WeierstrassP, WeierstrassPPrime, WeierstrassZeta, WeierstrassSigma

  

General Pochhammer function: pochhammer

series(AngerJ(1/3,x),x,4);

332π+9163πx27703πx28112803πx3+Ox4

(51)

diff(HankelH2(v,x^2),x);

2HankelH2v+1&comma;x2+vHankelH2v&comma;x2x2x

(52)
• 

Branch Cut:

  

Maple has been continuously improved in this respect. Basic routines such as simplify, expand, combine, ... have been enhanced to work correctly with respect to brach cut.

assume( xpos>0, ypos>0, apos>0);assume(npos,posint);

  

The simplify function no longer transforms exp(x)^y to exp(x*y) by default unless always correct.

simplify( exp(xpos)^ypos ), simplify( exp(x)^y );

&ExponentialE;ypos~xpos~,&ExponentialE;xy

(53)
  

Similarly, simplify no longer transforms ln(x^y) to y*ln(x) by default:

simplify( ln(xpos^ypos)),simplify( ln(x^y));

ypos~lnxpos~,lnxy

(54)
  

Nor does it convert ln(exp(x)) to x and ln(x+y) to ln(x)+ln(y):

simplify(ln(exp(xpos))), simplify(ln(exp(x)));

xpos~,ln&ExponentialE;x

(55)

simplify(ln(xpos*ypos)), simplify(ln(x*y));

lnypos~+lnxpos~,lnxy

(56)

xpos:='xpox': ypos:='ypos': apos:='apos': npos:='npos':

  

For expand, when the environment variable _EnvExpandln is set to false allows the routine to always work correctly with respect to branch cut:

_EnvExpandln := false:

expand(log(a^x));

lnax

(57)

expand(ln(1/z));

ln1z

(58)

_EnvExpandln := '_EnvExpandln': readlib(forget)(expand);

expand(log(a^x));

lnax

(59)
  

combine: the routine can now take options, such as 'symbolic'.  Note that the answer using the symbolic option is not mathematically equivalent to the input over the whole complex plane, but allows for simplifications using the principal branch.

combine(ln(a)+ln(b), ln), combine(ln(a)+ln(b),ln, symbolic);

lna+lnb,lnab

(60)
  

There are other changes in the direction of taking greater care with branch cuts:

  

The function series() now returns:

series(ln(x),x);

lnx

(61)
  

instead of -ln(1/x).

• 

radnormal:

  

The routine radnormal normalizes an expression containing radical numbers.  It has been greatly improved, and become more reliable. The option 'rationalized' is added for rationalizing the denominator.

a := ((x^2+2*x*2^(1/2)-2*x*3^(1/2)+5-2*2^(1/2)*3^(1/2))/
(x^2-2*x*3^(1/2)+1));

ax2+2x22x3+5223x22x3+1

(62)

radnormal(a);

x+23x32

(63)

c := 1/(2^(1/2)+3^(1/2)+6^(1/2));

c12+3+6

(64)

radnormal(c,rationalized);

532323231223+7223

(65)
• 

The assume System:

  

Increased power and robustness in the assume facility provides solutions to a wider range of problems. The assume system is further incorporated into Maple.

is(2*(-1-I)^(1/2)*(-1+I)^(1/2) <> 0);

true

(66)

assume(n, integer);

cos(n*Pi);

−1n~

(67)

additionally(n,even);

cos(n*Pi);

1

(68)

sin(n*Pi);

0

(69)

n := 'n':

• 

convert:

  

Many more routines are added to help conversion of a given expression to a different form:

convert[piecewise]

convert an expression having Heaviside,

 

abs, signum, or If to a piecewise function.

convert[Heaviside]

convert a piecewise function to a

 

Heaviside expression.

convert[pwlist]

convert a piecewise function to an ordered

 

list which represents the given piecewise-defined

 

function.

convert[signum]

convert an expression with abs to signum.

convert[abs]

convert an expression with signum to abs.

convert[Airy]

converts an expression with Bessel functions

 

of various forms into Airy functions.

convert[int]

replace the functional form of any integral

 

transforms occurring in an expression with their integral

 

representations.

convert[fullparfrac]

perform a partial fraction decomposition

 

of a rational function in a given variable after

 

completely factoring the denominator into linear factors

 

over its splitting field.

convert(abs(1-abs(x)),piecewise);

1xx−1x+1x<01xx<1x11x

(70)

convert(HankelH2(-2/3,z),Airy);

I3563+313AiryAi1&comma;323213z232+I3133563AiryBi1&comma;323213z2322232z23

(71)

convert((x^2+1)/(x^2+x+1), fullparfrac, x);

1+_&alpha;=RootOf_Z2+_Z+1_&alpha;323x_&alpha;

(72)
• 

Coordinate Systems:

  

A large library of 2D and 3D coordinate systems which is integrated with other packages and functions such as linalg and plot, is provided.

restart;

linalg[ grad ] ( f(r,theta,z), [r,theta,z], coords=cylindrical);

rfr&comma;θ&comma;zθfr&comma;θ&comma;zrzfr&comma;θ&comma;z

(73)
  

Users can add their own orthogonal coordinate systems via routine addcoords.  See coords and addcoords.

• 

mod and modp2: Computation over the integers modulo m.

  

Frobenius, Inverse, Issimilar and Linsolve matrix calculations modulo integers are implemented.

A := matrix([[1,2,3],[4,5,6],[7,8,9]]):

B := matrix([[0,0,0], [1,0,-4], [0,1,-7]]):

Issimilar(A,B,P) mod 11;

true

(74)

eval(P);

868823100

(75)
  

The modp2 function offers fast arithmetic for bivariate polynomials over the integers modulo p.

a:=(x^3*y^2+1)*(x^2*y^2+1)^2*(x+y+1)^3*(x*y+2)^4:

a1:=Expand(a) mod 3: Sqrfree(a1) mod 3;

1&comma;x3y2+1&comma;1&comma;x2y2+1&comma;2&comma;x+y+1&comma;3&comma;xy+2&comma;4

(76)
• 

implicitdiff:

  

The function implicitdiff is used to differentiate a function defined by an equation.

readlib(implicitdiff):

f := x^2+y^3=1;

fy3+x2=1

(77)

implicitdiff(f,y,x);

2x3y2

(78)

implicitdiff(f,x,y);

3y22x

(79)

Other improvements:

  

The following describes a few other improvements and new functionalities in release 4. The list is by no means exhaustive. Lots of effort has been put into improving product quality.

• 

compoly: The routine compoly now handles more than one variable (as a second argument).

p := -2-7*x+7*y-x^2+2*x*y-y^2;

px2+2xyy27x+7y2

(80)

r := compoly(p,{x,y});

rx2+7x2,x=xy+7

(81)

subs( r[2], r[1] );

xy+72+7x7y+47

(82)

expand(-p);

x22xy+y2+7x7y+2

(83)
• 

RootOf: RootOf's are denested, if possible.

RootOf( x+ RootOf(_Z^2-x), x);

RootOf_Z2_Z

(84)
• 

splits: A new function splits which is to split what factors is to factor.

with(polytools,splits):

splits( x^2+x+1, x);

1&comma;xRootOf_Z2+_Z+1&comma;1&comma;x+1+RootOf_Z2+_Z+1&comma;1

(85)
• 

root: The routine root computes n-th root of a given expression.

root[3](3.0+4.0*I);

1.628937146+0.5201745022I

(86)

assume(x>0);

root[3](16*x^3*y);

2x~213y13

(87)

assume(x<0);

root[3](16*x^3*y);

2x~2y13

(88)

x:='x':

• 

roots: The function roots works with input that has parameters. It returns the roots that do not contain parameters.

roots((x^2-1)*(x-a),x);

−1&comma;1&comma;1&comma;1

(89)
• 

surd: The function surd is extended over the complex plane.

surd(-1+2*I,3);

12+I32−1+2I13

(90)
• 

collect: The function collect was enhanced to do general collection on forms previously lacking support, such as diff, D, and trigonometric functions.

f := sin(x)^2*x*diff(y(x),x)-x*diff(diff(y(x),x),x)-x*sin(x)-sin(x)^2*
tan(x)*diff(y(x),x)-cos(x)*sin(x)-diff(diff(y(x),x),x)+sin(x)^2*
diff(y(x),x,x)+cos(x)*diff(y(x),x,x);

fsinx2x&DifferentialD;&DifferentialD;xyxx&DifferentialD;2&DifferentialD;x2yxxsinxsinx2tanx&DifferentialD;&DifferentialD;xyxcosxsinx&DifferentialD;2&DifferentialD;x2yx+sinx2&DifferentialD;2&DifferentialD;x2yx+cosx&DifferentialD;2&DifferentialD;x2yx

(91)

collect(f,diff);

sinx2+cosxx1&DifferentialD;2&DifferentialD;x2yx+sinx2tanx+sinx2x&DifferentialD;&DifferentialD;xyxcosxsinxxsinx

(92)

collect(f,[sin,diff]);

&DifferentialD;2&DifferentialD;x2yx+tanx+x&DifferentialD;&DifferentialD;xyxsinx2+cosxxsinx+cosxx1&DifferentialD;2&DifferentialD;x2yx

(93)
• 

simplify/trig: modified such that tan(x) does not get simplified to sin(x)/cos(x) if there is only tan or sec in the expression.

simplify(tan(x));

tanx

(94)

simplify(tan(x)-tan(x)^2);

tanxtanx1

(95)
• 

combine/arctan: combine arctangent terms:

f := arctan(1/3) + arctan(1/5) + arctan(1/7) - Pi/4 + arctan(1/8);

farctan13+arctan15+arctan17π4+arctan18

(96)

combine(f,arctan);

0

(97)

f := arctan(x)+arctan(1/x);

farctanx+arctan1x

(98)

combine(f);

csgnx2+1xπ2

(99)

assume(x>0);

combine(f,arctan);

π2

(100)
• 

binomial: The function binomial(n,m) returns 0 if n-m is a negative integer.

assume(npos,posint):

binomial(npos,npos+5);

0

(101)
• 

Function name changes:

  

Lambert's W function: W --> LambertW.

  

Elliptic integral functions:

LegendreF(k,z)

= EllipticF(k,z)

LegendreKc(k)

= EllipticK(k)

LegendreKc1(k)

= EllipticCK(k)

LegendreE(k,z)

= EllipticE(k,z)

LegendreEc(k)

= EllipticE(k)

LegendreEc1(k)

= EllipticCE(k)

LegendrePi(k,nu,z)

= EllipticPi(k,nu,z)

LegendrePic(k,nu)

= EllipticPi(k,nu)

LegendrePic1(k,nu)

= EllipticCPi(k,nu)