TITLE: Find the roots of a polynomial using its companion matrix
QUESTION [10 upvotes]: I would like to find the roots of a polynomial using its companion matrix.
The polynomial is ${p(x) = x^4-10x^2+9}$
The companion matrix $M$ is
$M={\left[
\begin{array}{cccc}
0 & 0 & 0 & -9 \\
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 10       \\
0 & 0 & 1 & 0
\end{array}
\right]}$
A theorem says that the eigenvalues of $M$ are the roots of $p(x)$. I tried to find the characteristic polynomial of $M$ but it turned out to be $p(x)$. What should I do to obtain the eigenvalues of $M$?

REPLY [2 votes]: There exist numerical methods to find eigenvalues of matrices which use matrix - vector multiplication. Matrix-vector multiplication is very fast if the matrix is sparse as it is in this case.
One popular method is the power method. Roughly speaking, taking a random vector $\bf r$ and calculating ${\bf M}^k{\bf r}$ and ${\bf M}^{k+1}{\bf r}$ for a large $k$. Then the "parts" of $\bf r$ corresponding to the largest eigenvector should grow faster (exponentially faster with $k$) so that by elementwise division of those two vectors we can calculate the eigenvalue corresponding to that vector. Then there exist ways to sequentially "remove" or factor out parts of an eigenspace. 
So a method doing this could look something like

Generate $\bf r$ from a random distribution.
Calculate ${\bf M}^k{\bf r}$ and ${\bf M}^{k+1}{\bf r}$ and divide them element wise to get largest eigenvalue.
Factor out the eigenvalue-eigenvector pair by some method.
Loop from 1 with a new random vector to get the second largest eigenvalue and so on until you have all you want.

One way to do the factorization step is described in "Matrix Analysis" by Horn and Johnson. Don't have the book right by me at the moment but can add a page number later if you are interested.