In the derivation of the Fermi-Dirac and Bose-Einstein distributions, we compute the Grand Partion Function ##Q##. With ##Q##, we can compute the espection value of the occupation number ##n_{l}##. This is the number of particles in the same energy level ##\varepsilon _{l}##. The book I am reading write $$\langle n_{l} \rangle = - \frac{1}{\beta} \frac{\partial \ }{\partial \varepsilon _{l}}\ ln \ Q,$$ but the book dosen't deduce this equation. I know that the expection value of the number operator ##\hat{N}## is given by $$\langle \hat{N} \rangle = z \frac{\partial \ }{\partial z}\ ln \ Q,$$ where ##z = e^{\beta \mu}## ( ##\mu## is the chemical potential, and I am using the Grand Canonical Ensemble), and that the eigenvalues of ##\hat{N}## are ##N = \sum _{l} n_{l}##. How the first equation follow from these relations?