New Symbolic Features That Have Been Added to Maple V for Release 4
New and Improved Packages:
New and Improved Functionalities:
Other improvements:
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);
3⁢2⁢−cos⁡a⁢w⁢Ssi⁡a⁢w+sin⁡a⁢w⁢Ci⁡a⁢wπ
assume(a>0);
inttrans[hilbert](exp(I*a*x),x,y);
I⁢ⅇI⁢y⁢a~
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);
F1⁡s+a⁢F2⁡s+a+b+1
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);
−s−1⁢F⁡s−1
inttrans[mellin](int(f(x),x=t..infinity),t,s);
F⁡s+1s
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);
fourier⁡diff⁡f⁡t,u,u,t,s
inttrans[laplace](int(f(t,u),u=a..b),t,s);
int⁡laplace⁡f⁡t,u,t,s,u=a..b
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);
laplace⁡f⁡tt4,t,s
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⁢π⁢ⅇw⁢w⁢hypergeom⁡32,2,−w2⁢Heaviside⁡−w2
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⁡φ2r2−cos⁡φ2r2+sin⁡φr⁢D2⁡w⁡r,φ,θ+−cos⁡φ⁢sin⁡φr−cos⁡φ⁢D1⁡w⁡r,φ,θ−cos⁡φ⁢sin⁡φ⁢D2,2⁡w⁡r,φ,θr2+−sin⁡φ2r+cos⁡φ2r⁢D1,2⁡w⁡r,φ,θ+sin⁡φ⁢cos⁡φ⁢D1,1⁡w⁡r,φ,θ
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
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);
Prod⁡C,Set⁡Prod⁡C,Set⁡Prod⁡C,Set⁡Prod⁡C,Set⁡H,H,H,Prod⁡C,Set⁡H,H,H,H,H,H,Prod⁡C,Set⁡H,H,H,H
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=2⁢Mr3
R1313=−r+2⁢M⁢Mr2
R1414=−r+2⁢M⁢M⁢sin⁡θ2r2
R2323=−M−r+2⁢M
R2424=−M⁢sin⁡θ2−r+2⁢M
R3434=−2⁢M⁢sin⁡θ2⁢r
character : [-1, -1, -1, -1]
displayGR('Ricci', Rc);
The Ricci tensor
None
character : [-1, -1]
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
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);
GeometryDetail⁡name 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+23⁢x=0,y−23⁢x=0,equation of the hyperbola,−4⁢x2+9⁢y2−36=0
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');
58⁢5511⁢550552⁢55001
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:
13.4
1.2
11.2
.28
49.3
7.3
.87
8.4
A4
100.3
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:
bytes used=106607176, alloc=12318512, time=350.33
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));
DESol⁡−f−D2⁡f,f
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+1⁢−1+2⁢k2⁢k⁢k2−1
sumtohyper(binomial(n,k)^2,k);
hypergeom⁡−n,−n,1,1
with(sumtools,extended_gosper):
extended_gosper(pochhammer(b,k/2)/factorial(k/2),k);
k⁢pochhammer⁡b,k22⁢b⁢k2!+k+1⁢pochhammer⁡b,k2+122⁢b⁢k2+12!
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));
3⁢−13+x4+83⁢x3+2⁢x2x2
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+5⁢x3+x2+6⁢x+5
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)));
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_adic⁡1x,−1,1,−3,4,4,−32,76311x+p_adic⁡1x,−1,1,−3,4,4,−32,76321x2+p_adic⁡1x,−1,1,−3,4,4,−32,76331x3+p_adic⁡1x,−1,1,−3,4,4,−32,76341x4+p_adic⁡1x,−1,1,−3,4,4,−32,76351x5+p_adic⁡1x,−1,1,−3,4,4,−32,76361x6+O⁡1x5
padic[orderp](f,1/x,x);
−1
padic[lcoeffp]: the leading coefficient of a p-adic expansion of a rational function.
padic[lcoeffp](f,1/x,x);
1
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+...
numtheory[invcfrac] ((28));
31
numtheory[pdexpand]: compute the periodic expansion of a rational number.
numtheory[pdexpand](-83/74);
PDEXPAND⁡−1,1,1,2,1,6
convert((30),rational);
−8374
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.
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<02⁢x1<xx2otherwise
support for integration,
int(p,x);
−xx≤0x33x≤1x2−231<x
differentiation,
diff(p,x);
0x<0undefinedx=02⁢xx<1undefinedx=121<x
ordinary differential equations
dsolve( diff(y(x),x)+p*y(x), y(x));
y⁡x=ⅇx⁢c__1x<0ⅇ−x33⁢c__1x<1ⅇ23−x2⁢c__11≤x
simplification
simplify(p*x);
−1x<0x2x≤12⁢x1<x⁢x
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};
eqns≔1+μ⁢xa⁢a⁢ybx,1+μ⁢xa⁢yb⁢by,xa⁢yb−U
solve( eqns, {x,y,mu} );
μ=−ⅇln⁡ba⁢a+ln⁡Ub+aU⁢b,x=ⅇ−ln⁡ba⁢b−ln⁡Ub+a,y=ⅇln⁡ba⁢a+ln⁡Ub+a
solving systems of inequalities:
solve( {x^2<1, y^2<=1, x+y<1/2}, {x,y} );
−1≤y,y≤−12,−1<x,x<1,y≤1,−1<x,−12<y,x<12−y
equations with inverse trigonometric functions:
solve(arccos(x) - arctan(x), {x});
x=−2+2⁢52
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) );
U⁡x,y=f__1⁡y+Bx+A⁢A+f__1⁡y+Bx+A⁢x−C
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));
y⁡x=c__1⁢hypergeom⁡−56,−23,−32,x3−13x−1+c__2⁢x−132⁢hypergeom⁡53,116,72,x3−13
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);
−I⁢EllipticK⁡k~2−1k~k~+EllipticK⁡1k~k~
k := 'k':
Integrals containing a general hypergeometric function.
int(z*hypergeom([3,4],[5],z),z);
2⁢z⁢hypergeom⁡2,3,4,z3−hypergeom⁡1,2,3,z
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);
g≔sin⁡xcos⁡x2,−cos⁡xsin⁡x2,ⅇx2+ⅇ−x2,ⅇx2−ⅇ−x2,4⁢ⅇ2⁢xⅇ2⁢x2+2⁢ⅇ2⁢x+1,−4⁢ⅇ2⁢xⅇ2⁢x2−2⁢ⅇ2⁢x+1,−2⁢ⅇx+2⁢ⅇ−xⅇx2+2⁢ⅇ−x⁢ⅇx+ⅇ−x2,−2⁢ⅇx−2⁢ⅇ−xⅇx2−2⁢ⅇ−x⁢ⅇx+ⅇ−x2
It is also better at recognizing undefined limits.
limit((-1+W+1/(1+W))^(1/2)/W, W=0);
undefined
limit(sqrt(1-cos(x))/x*sqrt(2),x=0);
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);
∑_α=RootOf⁡_Z3+_Z+1⁡631⁢_α2−931⁢_α+431⁢Ψ⁡x−_α
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
product(1+(z-z^2)/(n+n^2),n=1..infinity,continuous);
sin⁡π⁢1+zz⁢z−1⁢π
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);
3⁢32⁢π+916⁢3π⁢x−2770⁢3π⁢x2−811280⁢3π⁢x3+O⁡x4
diff(HankelH2(v,x^2),x);
2⁢−HankelH2⁡v+1,x2+v⁢HankelH2⁡v,x2x2⁢x
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 );
ⅇypos~⁢xpos~,ⅇxy
Similarly, simplify no longer transforms ln(x^y) to y*ln(x) by default:
simplify( ln(xpos^ypos)),simplify( ln(x^y));
ypos~⁢ln⁡xpos~,ln⁡xy
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⁡ⅇx
simplify(ln(xpos*ypos)), simplify(ln(x*y));
ln⁡ypos~+ln⁡xpos~,ln⁡x⁢y
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));
ln⁡ax
expand(ln(1/z));
ln⁡1z
_EnvExpandln := '_EnvExpandln': readlib(forget)(expand);
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);
ln⁡a+ln⁡b,ln⁡a⁢b
There are other changes in the direction of taking greater care with branch cuts:
The function series() now returns:
series(ln(x),x);
ln⁡x
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));
a≔x2+2⁢x⁢2−2⁢x⁢3+5−2⁢2⁢3x2−2⁢x⁢3+1
radnormal(a);
x+2−3x−3−2
c := 1/(2^(1/2)+3^(1/2)+6^(1/2));
c≔12+3+6
radnormal(c,rationalized);
5⁢323−2⁢323−1223+7⁢223
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
assume(n, integer);
cos(n*Pi);
−1n~
additionally(n,even);
sin(n*Pi);
0
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);
−1−xx≤−1x+1x<01−xx<1x−11≤x
convert(HankelH2(-2/3,z),Airy);
−I⁢3563+313⁢AiryAi⁡1,−323⁢213⁢z232+I⁢313−3563⁢AiryBi⁡1,−323⁢213⁢z232⁢2232⁢z23
convert((x^2+1)/(x^2+x+1), fullparfrac, x);
1+∑_α=RootOf⁡_Z2+_Z+1⁡−_α3−23x−_α
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);
∂∂rf⁡r,θ,z∂∂θf⁡r,θ,zr∂∂zf⁡r,θ,z
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;
eval(P);
868823100
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,x3⁢y2+1,1,x2⁢y2+1,2,x+y+1,3,x⁢y+2,4
implicitdiff:
The function implicitdiff is used to differentiate a function defined by an equation.
readlib(implicitdiff):
f := x^2+y^3=1;
f≔y3+x2=1
implicitdiff(f,y,x);
−2⁢x3⁢y2
implicitdiff(f,x,y);
−3⁢y22⁢x
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;
p≔−x2+2⁢x⁢y−y2−7⁢x+7⁢y−2
r := compoly(p,{x,y});
r≔−x2+7⁢x−2,x=x−y+7
subs( r[2], r[1] );
−x−y+72+7⁢x−7⁢y+47
expand(-p);
x2−2⁢x⁢y+y2+7⁢x−7⁢y+2
RootOf: RootOf's are denested, if possible.
RootOf( x+ RootOf(_Z^2-x), x);
RootOf⁡_Z2−_Z
splits: A new function splits which is to split what factors is to factor.
with(polytools,splits):
splits( x^2+x+1, x);
1,x−RootOf⁡_Z2+_Z+1,1,x+1+RootOf⁡_Z2+_Z+1,1
root: The routine root computes n-th root of a given expression.
root[3](3.0+4.0*I);
1.628937146+0.5201745022⁢I
assume(x>0);
root[3](16*x^3*y);
2⁢x~⁢213⁢y13
assume(x<0);
−2⁢x~⁢−2⁢y13
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,1,1,1
surd: The function surd is extended over the complex plane.
surd(-1+2*I,3);
−12+I⁢32⁢−1+2⁢I13
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);
f≔sin⁡x2⁢x⁢ⅆⅆxy⁡x−x⁢ⅆ2ⅆx2y⁡x−x⁢sin⁡x−sin⁡x2⁢tan⁡x⁢ⅆⅆxy⁡x−cos⁡x⁢sin⁡x−ⅆ2ⅆx2y⁡x+sin⁡x2⁢ⅆ2ⅆx2y⁡x+cos⁡x⁢ⅆ2ⅆx2y⁡x
collect(f,diff);
sin⁡x2+cos⁡x−x−1⁢ⅆ2ⅆx2y⁡x+−sin⁡x2⁢tan⁡x+sin⁡x2⁢x⁢ⅆⅆxy⁡x−cos⁡x⁢sin⁡x−x⁢sin⁡x
collect(f,[sin,diff]);
ⅆ2ⅆx2y⁡x+−tan⁡x+x⁢ⅆⅆxy⁡x⁢sin⁡x2+−cos⁡x−x⁢sin⁡x+cos⁡x−x−1⁢ⅆ2ⅆx2y⁡x
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));
tan⁡x
simplify(tan(x)-tan(x)^2);
−tan⁡x⁢tan⁡x−1
combine/arctan: combine arctangent terms:
f := arctan(1/3) + arctan(1/5) + arctan(1/7) - Pi/4 + arctan(1/8);
f≔arctan⁡13+arctan⁡15+arctan⁡17−π4+arctan⁡18
combine(f,arctan);
f := arctan(x)+arctan(1/x);
f≔arctan⁡x+arctan⁡1x
combine(f);
csgn⁡x2+1x⁢π2
π2
binomial: The function binomial(n,m) returns 0 if n-m is a negative integer.
assume(npos,posint):
binomial(npos,npos+5);
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)
Download Help Document