Hyperbolic matrices with same eigenvectors 
Suppose $A,B\in GL(2,\mathbb Z)$, and $AB=BA$. If $A,B$ are hyperbolic, i.e. their eigenvalues do not have length $1$, show that $A^n=B^m$ for some integers $n,m$ ($n^2+m^2\ne 0$).

I have tried to prove it using basic linear algebra. Suppose $v$ is a common eigenvector and $$Av=\lambda v,\quad Bv=\mu v.$$ We only need to show that $\lambda^n=\mu^m$. I expand the two identities above but cannot find anything useful. 
Should we take into some background knowledge of hyperbolic automorphisms of $\mathbb T^2$?
 A: Note that for any matrix in $GL(2, \mathbb{Z})$, the product of its eigenvalues equals $\pm 1$. Therefore, if the matrix must also be hyperbolic, the two eigenvalues must be distinct and thus we also know the characteristic polynomial is irreducible of degree 2.
Since $A$ and $B$ commute and each have their two eigenvalues distinct, we can find a common basis of eigenvectors $v, w \in \mathbb{C}^2$.
Let us write $f,g \in \mathbb{Z}[X]$ for the characteristic polynomials of $A$ and $B$, respectively. It follows that the eigenvectors of $A$ and $B$ must lie in $(\mathbb{Q}(f))^2 \subset \mathbb{C}^2$ and $(\mathbb{Q}(g))^2 \subset \mathbb{C}^2$, respectively, where $\mathbb{Q}(f)$ is the splitting field of $f$ over $\mathbb{Q}$ seen as a subset of $\mathbb{C}$. We thus have that $v,w$ lie in $(\mathbb{Q}(f) \cap \mathbb{Q}(g))^2$. Note that if $\mathbb{Q}(f) \cap \mathbb{Q}(g) = \mathbb{Q}$, then the eigenvectors are rational which implies the eigenvalues are rational as well. Since the eigenvalues are also algebraic units it follows they must be equal to $\pm 1$ (since these are the only algebraic units in $\mathbb{Q}$), which contradicts the hyperbolicity of $A$ and $B$. We thus conclude that $\mathbb{Q}(f) = \mathbb{Q}(g)$.
Let $\lambda, \mu$ be the eigenvalues of $v$ for the matrices $A$ and $B$, respectively. Then $\lambda$ and $\mu$ are algebraic units in the same degree two number field $\mathbb{Q}(f)$. By Dirichlet's unit theorem (applied to a number field of degree 2), there exist non-zero integers $n,m$ such that $\lambda^n = \mu^m$. If $\sigma$ is the non-trivial field automorphism of $\mathbb{Q}(f)$, then the eigenvalues of $w$ for $A$ and $B$ are $\sigma(\lambda)$ and $\sigma(\mu)$, respectively. Now it also holds that $\sigma(\lambda)^n = \sigma(\lambda^n) = \sigma(\mu^m) = \sigma(\mu)^m$. This proves that $A^n = B^m$.
