# Factoring a product of matrices out of an inverse

I'm going through a linear algebra related proof, and don't understand the following steps. Can someone help me figure out what's going on? In the steps below, $$Q\Lambda Q^T$$ is an eigenvalue decomposition of a positive-definite symmetric matrix where $$Q^{-1} = Q^T$$ (I think). The steps are as follows:

(1) $$f(t) = \text{trace}\left(Z^{-1}(I+tQ\Lambda Q^T)^{-1}\right)$$

(2) $$f(t) = \text{trace}\left(Z^{-1}Q(I+t\Lambda)^{-1}Q^T\right)$$

(3) $$f(t) = \text{trace}\left(Q^T Z^{-1}Q(I+t\Lambda)^{-1}\right)$$

My question is twofold: first, how did they get from step (1) to (2)? Can you factor out matrices when the entire thing is inverted? Second, from (2) to (3), what allows the $$Q^T$$ to get moved to the left side of $$Z^{-1}$$ ?

I haven't learnt linear algebra in a long long time so any help would be much appreciated!

• To get from (1) to (2), recall that $I = QIQ^{-1}$ and from there just use the fact that multiplication is distributive over addition (i.e. take out your common factors on the left and then the right). – jmacmanus Feb 8 at 17:36
• I got that part, up to $(Q(I+t\Lambda)Q^T)^{-1}$. How do the "Q"s get taken out of the inverse and become $Q(I+t\Lambda)^{-1}Q^T$ ? – SharKCS11 Feb 8 at 17:44
• Ah, recall that $(AB)^{-1} = B^{-1}A^{-1}$ and this together with the fact $Q^{-1} = Q^{T}$ will hopefully clarify how that works. – jmacmanus Feb 8 at 18:08
• $(Q X^{-1} Q^{-1}) (Q X Q^{-1}) = I$, so $(Q X Q^{-1})^{-1} = Q X^{-1} Q^{-1}$ whenever $X$ is invertible. Now use the fact that $Q^T = Q^{-1}$. – Robert Israel Feb 8 at 18:11
• Oh, thanks! Now (1) to (2) is very clear. – SharKCS11 Feb 8 at 18:18