Calculate: $\int_0^\infty [x]e^{-x} \, dx$ where $[x]:=\max \{k\in\mathbb{Z}:k\leq x\}$

You're almost done. Note that $$\begin{aligned} \int_0^{\infty} \lfloor x \rfloor e^{-x} \; \mathrm{d}x &= \sum_{k=0}^{\infty} \int_k^{k+1} ke^{-x} \; \mathrm{d}x\\ &= \sum_{k=0}^{\infty} \left [-ke^{-x} \right ]_k^{k+1}\\ &= \sum_{k=0}^{\infty} k\left (e^{-k} - e^{-k-1}\right )\\ &= \sum_{k=0}^{\infty} ke^{-k} - \sum_{k=0}^{\infty} ke^{-k-1}\\&= \sum_{k=1}^{\infty} ke^{-k} - \sum_{k=1}^{\infty} (k-1)e^{-k}\\ &= \sum_{k=1}^{\infty} e^{-k}\\ &= \frac{e^{-1}}{1 - e^{-1}}\\ &= \frac{1}{e-1}. \end{aligned}$$ Hence, $$\int_0^{\infty} \lfloor x \rfloor e^{-x} \; \mathrm{d}x = \frac{1}{e-1}.$$


Hint: For any $|z|<1$

$\frac{1}{(1-z)^2} = \sum_\limits{n\geq1}nz^{n-1}$ and so,

$\frac{z}{(1-z)^2}=\sum_\limits{n\geq1}nz^n$


To evaluate the final sum, rewrite it as a telescoping sum as follows: $$\sum_{k=0}^{\infty} ke^{-k}(1-e^{-1}) = \sum_{k=0}^{\infty} ke^{-k} -ke^{-(k+1)} $$

Writing out the first couple of terms: $$ 0-0 + \frac{1}{e} - \frac{1}{e^2}+\frac{2}{e^2}-\frac{2}{e^3}+\frac{3}{e^3}-\frac{3}{e^4} = \frac{1}{e}+\frac{1}{e^2}+\frac{1}{e^3}+... $$

This is an infinite geometric series and $\frac{1}{e}$ is within the radius of convergence, that is $\big|\frac{1}{e}\big|\le 1$. It is, however, missing the first term, $1$.

$$\sum_{k=0}^{\infty}r^k=\frac{1}{1-r} $$

Setting $r=\frac{1}{e}$ and subtracting $1$, the sum is now $$\frac{1}{1-\frac{1}{e}}-1=\frac{e}{e-1}-\frac{e-1}{e-1}=\frac{1}{e-1} $$