Currently self-studying QFT and The Standard Model by Schwartz and I'm stuck at equation 1.5 in Part 1 regarding black-body radiation So basically the equation is basically a derivation of Planck's radiation law and I can't somehow find any resources as to how he derived it by adding a derivative inside. Planck says that each mode of frequency $\omega_n$ can be excited by $j$ times which gives the energy of the form $jE_n = j(\hbar\omega_n)$
This is equation 1.5:
$$\langle E_n \rangle = \frac{\sum_{j=0}^\infty (jE_n)e^{-jE_n\beta}}{\sum_{j=0}^\infty e^{-jE_n\beta}} = \frac{-\frac{d}{d\beta}\frac{1}{1-e^{-\hbar\omega_n\beta}}}{\frac{1}{1-e^{-\hbar\omega_n\beta}}} = \frac{\hbar\omega_n}{e^{\hbar\omega_n\beta}-1}\tag{1.5}$$
Where $\beta = \frac{1}{k_BT}$.
In short, I just don't get where the $-\frac{d}{d\beta}$ comes from. I also don't get how the summations disappear. Hope to get answers before I continue this book.
 A: It just a clever use of the geometrical series:
$$\frac{1}{1-q} = \sum_{j=0}^\infty q^j$$
which is valid for any real number $q<1$.
Here $q = e^{-E_n\beta} \equiv e^{-\hbar\omega_n\beta}$. As long as the energies $E_n >0$ which is certainly fulfilled, we can make use of the geometrical series. And only this. The parameter $q=q(\beta)$ is a function of $\beta$, so we can take the derivative of it:
$$-\frac{d}{d\beta} \frac{1}{1-q(\beta)}  = -\frac{d}{d\beta}  \sum_{j=0}^\infty q(\beta)^j=-\sum_{j=0}^\infty \frac{d}{d\beta}q(\beta)^j =-\sum_{j=0}^\infty q'(\beta) j  q(\beta)^{j-1}$$
where in the last step the chain rule was used. We compute the derivative of $q(\beta)$: $q'(\beta) = -E_n e^{-E_n\beta}  = -E_n q(\beta)$.
In the next step we plug this result into the sum:
$$-\sum_{j=0}^\infty q'(\beta) j  q(\beta)^{j-1} = -\sum_{j=0}^\infty (-E_n) q(\beta)j  q(\beta)^{j-1} = \sum_{j=0}^\infty jE_n  q(\beta)^j = \sum_{j=0}^\infty jE_n e^{-jE_n\beta}$$
quod est demonstrandum.
One only has to plug it now into the expression for $\langle E_n\rangle$.
