Let $T:V\rightarrow W$ be a linear map of inner product spaces with $T^\ast$ the dual map. I am to calculate $f(\lambda)=\operatorname{tr}e^{-\lambda T^\ast T}-\operatorname{tr}e^{-\lambda TT^\ast }$. Is my solution correct?
Solution: $TT^\ast , T^\ast T$ are both symmetric hence unitarily diagonalizable by some $P$. Hence $f(\lambda)=\operatorname{tr}(Pe^{-\lambda D^2}P^\ast-\operatorname{tr}(P^\ast e^{-\lambda D^2}P$), which is in turn zero by the cyclic property of the trace. ($D$ is the diagonal matrix corresponding to $T$.)
You have the right basic idea. Note, however, that $TT^*$ and $T^*T$ are not necessarily simultaneously diagonalizable. That is, we can't use the same $P$ for both matrices. They are, however, symmetric with the same eigenvalues, which is enough.