The formal statement of the integral test states that if fin[0,oo)rightarrowRR a monotone decreasing function which is non-negative. Then the sum sum_(n=0)^oof(n) is convergent if and only if "sup"_(N>0)int_0^Nf(x)dx is finite. (Tau, Terence. Analysis I, second edition. Hindustan book agency. 2009).
This statement may seem a bit technical, but the idea is the following. Taking in this case the function f(x)=xe^(-x), we note that for x>1, this function is decreasing. We can see this by taking the derivative. f'(x)=e^(-x)-xe^(-x)=(1-x)e^(-x)<0, since x>1, so (1-x)<0 and e^(-x)>0.
Due to this, we note that for any ninNN_(>=2) and x in[1,oo) such that x<=n we have f(x)>=f(n). Therefore int_(n-1)^nf(x)dx>=int_(n-1)^nf(n)dx=f(n), so sum_(n=1)^Nf(n)<=f(1)+sum_(n=2)^Nint_(n-1)^nf(x)dx=f(1)+int_1^Nf(x)dx.
int_1^oof(x)dx=int_1^ooxe^(-x)dx=-int_(x=1)^ooxde^(-x)=-xe^(-x)|_1^oo+int_1^ooe^(-x)dx=-xe^(-x)-e^(-x)|^oo_1=2/e using integration by parts and that lim_(xrightarrowoo)e^-x=lim_(xrightarrowoo)xe^-x=0.
Since f(x)>=0, we have e/2=int_1^oof(x)dx>=int_1^Nf(x)dx, so sum_(n=1)^Nf(n)<=f(1)+2/e=3/e. Since f(n)>=0, the series sum_(n=1)^Nf(n) increases as N increases. Since it is bounded by 3/e, it must converge. Therefore sum_(n=1)^oof(n) converges.