# Stuck on this integral involving exp and the floor function

Here is the integral
$$\int_0^\infty \lfloor x \rfloor e^{-x}dx$$

Here is what I have so far:
$$I = \sum_{n=0}^\infty \int_n^{n+1} n e^{-x}dx$$ $$= \sum_{n=0}^\infty -ne^{-n-1} + ne^{-n}$$ $$= \sum_{n=0}^\infty -ne^{-n-1} + ne^{-n}$$ $$= \sum_{n=0}^\infty ne^{-n}(1 -e^{-1})$$ $$= (1 -e^{-1})\sum_{n=0}^\infty ne^{-n}$$ $$= (1 -e^{-1})\sum_{n=0}^\infty \sum_{k=0}^{\infty} \frac{-(-n)(-n)^k}{k!}$$ $$= (1 -e^{-1})\sum_{n=0}^\infty \sum_{k=0}^{\infty} \frac{-(-n)^{k+1}}{k!}$$ $$= (1 -e^{-1})\sum_{n=0}^\infty \sum_{k=0}^{\infty} \frac{-(-n)^{k+1}}{(k+1)!}(k+1)$$ $$= (1 -e^{-1})\sum_{n=0}^\infty \sum_{k=0}^{\infty} \frac{-k(-n)^{k+1}}{(k+1)!} + \frac{-(-n)^{k+1}}{(k+1)!}$$

$$= (1 -e^{-1})\sum_{n=0}^\infty (1-e^{-n})[\sum_{k=0}^{\infty} \frac{-k(-n)^{k+1}}{(k+1)!}]$$

At this point I gave up.

-
If you let $I=\sum_{n=0}^{\infty}n e^{-n}$ and take a look at $I/e$, I think you can find a way to compute it easily. – Patrick Li Feb 16 '13 at 1:48
Mark, you can get a genuine summation symbol with \sum; \Sigma doesn’t size properly. – Brian M. Scott Feb 16 '13 at 1:53

You have

\begin{align*} \sum_{n\ge 0}\int_n^{n+1}ne^{-x}dx&=\sum_{n\ge 0}n\left[\frac1{e^x}\right]_{n+1}^n\\\\ &=\sum_{n\ge 0}n\left(\frac1{e^n}-\frac1{e^{n+1}}\right)\\\\ &=\left(1-\frac1e\right)\sum_{n\ge 0}\frac{n}{e^n}\;.\tag{1} \end{align*}

Now $$\frac1{1-x}=\sum_{n\ge 0}x^n$$ for $|x|<1$, so, differentiating and multiplying by $x$, we have

$$\frac{x}{(1-x)^2}=\sum_{n\ge 0}nx^n\;.\tag{2}$$

Substitute $x=e^{-1}$, and $(1)$ becomes

$$\left(1-\frac1e\right)\frac{e^{-1}}{\left(1-e^{-1}\right)^2}=\frac{e-1}e\cdot\frac{e}{(e-1)^2}=\frac1{e-1}\;.$$

$(2)$ is a useful formula; it’s worth at least remembering how to derive it.

-
Beautiful! I would have not thought to use the derivative. – Mark Feb 16 '13 at 2:06

Note that,

$$\sum_{k=0}^{\infty} e^{-k x} = \frac{1}{1-e^{-x}} \implies -\sum_{k=0}^{\infty}k e^{-k x}$$

$$= \frac{d}{dx}\frac{1}{1-e^{-x}}.$$

${}{}$

-
@anorton: Thanks for the edit. – Mhenni Benghorbal Feb 16 '13 at 1:59

$$\int_0^\infty \lfloor x \rfloor e^{-x}dx = \sum_{n=1}^{\infty} \int^{\infty}_n e^{-x} dx= \sum_{n=1}^{\infty} e^{-n}=\frac{1}{e-1}.$$

-
This is a great way to look at it! – Mark May 22 '13 at 1:41