Is the trace of the product of two positive semidefinite matrices always nonnegative?
Solution 1:
Yes, because $\mathrm{tr}(XY)=\mathrm{tr}(X\sqrt Y\sqrt Y)=\mathrm{tr}(\sqrt Y X\sqrt Y)\geq 0$.
Positive semidefinite matrices have positive semidefinite square roots. The trace satisfies $\mathrm{tr}(AB)=\mathrm{tr}(BA)$. If $A$ and $X$ are positive semidefinite, then so is $AXA$. The trace of a positive semidefinite matrix is nonnegative.
Solution 2:
Let $n \times n$ matrices $\rm A$ and $\rm B$ be symmetric and positive semidefinite. Hence, there exists an $n \times r$ matrix $\rm Q$ such that $\rm B = Q Q^\top$, and
$$\mbox{tr} \left( {\rm A} {\rm B} \right) = \mbox{tr} \left( {\rm A} {\rm Q} {\rm Q}^\top \right) = \mbox{tr} \left( {\rm Q}^\top {\rm A} {\rm Q} \right) = \sum_{i=1}^r \underbrace{{\rm q}_i^\top {\rm A} \, {\rm q}_i}_{\geq 0} \color{blue}{\geq 0}$$
where ${\rm q}_i$ is the $i$-th column of $\rm Q$ and ${\rm q}_i^\top {\rm A} \, {\rm q}_i \geq 0$ follows from the positive semidefiniteness of $\rm A$.