# Trace of product of matrices

Problem: Let $\{A_r\},\{B_r\},\{C_r\}$ each be families of (determinant 1) 2x2 matrices in $SL(2,\mathbb{R})$ such that each family is continuously indexed by a parameter $0<r<1$. Is there a known formula for calculating $tr(W)$, where $W$ is $(A_rB_rC_r)^nA_r$, $(A_rB_rC_r)^nA_rB_r$, or $(A_rB_rC_r)^n$?

Progress thus far: The indexing is sufficiently complicated that simply multiplying and looking for a pattern has not been successful. Each entry of each family is a ratio of quadratics in $r$, and I do not remember the right computational linear algebra to attack this problem.

Motivation: the families of matrices represent isometries of the hyperbolic plane, and I am interested in knowing when such isometries change from elliptic to parabolic to hyperbolic

-
I've adjusted the question to say that I'm looking at matrices with determinant 1. I only care about the absolute value of the trace, but I'm looking to plot it as a function of the indexing variable $r$, so a polynomial output would be nice. – KReiser Aug 1 '12 at 2:07
If you can solve for the eigenvalues and eigenvectors of $A_r B_r C_r$ as a function of $r$ (this is something of a big if), then you can work over $\mathbb{C}$ and change basis so that $A_r B_r C_r$ is in Jordan normal form. Things are not so bad from here. – Qiaochu Yuan Aug 1 '12 at 2:22
Instead of thinking of them as families of matrices in $SL(2,\mathbb R)$, you can instead think of them as single matrices $A,B,C \in SL\big(2,{\mathbb R}(r)\big)$. – Greg Martin Aug 1 '12 at 5:53

$\def\Tr{\mathrm{Tr}}$Let $M(r) = A(r) B(r) C(r)$. Let the characteristic polynomial of $M(r)$ be $$\lambda^3 + x(r) \lambda^2 + y(r) \lambda + z(r)$$ Each of $x(r)$, $y(r)$ and $z(r)$ is a rational function, computable by a computer algebra system.
The Cayley-Hamilton theorem tells you that $$M(r)^3 + x(r) M(r)^2 + y(r) M(r) + z(r)=0$$ so $$\Tr M(r)^{n+3} = - x(r) \Tr M(r)^{n+2} - y(r) \Tr M(r)^{n+1} - z(r) \Tr M(r)^n$$ So this gives a linear recursion for $\Tr M(r)^n$ which you can use to compute $\Tr M(r)^n$ pretty easily, and similarly for your other traces.