TOPICS
Search

Companion Matrix


The companion matrix to a monic polynomial

 a(x)=a_0+a_1x+...+a_(n-1)x^(n-1)+x^n
(1)

is the n×n square matrix

 A=[0 0 ... 0 -a_0; 1 0 ... 0 -a_1; 0 1 ... 0 -a_2; | | ... ... |; 0 0 ... 1 -a_(n-1)]
(2)

with ones on the subdiagonal and the last column given by the coefficients of a(x). Note that in the literature, the companion matrix is sometimes defined with the rows and columns switched, i.e., the transpose of the above matrix.

When e_i is the standard basis, a companion matrix satisfies

 Ae_i=e_(i+1)
(3)

for i<n, as well as

 Ae_n=sum-a_ie_i,
(4)

including

 A^ne_1=sum-a_iA^ie_1.
(5)

The matrix minimal polynomial of the companion matrix is therefore a(x), which is also its characteristic polynomial.

Companion matrices are used to write a matrix in rational canonical form. In fact, any n×n matrix whose matrix minimal polynomial p(x) has polynomial degree n is similar to the companion matrix for p(x). The rational canonical form is more interesting when the degree of p(x) is less than n.

The following Wolfram Language command gives the companion matrix for a polynomial p in the variable x.

  CompanionMatrix[p_, x_] := Module[
    {n, w = CoefficientList[p, x]},
    w = -w/Last[w];
    n = Length[w] - 1;
    SparseArray[{{i_, n} :> w[[i]], {i_, j_} /;
      i == j + 1 -> 1}, {n, n}]]

See also

Matrix, Matrix Minimal Polynomial, Rational Canonical Form

This entry contributed by Todd Rowland

Explore with Wolfram|Alpha

Cite this as:

Rowland, Todd. "Companion Matrix." From MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein. https://mathworld.wolfram.com/CompanionMatrix.html

Subject classifications