Manual

340 Functions and commands
Coefficients Given a polynomial in x, returns a vector containing the
coefficients. If the polynomial is in a variable other than x,
then declare the variable as the second argument. With an
integer as the optional third argument, returns the coefficient
of the polynomial whose degree matches the integer.
coeff(Poly,
[Var], [Integer])
Examples:
coeff(x^2-2) returns [1 0 -2]
coeff(y^2-2, y, 1) returns 0
Divisors Given a polynomial, returns a vector containing the divisors of
the polynomial.
divis(Poly) or divis({Poly1, Poly2,…})
Example:
divis(x^2-1) returns [1 -1+x 1+x (-1+x)*(1+x)]
Factor List Returns a vector containing the prime factors of a polynomial
or a list of polynomials, with each factor followed by its
multiplicity.
factors(Poly) or factors({Poly1,
Poly2,…})
Example:
factors(x^4-1) returns [x-1 1 x+1 1 x
2
+1 1]
GCD Returns the greatest common divisor of two or more
polynomials.
gcd(Poly1,Poly2...)
Example:
gcd(x^4-1, x^2-1) returns x^2-1
LCM Returns the least common multiple of two or more
polynomials.
lcm(Poly1, Poly2,…)
Example:
lcm(x^2-2*x+1,x^3-1) gives (x-1)*(x^3-1)