對於兩個多項式 和
,其階數分別為
和
,西爾維斯特矩陣是一個
矩陣,透過從左上角開始用
的係數填充矩陣來形成,然後向下移動一行和向右移動一列,從那裡開始填充係數,直到它們到達右側。然後對
的係數重複此過程。
西爾維斯特矩陣可以在 Wolfram 語言 中實現為
SylvesterMatrix1[poly1_, poly2_, var_] :=
Function[{coeffs1, coeffs2}, With[
{l1 = Length[coeffs1], l2 = Length[coeffs2]},
Join[
NestList[RotateRight, PadRight[coeffs1,
l1 + l2 - 2], l2 - 2],
NestList[RotateRight, PadRight[coeffs2,
l1 + l2 - 2], l1 - 2]
]
]
][
Reverse[CoefficientList[poly1, var]],
Reverse[CoefficientList[poly2, var]]
]
例如, 和
的西爾維斯特矩陣是
SylvesterMatrix是用於Resultant函式的(未文件化的)方法,在 Wolfram 語言 中(儘管它確實在 Trott 2006 年第 29 頁中有記錄)。