Integrate[x^2 Exp[-(x^2 +2 p x)/(2 sigma^2)],{x,0,Infinity}]