There is a nice derivation provided in the book "Statistical Mechanics" by Pathria. The derivation is quite simple actually. Although the derivation is simple, you need to be familiar with the basic concepts of quantum mechanics, such as the density matrix, and also the basic concepts of statistical mechanics, such as grand canonical ensemble.