How do we integrate this expression
$$\int_{-\infty}^\infty x^2e^{-ax^2} \,dx$$
Using integration by parts? Whenever I attempt it the two terms just cancel and I'm left with 0, which is not what the answer is supposed to be, and no online source seems to solve this using integration by parts.
Hint
Consider $$\int_{-\infty}^\infty x^2e^{-ax^2} \,dx=-\frac 1 {2a}\int_{-\infty}^\infty x(-2axe^{-ax^2}) \,dx$$ Integrate by part