Polynomial
Find Roots
Given a polynomial in x (or a vector containing the coeicients of a polynomial), returns a vector containing its
roots.
proot(Poly) or proot(Vector)
Example:
proot([1,0,-2]) returns [-1.41421356237,1.41421356237]
Coeicients
Given a polynomial in x, returns a vector containing the coeicients. 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 coeicient of the polynomial whose degree matches the integer.
coeff(Poly, [Var], [Integer])
Example:
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.
380 Chapter 22 Functions and commands
Komentarze do niniejszej Instrukcji