# Where did this derivative term come from in this derivation? [closed]

I am stuck in the way this textbook shows how Planck arrived in the conclusion that the energy of a particle must be discrete. I have done the following, assuming that the energy $$\Delta E$$ is discrete, we cannot integrate it, thus we use the sum as it follows. $$\langle E \rangle = \frac{\sum^{\infty}_{n =0}n\cdot \Delta E \cdot f(n\Delta E) }{f(n\Delta E)}$$ where f is still the Boltzmann distribution, $$f(n\Delta E) = \frac{e^{\frac{-n\Delta E}{KT}}}{KT}$$ so, $$\langle E \rangle = \frac{\Delta E(0e^{\frac{-0\Delta E}{KT}}+1e^{\frac{-1\Delta E}{KT}}+2e^{\frac{-2\Delta E}{KT}}+\dots)}{e^{\frac{-0\Delta E}{KT}}+e^{\frac{-1\Delta E}{KT}}+e^{\frac{-2\Delta E}{KT}}\dots}= \frac{\Delta E e^{\frac{-\Delta E}{KT}}(0 + 1 + 2e^{\frac{-\Delta E}{KT}}+3e^{\frac{-2\Delta E}{KT}}+\dots)}{(1 + e^{\frac{-1\Delta E}{KT}}+e^{\frac{-2\Delta E}{KT}}+ \cdots)}$$ where, $$(0 + 1 + 2e^{\frac{-\Delta E}{KT}}+3e^{\frac{-2\Delta E}{KT}}+\dots) = \frac{1}{(1-e^{\frac{-\Delta E}{KT}})^2}$$ and, $$(1 + e^{\frac{-1\Delta E}{KT}}+e^{\frac{-2\Delta E}{KT}}+ \cdots) = \frac{1}{1-e^{\frac{-\Delta E}{KT}}}$$ and then, $$\langle E \rangle = \frac{\Delta E(1 - e^{\frac{-\Delta E}{KT}})}{(1 - e^{\frac{-\Delta E}{KT}})^2} = \frac{\Delta E}{(e^{\frac{\Delta E}{KT}} - 1)}$$

but in the textbook I am using, there is a derivative out of nowhere, can anyone explain me where it comes from?

$$\frac{\mathrm d}{\mathrm dx}\ln f(x)=\frac{f'(x)}{f(x)},$$
which can be quickly deduced using the chain rule. Because of this identity, $$\frac{f'}{f}$$ is also called the logarithmic derivative of $$f$$. Now they just apply this identity to
$$\frac{\sum_{n=0}^\infty n\alpha e^{-n\alpha}}{\sum_{n=0}^\infty e^{-n\alpha}}=-\alpha\frac{\sum_{n=0}^\infty -n e^{-n\alpha}}{\sum_{n=0}^\infty e^{-n\alpha}}.$$
On the right side it is easy to see that the numerator is the derivative of the denominator with respect to $$\alpha$$, so the fraction is just the logarithmic derivative of the denominator.