Usually I would write the given sum in the form $$lim_{n \to \infty}\frac{1}{n}\sum_{r=o}^{n}{f(\frac{r}{n})}$$ and then approximate it with the integral
$$\int_{0}^{1}f(x)dx$$ but it doesn't seem so easy to do with this question. The solution says that this sum is equal to the integral: $$\int_{0}^{1}x^2e^xdx$$ without any further explanation. I can't see how they are equal.
Any help is appreciated.