linalg::sylvester
-- Sylvester
matrix of two polynomialslinalg::sylvester
(p, q)
returns the
Sylvester matrix of the two polynomials p and
q.
linalg::sylvester(p, q)
linalg::sylvester(f, g, x)
p, q |
- | polynomials |
f, g |
- | polynomials or polynomial expressions of positive degree |
x |
- | a variable |
a matrix of the domain Dom::Matrix(R)
, where R
is
the coefficient domain of the polynomials (see below).
polylib::discrim
,
polylib::resultant
p
and q
must be either of the domain DOM_POLY
or from a domain of category Cat::Polynomial
. Polynomial
expressions are not allowed.p
and q
are of the
domain DOM_POLY
, then they must be univariate polynomials.
The component ring of the Sylvester matrix is the common coefficient
ring R of p
and q
, except in the
following two cases for built-in coefficient rings: If R is
Expr
then the domain Dom::ExpressionField()
is the
component ring of the Sylvester matrix. If R is
IntMod(m)
, then the Sylvester matrix is defined over the
ring Dom::IntegerMod(m)
(see example 2).p
and q
are
from a domain of category Cat::Polynomial
, then the
Sylvester matrix is computed with respect to the main variable of
p
and q
(see the method
"mainvar"
of the category Cat::Polynomial
). In the case of
univariate polynomials the Sylvester matrix is defined over the common
coefficient ring of p
and q
. In the case of
multivariate polynomials, the Sylvester matrix is defined over the
component ring Dom::DistributedPolynomial(ind,
R)
, where ind
is the list of all variables of
p
and q
except x
, and
R
is the common coefficient ring of the polynomials.f
and g
are polynomial expressions or
multivariate polynomials of type DOM_POLY
, then you must
specifiy the variable x
.Dom::ExpressionField()
(see
example 3).Dom::DistributedPolynomial(ind,
R)
, where ind
is the list of all variables of
f
and g
except x
, and
R
is the common coefficient ring of the polynomials (see
example 4).x
, respectively, but
it is not necessary that both of them have positive degree.The Sylvester matrix of the two polynomials p = x^2+2*x-1 and q = x^4+1 over Z is the following 6 x 6 matrix:
>> delete x: Z := Dom::Integer: S := linalg::sylvester(poly(x^2 + 2*x - 1, Z), poly(x^4 + 1, Z))
+- -+ | 1, 2, -1, 0, 0, 0 | | | | 0, 1, 2, -1, 0, 0 | | | | 0, 0, 1, 2, -1, 0 | | | | 0, 0, 0, 1, 2, -1 | | | | 1, 0, 0, 0, 1, 0 | | | | 0, 1, 0, 0, 0, 1 | +- -+
If the polynomials have the built-in coefficient ring
IntMod(m)
, then the Sylvester matrix is defined over the
domain Dom::IntegerMod(m)
:
>> delete x: S:= linalg::sylvester( poly(x + 1, IntMod(7)), poly(x^2 - 2*x + 2, IntMod(7)) )
+- -+ | 1 mod 7, 1 mod 7, 0 mod 7 | | | | 0 mod 7, 1 mod 7, 1 mod 7 | | | | 1 mod 7, 5 mod 7, 2 mod 7 | +- -+
>> domtype(S)
Dom::Matrix(Dom::IntegerMod(7))
The Sylvester matrix of the following two polynomial
expressions with respect to the variable x
is:
>> delete x, y: S := linalg::sylvester(x + y^2, 2*x^3 - 1, x)
+- -+ | 2 | | 1, y , 0, 0 | | | | 2 | | 0, 1, y , 0 | | | | 2 | | 0, 0, 1, y | | | | 2, 0, 0, -1 | +- -+
>> domtype(S)
Dom::Matrix()
The Sylvester matrix of these two polynomials with
respect to y
is the following 2 x 2 matrix:
>> linalg::sylvester(x + y^2, 2*x^3 - 1, y)
+- -+ | 3 | | 2 x - 1, 0 | | | | 3 | | 0, 2 x - 1 | +- -+
Here is an example for computing the Sylvester matrix of multivariate polynomials:
>> delete x, y: Q := Dom::Rational: T := linalg::sylvester(poly(x^2 - x + y, Q), poly(x + 2, Q), x)
+- -+ | 1, -1, y | | | | 1, 2, 0 | | | | 0, 1, 2 | +- -+
>> domtype( T )
Dom::Matrix(Dom::DistributedPolynomial([y], Dom::Rational, LexOrder))
The Sylvester matrix of these two multivariate
polynomials with respect to y
is:
>> linalg::sylvester(poly(x^2 - x + y, Q), poly(x + 2, Q), y)
+- -+ | x + 2 | +- -+