Reordering of matrix multiplication I want to compute the matrix multiplication $ABA$, where $A$ and $B$ are real and orthogonal matrices. In fact, they are specifically $3\times3$ rotation matrices.  However, it is much easier if I can reverse the order of $BA$ somehow, because I can then perform the multiplication much easier.
I know that matrix multiplication is not commutative, however, I am asking because both $A$ and $B$ are orthogonal matrices, and hopefully, may be there is some trick to utilize their orthogonality to reorder the product.
I tried to solve this, but got stuck here:
$$
ABA = A((BA)^{-1})^{-1}=A(A^{-1}B^{-1})^{-1}
$$
Is there a way to proceed from here?
Edit:
I also know that matrix multiplication is associative; however, I am not after associativity here. I want to multiply the $A$ matrix by $A$ (or by its inverse/transpose), then multiply the result by $B$.
Edit:
To put this into context, consider the following product of rotation matrices
$$
R_x(\theta)R_z(\pi)R_x(\theta)
$$
where, $R_x(\theta)$ is the rotation matrix about the $x$-axis by $\theta$, and $R_z(\pi)$ is the rotation matrix about the $z$-axis by $\pi$.
This product simplifies to $R_z(\pi)$. Is it possible to come to this conclusion without carrying out the matrix multiplication of the three rotation matrices? It looks that the $R_x(\theta)$ got cancelled somehow.
 A: Sadly, no. As @TobyMak points out, the associativity
$$
A(BA) = (AB)A
$$
means you can choose to evaluate either $AB$ or $BA$ but there's no trick that will allow you to work with $A^2$. 
You can probably show that with an example in which $A^2 = I$.
A: I take it that what you're trying to get at is that you have some matrix $A$ that you will use several times with several different other matrices in the place of $B.$
You would like some way to precompute a matrix $M_A$ by doing some operations on $A$
so that for any matrix $B$ you have $ABA = M_A B.$
First of all, if this is true in general it is true when $B=I,$ and therefore
$AIA = M_AI$ implies $M_A = A^2.$
But then for the formula to work in general you need $ABA = A^2 B$,
which implies $BA = AB,$ that is, the matrices have to commute.

In your particular example, the rotation $R_z(\pi)$ maps the axis of $R_x(\theta)$ onto itself, but reversed. Hence the initial rotation by $\theta$ becomes a rotation by $-\theta$. You will not get such a nice result for any $B$ that is not a rotation by a multiple of $\pi$, and even when $B = R_z(\pi)$ you will not get such a nice result for any non-trivial rotation around an axis that is not either the $z$ axis or an axis in the $x,y$ plane. 
A: $$ABA = (AB)A$$
since matrix multiplication is associative. One proof of this is on this other post on Math SE.
