Sylvester matrix of two polynomials
This functionality does not run in MATLAB.
linalg::sylvester(p
,q
) linalg::sylvester(f
,g
,x
)
linalg::sylvester(p, q)
returns the Sylvester
matrix of the two polynomials p and q.
If no variable is specified, then the polynomials p
and q
must
be either of the domain DOM_POLY
or from a domain
of category Cat::Polynomial
.
Polynomial expressions are not allowed.
If the polynomials 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 builtin 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).
Otherwise, if the polynomials 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.
If f
and g
are polynomial
expressions or multivariate polynomials of type DOM_POLY
,
then you must specifiy the variable x
.
In the case of polynomial expressions, the component ring of
the Sylvester matrix is the domain Dom::ExpressionField()
(see Example 3).
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 f
and g
except x
,
and R
is the common coefficient ring of the polynomials
(see Example 4).
At least one of the input polynomials must have positive degree
with respect to the main variable or 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 ℤ is the following 6×6 matrix:
delete x: Z := Dom::Integer: S := linalg::sylvester(poly(x^2 + 2*x  1, Z), poly(x^4 + 1, Z))
If the polynomials have the builtin 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)) )
domtype(S)
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)
domtype(S)
The Sylvester matrix of these two polynomials with respect to y
is
the following 2×2 matrix:
linalg::sylvester(x + y^2, 2*x^3  1, y)
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)
domtype( T )
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)

Polynomials 

Polynomials or polynomial expressions of positive degree 

A variable 
Matrix of the domain Dom::Matrix
(R)
, where R
is
the coefficient domain of the polynomials (see below).