∫x²e^(-x²)dx. Let I=∫x²e^(-x²)dx.
The exponential can be expressed as a series:
eⁿ=1+n+n²/2!+n³/3!+... so e^(-x²)=1-x²+x⁴/2!-x⁶/3!+x⁸/4!+...+(-1)ʳx²ʳ/r!+...
Therefore:
x²e^(-x²)=x²-x⁴+x⁶/2!-x⁸/3!+x¹⁰/4!+...+(-1)ʳx²ʳ⁺²/r!+...
Integrating: I=x³/3-x⁵/5+x⁷/(7×2!)+...+(-1)ʳx²ʳ⁺³/((2r+3)r!)+... or I=(∑(-1)ʳx²ʳ⁺³/((2r+3)r!))+constant, for r in [0,∞].
Another way to look at this is to note that d(xe^-x²)/dx=e^-x²-2x²e^-x².
Integrate wrt x: xe^-x²=∫e^-x²dx-2I=(√π/2)erf(x)-2I, so 2I=(√π/2)erf(x)-xe^-x², where erf is the Gaussian error function, so I=½((√π/2)erf(x)-xe^-x²). This error function is encountered in probability and arises from integration of the normal distribution.