Enhanced Packages in Maple 9: Part 1 - Maple Programming Help

Enhanced Packages in Maple 9: Part 1

 • Maple 9 contains many enhancements to existing packages. For additional enhancements, see Enhanced Packages in Maple 9: Part 2.
 • For information on new Maple 9 packages, see New Packages in Maple 9.
 • Enhanced Packages in Maple 9: Part 1 contains information for the following packages.

CodeGeneration

 Many improvements have been made to the CodeGeneration package.  New exports allow translation of Maple code to the Visual Basic® and MATLAB® languages and provide users the ability to extend the current translation facilities.  The translators accept modules as input, in addition to expressions, computation sequences, and procedures. These new features, along with other improvements in efficiency, coverage of the Maple language, and quality of the output, are described as follows.
 > with(CodeGeneration);
 $\left[{C}{,}{\mathrm{CSharp}}{,}{\mathrm{Fortran}}{,}{\mathrm{IntermediateCode}}{,}{\mathrm{Java}}{,}{\mathrm{JavaScript}}{,}{\mathrm{Julia}}{,}{\mathrm{LanguageDefinition}}{,}{\mathrm{Matlab}}{,}{\mathrm{Names}}{,}{\mathrm{Perl}}{,}{\mathrm{Python}}{,}{R}{,}{\mathrm{Save}}{,}{\mathrm{Swift}}{,}{\mathrm{Translate}}{,}{\mathrm{VisualBasic}}\right]$ (1)

Translation to New Languages

 • Two new exports, Matlab and VisualBasic, offer translation to the MATLAB® and Visual Basic languages, respectively.  The following examples show translation of a computation sequence and a procedure.
 > x := 'x': s := 's': t := 't': r := 'r':
 > cs := [s=1.0+x, t=ln(s)*exp(-x), r=exp(-x)+x*t]:
 > Matlab(cs);
 s = 0.10e1 + x; t = log(s) * exp(-x); r = exp(-x) + x * t;
 > f := proc(x, y) local a; if x < 1.0 then a := cos(y) else a := sin(y) end if; return 2*a; end proc:
 > VisualBasic(f);
 Imports System.Math Public Module CodeGenerationModule   Public Function f(ByVal x As Double, ByVal y As Double) As Double     Dim a As Double     If (x < 0.10E1) Then       a = Cos(y)     Else       a = Sin(y)     End If     Return 0.2E1 * a   End Function End Module
 • General information about translation using the CodeGeneration package can be found on the CodeGeneration help page, while information specific to the new MATLAB® and Visual Basic translators can be found on the MatlabDetails and VisualBasicDetails help pages.

User-Defined Translations

 • The translation facilities of the CodeGeneration package can be extended using the new CodeGeneration[LanguageDefinition] submodule. The CodeGeneration translators use predefined language definition modules, one for each target language the package supports.  The LanguageDefinition submodule contains exports that allow you to override or add to translations specified in the existing definition modules or to specify an entirely new language definition module.  Then, the Translate command can be used to translate using the new definitions.
 • A summary of the translation process is described on the LanguageDefinitionOverview help page.
 Here, you define a language that extends ANSI C, and you define the correct translation of a Maple procedure named my_function' to be my_function_equivalent'.
 > LanguageDefinition:-Define( "SomeNewLanguage", extend="C",     AddFunction("my_function", [numeric]::numeric, "my_function_equivalent") ): Translate( my_function(csc(x)+sin(x)), language="SomeNewLanguage" );
 cg = my_function_equivalent(0.1e1 / sin(x) + sin(x));

Improved Coverage of the Maple Language

 • Modules are accepted as input by the CodeGeneration translators. For information, see CodeGeneration.
 > m := module()   local g;   export f;   g := proc(x) cos(x)+sin(x) end proc:   f := proc(y) if y>=0.0 and y<=2.0*Pi then g(y) else 0.0 end if end proc: end module:
 > Java(m);
 import java.lang.Math; class m {   public static double f (double y)   {     if (0.0e0 <= y && y <= 0.20e1 * Math.PI)       return(g(y));     else       return(0.0e0);   }   private static double g (double x)   {     return(Math.cos(x) + Math.sin(x));   } }
 • The Maple try statement is recognized by CodeGeneration, and translated to an appropriate equivalent in those supported languages for which such an equivalent exists.
 > tproc := proc(a, b)     try         a/b;     catch:         printf("An error %s occurred.\n", lasterror);     end try; end proc:
 > Java(tproc);
 class CodeGenerationClass {   public static double tproc (double a, double b) throws Exception;   {     try {       return(a / b);     } catch (Exception except) {       System.out.println("An error " + except.getMessage() + " occurred.");     }   } }
 • The translators accept more Maple constructs, even if they are unable to translate them.  For example, in Maple 8, a list found in an unrecognized context produced an error.  Now, such a list is translated unchanged, and a warning is issued.  In these situations, the output is usually incorrect, but the user has the opportunity to modify it as required.

New Options

 • There are two new options, deducereturn and reduceanalysis, for controlling the analysis of the Maple input code.
 • When a procedure is provided as input, an attempt is made to interpret any implicit returns and convert them to explicit returns.  However, if the deducereturn=false option is specified, no attempt at deducing an explicit return is made and any Maple code resulting in an implicit return is translated unchanged.  An example is shown below; the first call shows the default behavior, while the second shows the effect of the deducereturn=false option.
 > f := proc(x) local y; y := x+10; end proc:
 > C(f);
 int f (int x) {   int y;   y = x + 10;   return(y); }
 > C(f, deducereturn=false);
 void f (int x) {   int y;   y = x + 10; }
 • When a computation sequence, specified as a list of equations, is provided as input, the sequence is normally analyzed as a whole, so that type information collected during analysis of one assignment is applied to the analysis of subsequent assignments.  The option reduceanalysis=true specifies that the computation sequence be analyzed one assignment at a time instead. The use of this option can significantly reduce the time and memory required for translation, though the target code may contain inconsistencies in type assignments.

Miscellaneous

 • In Maple 8, the conversion of implicit returns to explicit returns always required the creation of a new variable to hold the return value.  Now, a new variable is created only in cases where it is necessary, resulting in more compact output in most cases.

DEtools

 • The DEtools package contains a new function DEtools[dperiodic_sols], which finds solutions of linear ODEs that have doubly-periodic coefficients. Doubly-periodic functions are typically represented in Weierstrass form (rational expressions in $P$ and $P'$ ) or Jacobi form (rational expressions of the Jacobi functions, for example, $\mathrm{sn}$, $\mathrm{cn}$, and $\mathrm{dn}$).
 > alias( P = WeierstrassP(x,g2,g3), Pp = WeierstrassPPrime(x,g2,g3),        sn = JacobiSN(x,k), cn = JacobiCN(x,k), dn = JacobiDN(x,k) ):
 > ode := diff(y(x),x$2) - (2*P + B)*y(x):  > DEtools[dperiodic_sols](ode, y(x) );  $\left[{{ⅇ}}^{{-}\frac{\sqrt{{4}{}{{B}}^{{3}}{-}{B}{}{\mathrm{g2}}{-}{\mathrm{g3}}}{}\left({\int }\frac{{1}}{{B}{-}{P}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)}{{2}}}{}\sqrt{{B}{-}{P}}{,}{{ⅇ}}^{\frac{\sqrt{{4}{}{{B}}^{{3}}{-}{B}{}{\mathrm{g2}}{-}{\mathrm{g3}}}{}\left({\int }\frac{{1}}{{B}{-}{P}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\right)}{{2}}}{}\sqrt{{B}{-}{P}}\right]$ (2)  > k := 3:  > ode := diff(y(x),x$2) + (k^2*sn*cn/dn)*diff(y(x),x) + 9*dn^2*y(x):
 > DEtools[dperiodic_sols](ode, y(x) );
 $\left[{-}\frac{{4}{}{{\mathrm{JacobiSN}}{}\left({x}{,}{3}\right)}^{{3}}}{{3}}{+}{\mathrm{JacobiSN}}{}\left({x}{,}{3}\right){,}\left({-}\frac{{4}{}{{\mathrm{JacobiSN}}{}\left({x}{,}{3}\right)}^{{3}}}{{3}}{+}{\mathrm{JacobiSN}}{}\left({x}{,}{3}\right)\right){}\left(\frac{{18}{}{\mathrm{JacobiSN}}{}\left({x}{,}{3}\right){}{\mathrm{JacobiCN}}{}\left({x}{,}{3}\right)}{{{\mathrm{JacobiDN}}{}\left({x}{,}{3}\right)}^{{2}}{+}\frac{{23}}{{4}}}{+}\frac{{9}{}{\mathrm{JacobiSN}}{}\left({x}{,}{3}\right){}{\mathrm{JacobiCN}}{}\left({x}{,}{3}\right)}{{{\mathrm{JacobiDN}}{}\left({x}{,}{3}\right)}^{{2}}{-}{1}}\right)\right]$ (3)
 > ode := (Pp + (P^2))*diff(y(x),x$2) + ((P)^3-P*Pp-diff(P,x$2))*diff(y(x),x)        + ((Pp)^2-(P)^2*Pp-P*diff(P,x$2))*y(x):  > DEtools[dperiodic_sols](ode, y(x));  $\left[{P}{,}{-}{{ⅇ}}^{{\mathrm{WeierstrassZeta}}{}\left({x}{,}{\mathrm{g2}}{,}{\mathrm{g3}}\right)}\right]$ (4)  > k := 'k':  • The DEtools package is extended by means of LinearFunctionalSystems package in searching for polynomial and rational solutions of systems of differential equations.  DEtools[matrixDE] accepts an option of the form solution = polynomial or solution = rational, which specifies to search for polynomial or rational solution. In this case, the function LinearFunctionalSystems[PolynomialSolution] or LinearFunctionalSystems[RationalSolution] is used to find solutions.  > M := matrix(6,6,[0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,2,2*x,0,0,1,0,x^2,0,2*x,0,0,1,0,x^2,-2,0,0,0]);  ${M}{≔}\left[\begin{array}{cccccc}{0}& {1}& {0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}& {1}& {0}\\ {2}& {2}{}{x}& {0}& {0}& {1}& {0}\\ {{x}}^{{2}}& {0}& {2}{}{x}& {0}& {0}& {1}\\ {0}& {{x}}^{{2}}& {-2}& {0}& {0}& {0}\end{array}\right]$ (5)  > DEtools['matrixDE'](M,x,solution=polynomial);  $\left[\left[\begin{array}{cccccc}{0}& {1}& {x}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}& {0}& {0}\\ {1}& {-}{x}& {-}{{x}}^{{2}}& {0}& {0}& {0}\\ {-1}& {x}& {{x}}^{{2}}& {0}& {0}& {0}\\ {0}& {-1}& {-}{2}{}{x}& {0}& {0}& {0}\\ {-}{2}{}{x}& {{x}}^{{2}}& {{x}}^{{3}}{-}{2}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{cccccc}{0}& {0}& {0}& {0}& {0}& {0}\end{array}\right]\right]$ (6)  For DEtools[polysols] and DEtools[ratsols], a system of differential equations can be given either as a list of the equations in the first argument and a list of the variables in the second argument or as a list of lists of lists of coefficients of linear ODEs in the first argument, a list of the right-hand sides of such equations in the second argument, and the independent variable in the third argument. Each equation is represented as the sum of LODEs in one variable, each of them is given as a list of coefficients, so one equation is given as a list of lists of coefficients and a system as a list of lists of lists. The latter sequence is convenient for programming with the routines.  > sys := [diff(y1(x), x) - y2(x), diff(y2(x), x) - y3(x) - y4(x), diff(y3(x), x) - y5(x), diff(y4(x), x) - 2*y1(x) - 2*x*y2(x) - y5(x), diff(y5(x), x) - x^2*y1(x) - 2*x*y3(x) - y6(x), diff(y6(x), x) - x^2*y2(x) + 2*y3(x)];  ${\mathrm{sys}}{≔}\left[\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{y1}}{}\left({x}\right){-}{\mathrm{y2}}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{y2}}{}\left({x}\right){-}{\mathrm{y3}}{}\left({x}\right){-}{\mathrm{y4}}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{y3}}{}\left({x}\right){-}{\mathrm{y5}}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{y4}}{}\left({x}\right){-}{2}{}{\mathrm{y1}}{}\left({x}\right){-}{2}{}{x}{}{\mathrm{y2}}{}\left({x}\right){-}{\mathrm{y5}}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{y5}}{}\left({x}\right){-}{{x}}^{{2}}{}{\mathrm{y1}}{}\left({x}\right){-}{2}{}{x}{}{\mathrm{y3}}{}\left({x}\right){-}{\mathrm{y6}}{}\left({x}\right){,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{y6}}{}\left({x}\right){-}{{x}}^{{2}}{}{\mathrm{y2}}{}\left({x}\right){+}{2}{}{\mathrm{y3}}{}\left({x}\right)\right]$ (7)  > vars := [y1(x), y2(x), y3(x), y4(x), y5(x), y6(x)];  ${\mathrm{vars}}{≔}\left[{\mathrm{y1}}{}\left({x}\right){,}{\mathrm{y2}}{}\left({x}\right){,}{\mathrm{y3}}{}\left({x}\right){,}{\mathrm{y4}}{}\left({x}\right){,}{\mathrm{y5}}{}\left({x}\right){,}{\mathrm{y6}}{}\left({x}\right)\right]$ (8)  > DEtools['polysols'](sys, vars);  $\left[\left[{0}{,}{1}{,}{x}\right]{,}\left[{0}{,}{0}{,}{1}\right]{,}\left[{1}{,}{-}{x}{,}{-}{{x}}^{{2}}\right]{,}\left[{-1}{,}{x}{,}{{x}}^{{2}}\right]{,}\left[{0}{,}{-1}{,}{-}{2}{}{x}\right]{,}\left[{-}{2}{}{x}{,}{{x}}^{{2}}{,}{{x}}^{{3}}{-}{2}\right]\right]$ (9)  > sysp := [[[0,1],[-1]],[[],[0,1],[-1],[-1]],[[],[],[0,1],[],[-1]], [[-2],[-2*x],[],[0,1],[-1]],[[-x^2],[],[-2*x],[],[0,1],[-1]], [[],[-x^2],[2],[],[],[0,1]]];  ${\mathrm{sysp}}{≔}\left[\left[\left[{0}{,}{1}\right]{,}\left[{-1}\right]\right]{,}\left[\left[\right]{,}\left[{0}{,}{1}\right]{,}\left[{-1}\right]{,}\left[{-1}\right]\right]{,}\left[\left[\right]{,}\left[\right]{,}\left[{0}{,}{1}\right]{,}\left[\right]{,}\left[{-1}\right]\right]{,}\left[\left[{-2}\right]{,}\left[{-}{2}{}{x}\right]{,}\left[\right]{,}\left[{0}{,}{1}\right]{,}\left[{-1}\right]\right]{,}\left[\left[{-}{{x}}^{{2}}\right]{,}\left[\right]{,}\left[{-}{2}{}{x}\right]{,}\left[\right]{,}\left[{0}{,}{1}\right]{,}\left[{-1}\right]\right]{,}\left[\left[\right]{,}\left[{-}{{x}}^{{2}}\right]{,}\left[{2}\right]{,}\left[\right]{,}\left[\right]{,}\left[{0}{,}{1}\right]\right]\right]$ (10)  > DEtools['polysols'](sysp, [0,0,0,0,0,0], x);  $\left[\left[{0}{,}{1}{,}{x}\right]{,}\left[{0}{,}{0}{,}{1}\right]{,}\left[{1}{,}{-}{x}{,}{-}{{x}}^{{2}}\right]{,}\left[{-1}{,}{x}{,}{{x}}^{{2}}\right]{,}\left[{0}{,}{-1}{,}{-}{2}{}{x}\right]{,}\left[{-}{2}{}{x}{,}{{x}}^{{2}}{,}{{x}}^{{3}}{-}{2}\right]\right]$ (11) LibraryTools  • The LibraryTools package contains a new routine LibraryTools[Browse]. The LibraryTools[Browse] routine displays a Maplet application interface that allows you to easily manipulate multiple libraries. By clicking buttons, you can create new libraries, navigate, and edit the contents of existing libraries.  > LibraryTools[Browse](); LinearAlgebra  • The LinearAlgebra package contains three new related routines: MatrixExponential, MatrixPower, and MatrixFunction. The more general MatrixFunction routine computes F(A) for an analytic function F and a Matrix A. The two routines MatrixExponential and MatrixPower are provided as convenient means to use this functionality for two common functions. More detail is available on the MatrixFunction help page. Examples  > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$  > $M≔\mathrm{Matrix}\left(\left[\left[3,5\right],\left[-2,4\right]\right]\right):$  > $\mathrm{MatrixFunction}\left(M,\mathrm{sin}\left(x\right),x\right)$  $\left[\begin{array}{cc}{\mathrm{sin}}{}\left(\frac{{7}}{{2}}\right){}{\mathrm{cosh}}{}\left(\frac{\sqrt{{39}}}{{2}}\right){-}\frac{\sqrt{{39}}{}{\mathrm{cos}}{}\left(\frac{{7}}{{2}}\right){}{\mathrm{sinh}}{}\left(\frac{\sqrt{{39}}}{{2}}\right)}{{39}}& \frac{{10}{}\sqrt{{39}}{}{\mathrm{cos}}{}\left(\frac{{7}}{{2}}\right){}{\mathrm{sinh}}{}\left(\frac{\sqrt{{39}}}{{2}}\right)}{{39}}\\ {-}\frac{{4}{}\sqrt{{39}}{}{\mathrm{cos}}{}\left(\frac{{7}}{{2}}\right){}{\mathrm{sinh}}{}\left(\frac{\sqrt{{39}}}{{2}}\right)}{{39}}& {\mathrm{sin}}{}\left(\frac{{7}}{{2}}\right){}{\mathrm{cosh}}{}\left(\frac{\sqrt{{39}}}{{2}}\right){+}\frac{\sqrt{{39}}{}{\mathrm{cos}}{}\left(\frac{{7}}{{2}}\right){}{\mathrm{sinh}}{}\left(\frac{\sqrt{{39}}}{{2}}\right)}{{39}}\end{array}\right]$ (12)  > $\mathrm{SQ}≔\mathrm{MatrixFunction}\left(M,{x}^{\frac{1}{2}},x\right)$  ${\mathrm{SQ}}{≔}\left[\begin{array}{cc}\frac{\sqrt{{2}{}\sqrt{{22}}{+}{7}}}{{2}}{-}\frac{\sqrt{{39}}{}\sqrt{{2}{}\sqrt{{22}}{-}{7}}}{{78}}& \frac{{5}{}\sqrt{{39}}{}\sqrt{{2}{}\sqrt{{22}}{-}{7}}}{{39}}\\ {-}\frac{{2}{}\sqrt{{39}}{}\sqrt{{2}{}\sqrt{{22}}{-}{7}}}{{39}}& \frac{\sqrt{{2}{}\sqrt{{22}}{+}{7}}}{{2}}{+}\frac{\sqrt{{39}}{}\sqrt{{2}{}\sqrt{{22}}{-}{7}}}{{78}}\end{array}\right]$ (13)  > $\mathrm{map}\left(\mathrm{radnormal},{\mathrm{SQ}}^{2}\right)$  $\left[\begin{array}{cc}{3}& {5}\\ {-2}& {4}\end{array}\right]$ (14)  • Three new classes of sparse iterative linear solver for floating-point systems have been introduced via the LinearAlgebra[LinearSolve] routine. These complement the existing real symmetric iterative solver, and cover the complex hermitian, real nonsymmetric, and complex nonhermitian cases. Examples  > with(LinearAlgebra):  > M := Matrix([[3,5],[-2,4]],storage=sparse,datatype=float):  > b := Vector([1,2],datatype=float):  > infolevel[LinearAlgebra]:=3;  ${{\mathrm{infolevel}}}_{{\mathrm{LinearAlgebra}}}{≔}{3}$ (15)  > x := LinearSolve(M,b,method=SparseIterative);  LinearSolve: "using method" SparseIterative LinearSolve: "using method" SparseIterative LinearSolve: "calling external function" LinearSolve: "using CGS method" LinearSolve: "preconditioning with incomplete LU factorization" LinearSolve: "level of fill = " 0 LinearSolve: "using complete pivoting strategy" LinearSolve: "dimension of workspaces for preconditioner = " 16 LinearSolve: "using infinity norm in stopping criteria" LinearSolve: "setting maximum iterations to " 200 LinearSolve: "setting tolerance to " .10e-7 LinearSolve: "NAG" hw_f11zaf LinearSolve: "NAG" hw_f11daf LinearSolve: "NAG" hw_f11dcf LinearSolve: "number of iterations" 1 LinearSolve: "residual computed last as" 1.11022302462516e-015  ${x}{≔}\left[\begin{array}{c}{-0.272727272727273}\\ {0.363636363636364}\end{array}\right]$ (16)  > Norm(M.x - b);  unknown: hw_SpMatVecMulRR unknown: hw_SpMatVecMulRR Norm: "calling external function" Norm: "NAG: " hw_f06raf  ${1.11022302462515654}{}{{10}}^{{-15}}$ (17)  > infolevel[LinearAlgebra]:=0;  ${{\mathrm{infolevel}}}_{{\mathrm{LinearAlgebra}}}{≔}{0}$ (18) ListTools  • The ListTools package contains a new function ListTools[Occurrences], which counts the number of occurrences of an item in a list. In addition to literal equality, other kinds of equivalences can be specified. LREtools  • The LREtools[hypergeomsols] function uses an implementation based on the paper: M. van Hoeij, Finite Singularities and Hypergeometric Solutions of Linear Recurrence Equations.'' J. Pure Appl. Algebra, 139, p. 109-131 (1999). This algorithm can be substantially faster when the leading or trailing coefficient of the recurrence relation is a polynomial with complicated roots. As an example,  > LREtools[hypergeomsols](u(n+2) = 2*(n^4+4*n^3+6*n^2+5*n+3)*(n^4+n+1)*u(n), u(n), {}, 'output'='basis');  $\left[{\left(\sqrt{{2}}\right)}^{{n}}{}\left({\prod }_{{k}{=}{0}}^{{n}{-}{1}}{}\left({{k}}^{{4}}{+}{k}{+}{1}\right)\right){,}{\left({-}\sqrt{{2}}\right)}^{{n}}{}\left({\prod }_{{k}{=}{0}}^{{n}{-}{1}}{}\left({{k}}^{{4}}{+}{k}{+}{1}\right)\right)\right]$ (19)  • The LREtools package is extended by means of LinearFunctionalSystems package in searching for polynomial and rational solutions of systems of recurrence equations.  > x := 'x':  > sys := [y2(x)*x^2+3*y2(x)*x+2*y2(x)-2*y1(x)*x^2-4*y1(x)*x+y1(x+1)*x^2+y1(x+1)*x,y2(x+1)-y1(x)];  ${\mathrm{sys}}{≔}\left[{{x}}^{{2}}{}{\mathrm{y2}}{}\left({x}\right){+}{3}{}{x}{}{\mathrm{y2}}{}\left({x}\right){+}{2}{}{\mathrm{y2}}{}\left({x}\right){-}{2}{}{{x}}^{{2}}{}{\mathrm{y1}}{}\left({x}\right){-}{4}{}{\mathrm{y1}}{}\left({x}\right){}{x}{+}{\mathrm{y1}}{}\left({x}{+}{1}\right){}{{x}}^{{2}}{+}{\mathrm{y1}}{}\left({x}{+}{1}\right){}{x}{,}{\mathrm{y2}}{}\left({x}{+}{1}\right){-}{\mathrm{y1}}{}\left({x}\right)\right]$ (20)  > vars := [y1(x), y2(x)];  ${\mathrm{vars}}{≔}\left[{\mathrm{y1}}{}\left({x}\right){,}{\mathrm{y2}}{}\left({x}\right)\right]$ (21)  > LREtools['polysols'](sys, vars,{}, 'output'='basis');  $\left[{{\mathrm{_C}}}_{{1}}{+}{x}{}\left({{\mathrm{_C}}}_{{1}}{+}{2}{}{{\mathrm{_C}}}_{{2}}\right){+}{x}{}\left({x}{-}{1}\right){}{{\mathrm{_C}}}_{{2}}{,}{x}{}{{\mathrm{_C}}}_{{1}}{+}{x}{}\left({x}{-}{1}\right){}{{\mathrm{_C}}}_{{2}}\right]$ (22)  • The LREtools package contains a new function LREtools[IsDesingularizable], which desingularizes linear difference operators with polynomial coefficients.  > LREtools[IsDesingularizable]((n-2)*(n^3+2)*E+n,E,n,'leading','output'='operator');  ${\mathrm{true}}{,}{1}{+}\left({6}{}{{n}}^{{3}}{+}{36}{}{{n}}^{{2}}{+}{72}{}{n}{+}{60}\right){}{{E}}^{{3}}{+}\left({{n}}^{{3}}{-}{2}{}{{n}}^{{2}}{+}{6}\right){}{E}{+}\left({4}{}{{n}}^{{3}}{+}{8}{}{{n}}^{{2}}{+}{6}\right){}{{E}}^{{2}}$ (23)  • For information on the new LREtools[HypergeometricTerm] subpackage, see New Packages in Maple 9. Slode  The Slode package contains a new function Slode[dAlembertian_formal_sol], which finds formal solutions with d'Alembertian series to a homogeneous linear differential equation with polynomial coefficients.  > ode:=(-4-x^2+2*x)*y(x)+(2*x-3*x^3-x^2)*diff(y(x),x)+(x^3-x^4)*diff(y(x),$(x,2));
 ${\mathrm{ode}}{≔}\left({-}{{x}}^{{2}}{+}{2}{}{x}{-}{4}\right){}{y}{}\left({x}\right){+}\left({-}{3}{}{{x}}^{{3}}{-}{{x}}^{{2}}{+}{2}{}{x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){+}\left({-}{{x}}^{{4}}{+}{{x}}^{{3}}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right)$ (24)
 > Slode[dAlembertian_formal_sol](ode,y(x));
 ${{x}}^{{2}}{}\left({-}\frac{\left({\sum }_{{\mathrm{_n}}{=}{0}}^{{\mathrm{\infty }}}{}{{x}}^{{\mathrm{_n}}}\right)}{{2}}{+}\left({\sum }_{{\mathrm{_n}}{=}{0}}^{{\mathrm{\infty }}}{}\left({\sum }_{{\mathrm{_n1}}{=}{0}}^{{\mathrm{_n}}{-}{1}}{}{\left({-}\frac{{1}}{{2}}\right)}^{{\mathrm{_n1}}}{}\left({\prod }_{{\mathrm{_k}}{=}{0}}^{{\mathrm{_n1}}{-}{1}}{}\frac{{\left({\mathrm{_k}}{+}{3}\right)}^{{2}}}{{\mathrm{_k}}{+}{2}}\right)\right){}{{x}}^{{\mathrm{_n}}}\right)\right){}{{\mathrm{_C}}}_{{0}}{+}\frac{{{ⅇ}}^{\frac{{2}}{{x}}}{}\left(\left({\sum }_{{\mathrm{_n}}{=}{0}}^{{\mathrm{\infty }}}{}{{x}}^{{\mathrm{_n}}}\right){-}\frac{{1}}{{3}}\right){}{{\mathrm{_C}}}_{{1}}}{{x}}$ (25)
 > ode:=(x-1)^2*diff(y(x),$(x,3))-(x-1)*(x-7)*diff(y(x),$(x,2))-2*(2*x-5)*diff(y(x),x)-2*y(x);
 ${\mathrm{ode}}{≔}{\left({x}{-}{1}\right)}^{{2}}{}\left(\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){-}\left({x}{-}{1}\right){}\left({x}{-}{7}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){-}{2}{}\left({2}{}{x}{-}{5}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){-}{2}{}{y}{}\left({x}\right)$ (26)
 > Slode[dAlembertian_formal_sol](ode,y(x));
 ${{\mathrm{_C}}}_{{0}}{}\left({\sum }_{{\mathrm{_n}}{=}{0}}^{{\mathrm{\infty }}}{}{{x}}^{{\mathrm{_n}}}\right){+}{{\mathrm{_C}}}_{{1}}{}\left({\sum }_{{\mathrm{_n}}{=}{0}}^{{\mathrm{\infty }}}{}{\mathrm{_n}}{}{{x}}^{{\mathrm{_n}}}\right){+}{{\mathrm{_C}}}_{{2}}{}\left({\sum }_{{\mathrm{_n}}{=}{0}}^{{\mathrm{\infty }}}{}\left({\sum }_{{\mathrm{_n1}}{=}{0}}^{{\mathrm{_n}}{-}{1}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{{\mathrm{_n2}}{=}{0}}^{{\mathrm{_n1}}{-}{1}}{}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\prod }_{{\mathrm{_k}}{=}{0}}^{{\mathrm{_n2}}{-}{1}}{}\frac{{1}}{{\mathrm{_k}}{+}{3}}\right){}{{x}}^{{\mathrm{_n}}}\right)$ (27)

SNAP

 • The SNAP package contains a new function QRGCD, which computes an approximate right GCD of two univariate polynomials. For more information, see SNAP[QRGCD].

SolveTools

 • The SolveTools package contains a new function PolynomialSystem, which solves general systems of polynomial equations. For more information, see SolveTools[PolynomialSystem].
 > SolveTools[PolynomialSystem]({x^2+y^2-3,x*y+5},{x,y});
 $\left\{{x}{=}\frac{{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{3}{}{{\mathrm{_Z}}}^{{2}}{+}{25}\right)}^{{3}}}{{5}}{-}\frac{{3}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{3}{}{{\mathrm{_Z}}}^{{2}}{+}{25}\right)}{{5}}{,}{y}{=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{3}{}{{\mathrm{_Z}}}^{{2}}{+}{25}\right)\right\}$ (28)
 • The SolveTools[CancelInverses] function has an option 'safe' that applies only those transformations that are valid everywhere. For more information, see SolveTools[CancelInverses].