# In which cases are the main diagonal elements of a product of positive definite matrices positive?

Let $A$ and $B$ be symmetric positive definite (pd) $n \times n$ matrices and $C = A \cdot B$. In which cases is then every $c_{ii}$, the $i$-th main diagonal elements of $C$, positive?

When $A$ and $B$ are diagonal matrices (i.e. all off-diagonal entries are $0$) this is true since in this case $c_{ii} = a_{ii} \cdot b_{ii} > 0$, with $a_{ii} > 0 \land b_{ii} > 0$. Also when $A\cdot B = B \cdot A$, $C$ is pd with positive main diagonal elements.

For non diagonal matrices and non commuting matrices I found an example where $c_{33} < 0$: $A = \begin{pmatrix} 2 & 0 & -0.58 \\ 0 & 2 & -0.19 \\ -0.58 & -0.19 & 0.81\end{pmatrix}$ and $B = \begin{pmatrix} 2 & 0 & 0.36 \\ 0 & 2 & 0.31 \\ 0.36 & 0.31 & 0.30\end{pmatrix}$ results in $C = \begin{pmatrix} 3.7912 & -0.1798 & 0.5460 \\ -0.0684 & 3.9411 & 0.5630 \\ -0.8684 & -0.1289 & -0.0247\end{pmatrix}$.

It would also help to know if it would held in every scenario in $n = 2$.