I'm working on a problem for my thermal physics course and got stuck when trying to evaluate a specific sum. Looking at the solutions, they transformed the sum into an integral. For some reason, I have never come across this in my physics career. The specific transformation I'm referring to is this:
$$\sum_{n=0}^\infty \lambda \exp(-\varepsilon_n / \tau) = \frac{\pi}{2}\int_0^\infty \lambda \exp(-\varepsilon_n / \tau) n \ \mathrm dn $$
What are the conditions to be able to evaluate a sum in this manner and what is the method to be able to find this integral?
EDIT: It seems I should be a little more specific regarding the problem. The exact question I'm working on is:
Find the chemical potential of an ideal monatomic gas in two dimensions, with $N$ atoms confined to a square area $A=L^2$. The spin is zero.
For this system, $$\varepsilon_n = \frac{\hbar^2 \pi^2}{2m} \frac{(n_x^2 + n_y^2)}{L^2} = \alpha \frac{n^2}{A} $$
For $\alpha = \frac{\hbar^2 \pi^2}{2m}$
I did find the formula for the transformation in the book, but there is no derivation. They give it as fact, which I don't really like. Any help with why this is possible would be appreciated.
Thank you.
EDIT 2:
I believe I found a mistake in my book. In one area they use the expression I listed above, but in another there is an $n^2$ instead of an $n$. i.e.,
$$\sum_{n=0}^\infty \lambda \exp(-\varepsilon_n / \tau) = \frac{\pi}{2}\int_0^\infty \lambda \exp(-\varepsilon_n / \tau) n^2 \ \mathrm dn $$
Does this fix any issues with my question?