<s>[INST] Improper integral $\int\limits_0^\infty x\exp (-x-x^2)\,\text dx$ Integrate $\int\limits_0^\infty 
x\exp (-x-x^2)\,\text dx$
Hint: Use $\int\limits_0^\infty
\exp (-x-x^2)\,\text{d}x = 0.4965$
I don't know how to use this hint in solving the integration. Help! 
 [/INST] $I= \int xe^{-x-x^2}dx = \frac{1}{2} \left[ \int (2x-1+1)e^{-x-x^2}dx\right]=\frac{1}{2} \left[ \int (2x+1)e^{-x-x^2}dx - \int e^{-x-x^2}dx \right]$ 
Observe that $\frac{d}{dx}(-x-x^2)=-(1+2x)$ 
Thus the previous expression simplifies to $\frac{1}{2} \left[ -e^{-x-x^2} - \int e^{-x-x^2}dx \right]$
On applying the limits we get $\int_0^{\infty} xe^{-x-x^2}dx=\frac{1}{2} \left[ -e^{-x-x^2} - \int e^{-x-x^2}dx \right]_0^{\infty} = \frac{1}{2} \left[0-(-1) - 0.4965\right] = \frac{1}{2} \left[ 0.5035 \right]=0.25175$
</s>