similar matrices over $\mathbb{Z}$ Let $A,B$ be $2\times 2$ matrices over $\mathbb{Z}$. Suppose $x^2+x+1$ is the characteristic polynomial for both $A,B$. Determine whether $A,B$ are similar to each other over $\mathbb{Z}$. How to solve?

Well, if you know the characteristic polynomial, you know the trace ($-1$) and the determinant ($1$), so you should be able to write the general matrix using two (integer) unknowns [for example, if the $1, 1$ entry is $a$ then the $2, 2$ entry is $-1-a$). Now, you have your two possible matrices $M_1$ and $M_2.$ Being similar, means that there exists a matrix $Q$ such that $M_1 Q = Q M_2,$ which is a system of linear diophantine equations. It either always has a solution or not.
