# How to find a characteristic polynomial of 5x5 matrix

From an example that I am looking at, the characteristic polynomial of

$\begin{bmatrix} -1&4&0&0&0 \\ 0&3&0&0&0 \\ 0&-4&-1&0&0 \\ 3&-8&-4&2&1 \\ 1&5&4&1&4 \end{bmatrix}$

is $(x-3)^3(x+1)^2$. I understand how to find the characteristic polynomial of 2x2 and 3x3 matrices but anything nxn beyond that I'm not sure what to do. Could someone walk me through the steps of the calculation to find the characteristic polynomial for this matrix?

• I guess in that case my question is really how to compute the determinant of A-$\lambda*I$ for matrices larger than 3x3. Aug 7 '16 at 7:46
• Do you mean you're having a hard time finding the determinant of any $n\times n$ matrix?
– Matt
Aug 7 '16 at 7:47
• Yes, I'm having trouble with the definition of a determinant of an arbitrary $n x n$ matrix. Aug 7 '16 at 7:55
• Your title says "$6 \times 6$ matrix", but the matrix in your question is a $5 \times 5$ matrix. Aug 7 '16 at 8:29
• @JimmyK4542: Fixed now. Aug 7 '16 at 9:20

The characteristic polynomial is (up to sign) the determinant of $A - \lambda I$, in this case

$\begin{bmatrix} -\lambda-1&4&0&0&0 \\ 0&-\lambda+3&0&0&0 \\ 0&-4&-\lambda-1&0&0 \\ 3&-8&-4&-\lambda+2&1 \\ 1&5&4&1&-\lambda+4 \end{bmatrix}$

The most common definition of determinant is based on an expansion to minors (see https://en.wikipedia.org/wiki/Determinant#Definition), but using that directly for the calculation is horribly inefficient. In general, finding the determinant of a matrix if based on a form of Gaussian Elimination using the following rules:

1. The determinant of a triangular matrix is the product of entries on the diagonal.
2. Multiplying a single row by a scalar multiples the determinant by the same scalar.
3. Switching two rows negates the determinant.
4. Adding a scalar multiple of a row to another row leaves the determinant unchanged.

However, in this particular case the calculation is much easier because $A$ is block triangular. That is, it can be written in the form

$A = \begin{bmatrix} B&0&0\\C&D&0\\E&F&G \end{bmatrix}$

Where $B=\begin{bmatrix}-1&4\\0&3\end{bmatrix}$, $D = \begin{bmatrix}-1\end{bmatrix}$ and $G = \begin{bmatrix}2&1\\1&4\end{bmatrix}$.

In such a case, the determinant of $A$ is the product of the determinants of $B$,$D$ and $G$, and the characteristic polynomial of $A$ is the product of the characteristic polynomials of $B$,$D$ and $G$. Since each of these is up to $2\times2$, you should find the result easily. The result is $(\lambda-3)(\lambda+1)(\lambda+1)(\lambda^2-6\lambda+7)$ (and not as you wrote).

• This is off by -1^n=-1^5=-1 which makes the result you give not monic, and it needs to be made monic again. det(lambda*I-A) as opposed to flipping the subtraction would yield the correct answer without the extra step. Dec 12 '21 at 20:36
• Update: upon my own calculation using both methods this is the correct answer as the leading term is still 1 and multiplying by -1 twice makes no difference. Dec 12 '21 at 20:46
• Note that I've prefaced by saying that I calculate the characteristic polynomial up to sign. I find it more natural to work with det(A - lambda I) and then, if needed, negate the result to get a monic polynomial. That's why I wrote the monic version in the end without any additional verbiage. Dec 16 '21 at 16:07
• Yes except if n is not even what you are saying is not enough and will not always work from Wikipedia Characteristic Polynomial page": Some authors define the characteristic polynomial to be det(A-tI). That polynomial differs from the one defined here by a sign (-1)^{n}, so it makes no difference for properties like having as roots the eigenvalues of A however the definition above always gives a monic polynomial, whereas the alternative definition is monic only when n is even." So its not a good idea to use this definition without stating the full situation. Dec 18 '21 at 0:41

Directly using elementary operations that don't change the value of the determinant. Develop by the second row twice:

$$\begin{vmatrix} x+1&-4&0&0&0 \\ 0&x-3&0&0&0 \\ 0&4&x+1&0&0 \\ -3&8&4&x-2&-1 \\ -1&-5&-4&-1&x-4 \end{vmatrix}=(x-3)\begin{vmatrix} x+1&0&0&0 \\ 0&x+1&0&0 \\ -3&4&x-2&-1 \\ -1&-4&-1&x-4 \end{vmatrix}=$$$${}$$

$$=(x-3)(x+1)\begin{vmatrix} x+1&0&0 \\ -3&x-2&-1 \\ -1&-1&x-4 \end{vmatrix}\stackrel{\text{1st row}} =(x-3)(x+1)^2\begin{vmatrix}x-2&-1\\-1&x-4\end{vmatrix}=$$$${}$$

$$=(x-3)(x+1)^2(x^2-6x+7)$$

As you can see, the above isn't $\;(x-3)^3(x+1)^2\;$, so at least one of you or I is wrong...but I already checked mine with this program

• This is the correct answer as you used the correct det(lambda*I-A). As Wikipedia notes: Some authors define the characteristic polynomial to be det(A-tI). That polynomial differs from the one defined here by a sign (-1)^{n}, so it makes no difference for properties like having as roots the eigenvalues of A; however the definition above always gives a monic polynomial, whereas the alternative definition is monic only when n is even. So the other answer has not multiplied by -1^5=-1 and then converted it to being monic again. Dec 12 '21 at 20:35
• Upon further inspection, (x-3)^2=(x-6x+9) so your final simplification is just incorrect. But your subresult is the correct answer. Dec 12 '21 at 20:48
• @GregoryMorse: Note the word "isn't" in the final sentence. The two aren't equal, which is exactly what DonAntonio was saying. The last expression was in reference to the incorrect polynomial suggested by the original questioner. Dec 16 '21 at 16:10