Polynomial to companion matrix

Given the polynomial p(x)=a0+a1t++an-1tn-1+antn

the companion matrix is the square matrix defined as

C(p) = 000-c0100-c1010-c2001-cn-1

where ci=aian.

Syntax

polynomial_to_companion_matrix(Polynomial)

Description

Given a polynomial, returns the companion matrix as described above.

linear_algebra.polynomial_to_companion_matrix.calc.png