How to transform an expression into a form involving the trace of a product of two matrices In page 594 of Bishop's PRML, the following equation is implied:
$$
-\frac{1}{2}\sum(\mathbf{x}_n-\mathbf{\bar{x}})^T\mathbf{C}^{-1}(\mathbf{x}_n-\mathbf{\bar{x}}) = -\frac{N}{2}\mathrm{Tr}(\mathbf{C}^{-1}\mathbf{S})
$$
where 
$$
\mathbf{S} = \frac{1}{N}\sum(\mathbf{x}_n-\mathbf{\bar{x}})(\mathbf{x}_n-\mathbf{\bar{x}})^T
$$
,$\mathbf{C}$ is a symmetric matrix and $\mathbf{\bar{x}} = \frac{\sum_{n=1}^N\mathbf{x}_n}{N}$.
I want to derive this equation myself. But I'm not sure how to do it. Could someone show why the equation holds?
 A: Guide:
Notice that $(x_n - \bar{x})^TC^{-1}(x_n - \bar{x})$ is a scalar, 
hence $$(x_n - \bar{x})^TC^{-1}(x_n - \bar{x})= \operatorname{Tr}\left[(x_n - \bar{x})^TC^{-1}(x_n - \bar{x})\right]=\operatorname{Tr}\left[C^{-1}(x_n - \bar{x})(x_n - \bar{x})^T\right]$$
since $\operatorname{Tr}(AB)=\operatorname{Tr}(BA)$.
Hopefully you can take it from here. 
A: With the help of Siong Thye Goh, I did the following:
\begin{align}
-\frac{1}{2}\sum_{n=1}^N(\mathbf{x}_n - \mathbf{\bar{x}})^T\mathbf{C}^{-1}(\mathbf{x}_n - \mathbf{\bar{x}}) &= -\frac{1}{2}\sum_{n=1}^N\mathrm{Tr}[(\mathbf{x}_n - \mathbf{\bar{x}})^T\mathbf{C}^{-1}(\mathbf{x}_n - \mathbf{\bar{x}})]\\
&= -\frac{1}{2}\sum_{n=1}^N\mathrm{Tr}[\mathbf{C}^{-1}(\mathbf{x}_n - \mathbf{\bar{x}})(\mathbf{x}_n - \mathbf{\bar{x}})^T]\\
&= -\frac{1}{2}\mathrm{Tr}[\sum^N_{n=1}\mathbf{C}^{-1}(\mathbf{x}_n - \mathbf{\bar{x}})(\mathbf{x}_n - \mathbf{\bar{x}})^T]\\
&= -\frac{1}{2}\mathrm{Tr}[\mathbf{C}^{-1}\sum_{n=1}^N(\mathbf{x}_n - \mathbf{\bar{x}})(\mathbf{x}_n - \mathbf{\bar{x}})^T]\\
&= -\frac{1}{2}\mathrm{Tr}[\mathbf{C}^{-1}N\mathbf{S}] = -\frac{N}{2}\mathrm{Tr}[\mathbf{C}^{-1}\mathbf{S}]
\end{align}
