Here we will show how the entropy can be related to the partition function without resorting to Helmholtz free energy . From the first law
In the last transition we used the relation between the partition function and the energy. Integrating the last equation yields
We use integration by parts to simplify the last integral
which reproduces the known result.