MAPLE consists of 3 components: a) The standard MAPLE library (default) b) MAPLE packages c) Share library or User-contributed libraries For specialized purposes in MAPLE the packages have to be loaded first, for example for linear algebra: with(LinearAlgebra); A:=<<1|2>,<3|4>>; # This introduces a 2x2 matrix Determinant(A); Rank(A); JSFH To get a complete list of packages that are available one can use ?index,packages We will focus now on some commands and packages that deal with POLYNOMIAL EQUATIONS/INEQUALITIES. These are MAPLE's favorite data type! The computer algebra system manipulates them in full generality and at high speed. One key goal of this class is that we learn HOW/WHY do these algorithms work!!!! Let us begin with UNIVARIATE POLYNOMIAL EQUATIONS: p1:=-3*x+7*x^2-3*x^3+7*x^4; lcoeff(p1); degree(p1); p2:=5*x^5+3*x^3+x^2-2*x+1; (p1)^14*(p2)^7; expand(%); sort(%); P:=%: coeff(P,x^48); coeffs(P,x,'powers'); One of the most important operations with polynomials is DIVISION WITH REMAINDER. MAPLE has two procedures QUO and REM (quotient and remainder): q:=quo(P,p1+1,x,'r'); r; testeq(P=q*(p1+1)+r); # We test the equality of the quotient rem(P,p1+1,x,'q'); The operation of diving a polynomial by another is very important to the problem of SOLVING an EQUATION! The reason is if a is a root of P(x) the P is divisible by (x-a). Similarly when two polynomials have common roots then they have a common divisor, so computing the GCD is relevant for the simultaneous solution of two, three or more polynomials. Of course one can also compute greatest common divisor of polynomials, gcd OR can also compute the least common multiple (we will study these algorithms in detail): gcd(p1,p2); lcm(p1,p2); factor(P); Factor(P)mod 2; p3:= 2*x^5-3*x^4+38*x^3-57*x^2-300*x+450; solve(p3=0,x); # One can therefore find the solutions of any polynomial equation fsolve(p3=0,x); JSFH eqn:=x^3+2*a+x^2+a*x=1; solve(eqn,x); MAPLE has found the three complex solutions thinking that a is a parameter. Now we put the solutions into an array: L:=[%]; And we obtain the value at a=11 by doing substitution: subs(a=11,L); evalf(%); Sadly, the mathematical theory of GALOIS groups says that, starting with equations of degree 5, we cannot always find such a close form solution of the roots in terms of radicals. We will illustrate nevertheless what MAPLE can do with the solutions: poly:=x^7-2*x^6-4*x^5-x^3+x^2+6*x+4; sols:=solve(poly=0,x); evalf([sols]); sols+sols; is(%,real); Let us play more with the roots, we can try to deal with the complex roots and see what happens with their product (WHAT DO YOU THINK???) prodroots:=product(sols[i],i=3..7); evala(simplify(prodroots)); You can also ask for just the real solutions by using a specificacion of the type of number: select(x->Im(x)=0,[sols]); From the very beginning you can also just compute the real solutions using the command REALDOMAIN: use RealDomain in solve(poly) end use; The labels of the roots allow you to distinguished among several roots of the same equations. sols; One can easily generate random polynomials p:=randpoly(x,degree=8); randpoly(x,terms=3); There are many functions for polynomials and one can take a look at the code for them using the INTERFACE command: interface(verboseproc=2); print(lcm); JSFH JSFH