For two polynomials P_1(x) = a_m x^m + ... + a_0 and P_2 = b_n x^n + ... + b_0 of degrees m and n, respectively, the Sylvester matrix is an (m + n)×(m + n) matrix formed by filling the matrix beginning with the upper left corner with the coefficients of P_1(x), then shifting down one row and one column to the right and filling in the coefficients starting there until they hit the right side. The process is then repeated for the coefficients of P_2(x).