Previous Up Next

2.25.18  Sylvester matrix of two polynomials : sylvester

sylvester takes two polynomials as arguments.
sylvester returns the Sylvester matrix S of these polynomials.
If A(x)=∑i=0i=n aixi and B(x)=∑i=0i=mbixi are 2 polynomials, their Sylvester matrix S is a squared 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 



Input :

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

Output :

[[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]]

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*p^3--27*q^2

Previous Up Next