# Evaluating the integral $\int_{0}^{\infty} \Bigl\lfloor{\frac{n}{e^{x}}\Bigr\rfloor} \ dx$

How to evaluate this integral: $$\int_{0}^{\infty} \biggl\lfloor{\frac{n}{e^{x}}\biggr\rfloor} \ dx,$$where $n \in \mathbb{N}$.

The same integral when asked to evaluate for $n=2$ (say) i can do it by splitting the limits from $x = 0$ to $x = \log{2}$ where $e^{x}$ takes the value 1, and then from $x= \log{2}$ to $x = \infty$. But how to do this for the general case $n$. I thought of two ways:

• Using induction on $n$. This will not work!

• Splitting the limits from $x =0$, to $x = \log{n}$ also seems to cause some problems for me.

-

The integrand will only take on integral values m, and only for a finite measure of x values. The interval of x values in which the integrand equals exactly m is $(- \ln \frac{m+1}{n} , - \ln \frac{m}{n} ]$. Split the integral over these intervals, evaluate (upper bound of interval minus lower bound times m) and turn them into a summation as $$\sum_{m=1}^n m \left( \ln \frac{m+1}{m} \right) = \ln \prod_{m=1}^n \left( 1 + \frac{1}{m} \right)^m$$
@chroma The giant product actually simplifies nicely (by telescopic cancellation) to $$\frac{(n+1)^n}{n!}.$$ –  Srivatsan Sep 10 '11 at 15:35