Previous Up Next

6.28.14  Sylvester matrix of two polynomials and resultant: sylvester resultant

Given two polynomials A(x)=∑i=0i=n aixi and B(x)=∑i=0i=mbixi, their Sylvester matrix is a square matrix of size m+n where m=degree(B(x)) and n=degree(A(x)). The m first lines are made with the A(x) coefficients, so that:





  s11=ans12=an−1s1(n+1)=a000
  s21=0s22=ans2(n+1)=a1s2(n+2)=a00
  ⋮
  sm1=0sm2=0sm(n+1)=am−1sm(n+2)=am−2a0




and the n further lines are made with the B(x) coefficients, so that:




s(m+1)1=bms(m+1)2=bm−1s(m+1)(m+1)=b000
s(m+n)1=0s(m+n)2=0s(m+n)(m+1)=bn−1bn−2b0



The determinant of a Sylvester polynomial is the resultant of the two polynomials. If A and B have integer coefficients with non-zero resultant r, then the polynomials equation

AU+BV=r

has a unique solution U,V such that degree(U)<degree(B) and degree(V)<degree(A), and this solution has integer coefficients.

Remark.
The discriminant of a polynomial is the resultant of the polynomial and its derivative.


The sylvester command computes Sylvester matrices.


The resultant command computes the resultant of two polynomials.

Example.
Input:

sylvester(x^3-p*x+q,3*x^2-p,x)

Output:







10pq0
010pq
30p00
030p0
0030p






Input:

det([[1,0,-p,q,0],[0,1,0,-p,q],[3,0,-p,0,0], [0,3,0,-p,0],[0,0,3,0,-p]])

Output:

−4 p3+27 q2

Input:

resultant(x^3-p*x+q,3*x^2-p,x)

Output:

−4 p3+27 q2


Examples using the resultant.


Previous Up Next