While studying Lebesgue integration, I have been asked to show the following equality. $$\int_0^\infty \frac{\sin x}{e^x-1}dx = \sum_{n=1}^\infty \int_0^\infty e^{-nx} \sin x dx = \sum_{n=1}^\infty \frac{1}{n^2+1}$$
Where the integrals are improper Riemann integrals. Here is my attempt. Integration by parts gives the second equality, so I have no problem with that. From the geometric series expansion of $\frac{1}{1-e^x}$ I do get $$\int_0^\infty \frac{\sin x}{e^x-1}dx = \int_0^\infty \sum_{n=1}^\infty e^{-nx} \sin x dx$$ First equality seems to follow if I could swap the order of the sum and integral. I tried applying Levi's theorem setting $f_n=e^{-nx}\sin x$ but have trouble because I can't see if $\sum_{n=1}^\infty \int_0^\infty |f_n| \lt \infty$, which is the condition for the Levi's theorem to hold.