trace of $(I_m + AA^T)^{-1}$ and $(I_n + A^TA)^{-1}$ for real matrix A Let $A$ be $m \times n$ real matrix.
(1) Show that $X=I_m + AA^T$ and $Y=I_n+A^TA$ are invertible.
(2) Find the value of $tr(X^{-1}) - tr(Y^{-1}) $

attempt for (1):
$AA^T$ is a real symmetric matrix, therefore can be diagonalized. Let $\lambda$ be a eigenvalue of $AA^T$ and $v$ eigenvector. Then $0\leq \| A^Tv \|^2=v^TAA^Tv=\lambda v^Tv$ so $\lambda \geq0$. This shows that all eigenvalues of $X$ are positive, therefore invertible. Proof for $Y$ is similar.
But I cannot solve (2) from this result. All I know is that $X^{-1}$ and $Y^{-1}$ makes sense.
 A: Hints: For any matrices $A$ and $B$ that can be multiplied in both orders, $AB $ and $B A$ have the same nonzero eigenvalues.  The eigenvalues of $(I+AB)^{-1}$ (if that exists) are the reciprocals of the eigenvalues of $I+AB$.
A: As Robert Israel write in his answer, $AB$ and $BA$ have the same nonzero eigenvalues where $A$ is a $m \times n$ matrix and $B$ is a $n \times m$ matrix. To see this, Suppose $\lambda \neq 0$ is an eigenvalue for $AB$ with an eigenvector $v$. Then $Bv \neq 0$ as $0 \neq \lambda v=(AB)v=A(Bv)$. Moreover $BA(Bv)=B(ABv)=B(\lambda v)=\lambda (Bv)$ so $Bv$ is an eigenvector of $BA$ with eigenvalue $\lambda$.
It could be happen that $AB$ has eigenvalue $0$ and $BA$ hasn't. For example, put $$A= \begin{bmatrix} 1 & 0 \\ 0 & 0 \\ 0 & 1 \end{bmatrix},~ B=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}  $$ Then $$ AB=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0\\ 0 & 0 & 1  \end{bmatrix}, ~ BA=\begin{bmatrix} 1 & 0  \\ 0 & 1  \end{bmatrix} $$
Now multiplicity issue is remained. Suppose that $v_1, \dots , v_s$ are linearly independent eigenvectors of $AB$ with eigenvalue $\lambda_1, \dots, \lambda_s$ (respectively), where $\lambda_1 \lambda_2 \cdots \lambda_s \neq 0$. Then $Bv_1,  \dots, Bv_s$ are linearly independent. If $c_1 B v_1 + \cdots + c_s B v_s=0$ for $c_i$ scalars, then \begin{align} 0 &=A(c_1 B v_1 + \cdots + c_s B v_s) \\ &=c_1 AB v_1 + \cdots + c_sAB v_s \\&=c_1 \lambda_1 v_1 + \cdots + c_s \lambda_s v_s \end{align}
Thus all $c_i \lambda_i=0$, i.e. $c_i =0$.
Now return to your problem. Previous observation shows $X^{-1}$ and $Y^{-1}$ has share eigenvalues with same multiplicity except $1$, so $\operatorname{tr}(X^{-1})- \operatorname{tr}(Y^{-1})=m-n$.
