TITLE: Integral of greatest integer function divided by an exponential
QUESTION [5 upvotes]: If $\lfloor x \rfloor$ denotes the greatest integer not exceeding $x$, then find $\displaystyle\int_{0}^{\infty} \displaystyle \frac{\lfloor x \rfloor}{e^{x}} dx$. The correct answer is supposed to be $\frac{1}{e-1}$.
In order to wrap my head around this problem, I wanted to see if there was a pattern for what was going on for each of the integrals $\displaystyle \int_{n}^{n+1}\displaystyle \frac{\lfloor x \rfloor}{e^{x}}dx$. Each one is equal to $\displaystyle \frac{n(e-1)}{e^{n+1}}$. I figured then that a good way to solve this problem, then, was to sum up the infinite series, $\displaystyle \sum_{n=0}^{\infty}\frac{n(e-1)}{e^{n+1}}$.
Now, I believe that this series must converge, since the trapezoids formed by the x-axis and each $\displaystyle \frac{n}{e^{x}}$ become infinitesimally small as $n$ gets large. However, it's not a geometric series, so I am not sure how to find what it converges to, which, from the answer to the problem, must be $\frac{1}{e-1}$.
Am I going about this in an unnecessarily complicated way, and is there a simpler method to evaluate this integral? If not, what is the piece that I'm missing? Thanks :)

REPLY [2 votes]: Another method consists in using a Fourier series :

Of course, it's not so easy, but it's a nice exercise !