Let $ A, B $ be two square matrices of order $n$. Do $ AB $ and $ BA $ have same minimal and characteristic polynomials?

I have a proof only if $ A$ or $ B $ is invertible. Is it true for all cases?

  • 4
    $\begingroup$ The coefficients of the characteristic polynomial are continuous functions in the entries of a matrix, so if the characteristic polynomials of $AB$ and $BA$ coincide for a dense set of $A$ (or a dense set of $B$) then they always coincide. The coefficients of the minimal polynomial, on the other hand... $\endgroup$ Feb 22, 2013 at 21:12
  • $\begingroup$ @cmi obviously not. Try to figure out 2 different polynomials with the same set of roots. Is not hard. $\endgroup$ Jul 4, 2019 at 7:41
  • $\begingroup$ people.math.sc.edu/howard/Classes/700/charAB.pdf $\endgroup$
    – Bach
    Aug 16, 2019 at 19:32

7 Answers 7


Before proving $AB$ and $BA$ have the same characteristic polynomials show that if $A_{m\times n}$ and $B_{n\times m} $ then characteristic polynomials of $AB$ and $BA$ satisfy following statement: $$x^n|xI_m-AB|=x^m|xI_n-BA|$$ therefore easily conclude if $m=n$ then $AB$ and $BA$ have the same characteristic polynomials.

Define $$C = \begin{bmatrix} xI_m & A \\B & I_n \end{bmatrix},\ D = \begin{bmatrix} I_m & 0 \\-B & xI_n \end{bmatrix}.$$ We have $$ \begin{align*} \det CD &= x^n|xI_m-AB|,\\ \det DC &= x^m|xI_n-BA|. \end{align*} $$ and we know $\det CD=\det DC$ if $m=n$ then $AB$ and $BA$ have the same characteristic polynomials.

  • 3
    $\begingroup$ I understood the proof, it's nice.. but is there any intuition abt why we consider C and D in such way? $\endgroup$
    – Believer
    May 8, 2021 at 7:00

If $A$ is invertible then $A^{-1}(AB)A= BA$, so $AB$ and $BA$ are similar, which implies (but is stronger than) $AB$ and $BA$ have the same minimal polynomial and the same characteristic polynomial. The same goes if $B$ is invertible.

In general, from the above observation, it is not too difficult to show that $AB$, and $BA$ have the same characteristic polynomial, the type of proof could depends on the field considered for the coefficient of your matrices though. If the matrices are in $\mathcal{M}_n(\mathbb C)$, you use the fact that $\operatorname{GL}_n(\mathbb C)$ is dense in $\mathcal{M}_n(\mathbb C)$ and the continuity of the function which maps a matrix to its characteristic polynomial. There are at least 5 other ways to proceed (especially for other field than $\mathbb C$).

In general $AB$ and $BA$ do not have the same minimal polynomial. I'll let you search a bit for a counter example.

  • 14
    $\begingroup$ 5 other ways? I'm quite curious what those ways are. I only know of the continuity argument and an argument involving determinant identities on block matrices. Would it be possible to provide a reference to some other methods? $\endgroup$
    – EuYu
    Feb 22, 2013 at 17:37
  • 1
    $\begingroup$ @EuYu, I have no reference, sorry. $\endgroup$ Feb 22, 2013 at 22:11
  • $\begingroup$ @EuYu one other method is the argument that matrices $A=(a_{ij})$ and $B=(b_{ij})$ are invertible over the field $K(a_{ij}, b_{ij})$ $\endgroup$
    – Bananach
    Feb 15, 2020 at 17:58
  • 1
    $\begingroup$ See this short note by JH Williamson from 1953 cambridge.org/core/services/aop-cambridge-core/content/view/… $\endgroup$
    – Bananach
    Feb 15, 2020 at 18:09

Hint: Consider $A = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}$ and $B = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}$. What do you get in that case?

  • 11
    $\begingroup$ This shows that $AB$ and $BA$ have different minimal polynomial. But characteristic polynomials are the same right? $\endgroup$
    – user464147
    Nov 25, 2017 at 1:39

It's not true that their characteristic polynomials will be the same in the general case. The best result in this general vein is the following.

Let $A\in\mathbb{F}^{m \times n}$ and let $B\in\mathbb{F}^{n \times m}$, and $AB$, $BA$ with minimal polynomials (over $\mathbb{F}$) $m_{AB}(x)$ and $m_{BA}(x)$ respectively. Then one of the following holds:

$m_{AB}(x) = m_{BA}(x)$, or $m_{AB}(x) = x \cdot m_{BA}(x)$, or $x\cdot m_{AB}(x) = m_{BA}(x)$.

It's easy, just use the fact that $(BA)^k=B(AB)^{k-1}A$.

  • $\begingroup$ in general means for m not equal to n?? $\endgroup$
    – Ri-Li
    Sep 16, 2014 at 21:16
  • 4
    $\begingroup$ The question says (and always has said) square matrices $A,B$. If you are answering a more general question, then you should announce this. Also, answering a more general question is only useful if this is no more difficult than the actual question, or if the more general solution sheds more light on the solution. $\endgroup$ Dec 23, 2015 at 21:10

Yes, $AB$ and $BA$ have the same characteristic polynomial.

Basic facts: $\det(A^T) = \det(A)$, $\det(AB) = \det(A) \det(B)$

  1. $A$ and $A^T$ share the same characteristic polynomial.

\begin{align*} \det(xI-A) = \det((xI-A)^T) = \det(xI-A^T) \end{align*}

  1. Similar matrices have the same characteristic polynomial. If $B = PAP^{-1}$,

\begin{align*} \det(xI - B) &= \det(xI - PAP^{-1}) \\ &= \det(P(xI - A)P^{-1}) \\ &= \det(P)\det(xI - A)\det(P^{-1}) \\ &= \det(xI - A) \end{align*}

  1. Determinant of a block triangular matrix (A special case of Schur's formula):

\begin{align*} \det \begin{pmatrix}A & B \\0 & C\end{pmatrix} = \det(A) \det(C) \end{align*}

Using block multiplication, please verify that $\begin{pmatrix}I & -A \\0 & I\end{pmatrix} \begin{pmatrix}AB & 0 \\B & 0\end{pmatrix} = \begin{pmatrix}0 & 0 \\B & BA\end{pmatrix} \begin{pmatrix}I & -A \\0 & I\end{pmatrix}$.

Therefore, the matrices $\begin{pmatrix}AB & 0 \\B & 0\end{pmatrix}$ and $\begin{pmatrix}0 & 0 \\B & BA\end{pmatrix}$ are similar, and have the same characteristic polynomial.

\begin{align*} \det\left[x\begin{pmatrix}I & 0 \\0 & I\end{pmatrix} - \begin{pmatrix}AB & 0 \\B & 0\end{pmatrix}\right] &= \det(xI - AB) \det(xI) \end{align*} \begin{align*} \det\left[x\begin{pmatrix}I & 0 \\0 & I\end{pmatrix} - \begin{pmatrix}0 & 0 \\B & BA\end{pmatrix}\right] &= \det(xI) \det(xI - BA) \end{align*}

And there it is. But $AB$ and $BA$ do not need to have the same minimal polynomial. See Jim's answer for a counterexample.


For square matrices, the characteristic polynomials are same, but for $A$ a matrix of size $m \times n$ and $B$ a matrix of size $n \times m$ we have $x^{m}C_{BA}(x)=x^{n}C_{AB}(x)$. This implies that the nonzero eigenvalue of $AB$, counted with multiplicities, are same as nonzero eigenvalue of $BA$.

That is, if $A$ is of size 7×4 and $B$ is of size 4×7 and assume that the 4×4 matrix $BA$ has nonzero eigenvalues 1,1,3 so fourth eigenvalue of $BA$ is 0. Then the 7×7 matrix $AB$ will also have nonzero eigenvalue 1,1,3 and remaining four eigenvalue of $AB$ are zero.


There are a lot of proofs for characteristic polynomials to be same. I want to provide mine. It may be more complicated, but it is less "consider magic product of matrices".

Let $\chi_M(x)$ denotes a characteristic polynomial $\chi_M(x) = \det(x - M)$.

For square matrices $A$ and $B$ we have $\det(AB - x) = \det(BA - x) \Leftrightarrow \chi_{AB}(x) = \chi_{BA}(x)$. We prove this by considering separately the two cases $\det(A)=0$ and $\det(A)\neq0$:

  1. If $\det(A) \neq 0$, then the statement follows from $$\det(AB - x) = \det(A^{-1}A)\det(AB - x) \\= \det(A^{-1})\det(AB - x)\det(A) = \det(BA - x).$$
  2. If $\det(A) = 0$, there are finite number of $s \in \mathbb R$ such that $\chi_A(s)=0$, because $\chi_A(s)$ is a finite-degree polynomial. Then there are infinitely many $s$ such that $\chi_A(s) \neq 0$. For all such $s$ we know $\chi_{(A-s)B}(x) = \chi_{B(A-s)}(x)$ as a result of a previous case. For every fixed $x$ we see two finite-degree polynomials ($x$ is fixed, $s$ is variable) $\chi_{(A-s)B}(x)$ and $\chi_{B(A-s)}(x)$ which are equal in infinite number of points. Then we conclude they are equal at every $s$. At $s = 0$ we get the result $\chi_{AB}(x) = \chi_{BA}(x)$ at every $x$.

This proves the statement for squared matrices.

Key fact (proof below): If $A$ is $m\times n$, $B$ is $n\times m$ and $n \geq m$ then $\chi_{BA}(x) = \lambda^{n-m}\chi_{AB}(x)$.

Consider $n\times n$ matrices $A' = \left(\dfrac{A}{0}\right)$ and $B' = (B\mid0)$. We just put zero rows and columns to make matrices $n\times n$.

First, $B'A' = BA \Rightarrow x - B'A' = x - BA \Rightarrow \chi_{B'A'}(x) = \chi_{BA}(x)$

Second, $A'$ and $B'$ are square matrices. Then due to the fact above we have $\chi_{B'A'}(x) = \chi_{A'B'}(x)$.

Third, $\chi_{A'B'}(x) = det(x - A'B') = det\begin{pmatrix}x - AB & 0 \\ 0 & \begin{matrix}x & 0 & \ldots & 0 \\ 0 & x & \ldots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \ldots & x \\\end{matrix}\end{pmatrix} = det(x - AB)x^{n - m} = x^{n-m}\chi_{AB}(x)$

So, we see $\chi_{BA}(x) = \chi_{B'A'}(x) = \chi_{A'B'}(x) = x^{n-m}\chi_{AB}(x)$

  • 1
    $\begingroup$ @user264745 Александр Тряпицын's proof of 2. is correct: For every fixed $x$, he said he views $\chi_{(A-s)B}(x)$ and $\chi_{B(A-s)}(x)$ as polynomials in $s$ which coincide on an infinite set, and concludes they are equal. The only trouble with this proof is that is works only on an infinite field. But this can be repaired by considering the infinite field "universal" for this situation: the field $K$ of rational fractions with rational coefficients and $2n^2$ indeterminates $X_{i,j},Y_{i,j}$, and the universal matrices $A,B\in M_n(K)$ whose entries are these indeterminates. $\endgroup$ Jan 12 at 11:21
  • 1
    $\begingroup$ I was about to type that "universal proof" as a new answer, but I discovered it was already given here by @anon $\endgroup$ Jan 12 at 11:44
  • $\begingroup$ @AnneBauval Unfortunately “universal proof” is far from my reach. I don’t know anything about field extension. $\endgroup$
    – user264745
    Jan 12 at 12:03
  • 1
    $\begingroup$ @user264745 I wanted to clean up this section and I thought my previous comment was sufficient. But if you take me by flattery, ok I shall rewrite it. And most other comments can be deleted please $\endgroup$ Jan 12 at 15:39
  • 1
    $\begingroup$ If $P(X),Q(X)\in\Bbb R[X]$ are such that $P(s)=Q(s)$ for infinitely many values of $s$ (or only for more than $\deg(P-Q)$ values) then $P(X)=Q(X)$ (i.e. their coefficients are equal) hence $P(s)=Q(s)$ for every $s.$ Александр Тряпицын applies this to $P(X)=\chi_{(A-X)B}(x),Q(X)=\chi_{B(A-X)}(x)$ for $x$ fixed. $\endgroup$ Jan 12 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .