Maxima Function
polytocompanion (p, x)
If p is a polynomial in x, return the companion matrix of p. For a monic polynomial p of degree n, we have p = (-1)^n charpoly (polytocompanion (p, x)).
p = (-1)^n charpoly (polytocompanion (p, x))
When p isn't a polynomial in x, signal an error.