# Write the difference of 2 density operators in terms of a spectral decomposition

An exercise question (9.7) from Quantum computation and Quantum Information by Michael E. Nielson and Isaac L. Chuang says that I can write the difference of any 2 arbitrary density operators $$\rho,\sigma$$ as a spectral decomposition: $$\rho - \sigma = U D U^\dagger$$ But for this to be true, isn't it necessary that the density matrices must commute? From what I understand, I will need an orthonormal basis in which both will be diagonalizable. Based on the Simultaneous diagonalizable theorem this is only the case when $$\rho$$ and $$\sigma$$ commute.

What am I missing?

If the density matrices commute then there exists a joint spectral decomposition of both $$\rho$$ and $$\sigma$$. I.e. there exists a unitary $$U$$ and diagonal positive semidefinite matrices $$D_{\rho}$$ and $$D_{\sigma}$$ such that $$\rho = U D_{\rho} U^\dagger \qquad \text{and} \qquad \sigma = U D_{\sigma} U^\dagger.$$ Note that here you are diagonalizing two different matrices using the same unitary.
The statement you're actually concerned with is different. You're asking whether a single matrix $$X := \rho - \sigma$$ can be diagonalized. But this is true as $$X$$ is Hermitian and so the spectral theorem applies.