# Evaluating an integral of the form $\int_a^{\infty}x^{2}e^{-x^{2}}dx$

How do you evaluate an integral of the form $$\int_a^{\infty}x^{2}e^{-x^{2}}dx ?$$ This integral is very similar to the error function integral $$\int_a^{\infty}e^{-x^{2}}dx =\frac{\sqrt{\pi}}{2}\big(1-\text{erf}(a)\big).$$

And so I thought that you could integrate by parts the first integral somehow and end up writing it in terms of the error function, however I don't know how to go about it (how do you evaluate the boundary terms?).

• What does $\text{erf}(\cdot)$ mean? Sorry if I am a noob at this Commented May 7, 2018 at 1:46
• @user477343 It's the error function. Wikipedia might be helpful as will Wolfram Mathworld! Commented May 7, 2018 at 1:46
• @FrankW. thanks for that. I will check it out :) Commented May 7, 2018 at 1:49
• By the way, you can write \mathrm dx to generate $\mathrm dx$ if you prefer. Commented May 7, 2018 at 1:49
• @user477343 Thank you for the tip! Commented May 7, 2018 at 2:25

Hint: Try this for integration by parts.

$\int u dv$

Where

$u = x$

$dv = xe^{-x^2}$

$$I=\int_a^{\infty}x^{2}e^{-x^{2}}dx$$ $$I=-\frac 12\int_a^{\infty}x (-2xe^{-x^{2}})dx$$ Integrate by part now $$I=-\frac 12\int_a^{\infty}x (e^{-x^{2}})'dx$$ $$I=-\frac 12( \left. (x e^{-x^{2}})\right |_a^{\infty} -\int_a^{\infty}e^{-x^{2}}dx)$$

You can insert a general parameter and use Feynman's Trick. Let's denote $a$ as the new inserted parameter and $b$ as the lower limit for the integral$$I(a)=\int\limits_b^{\infty}dx\, x^2e^{-ax^2}=-\frac {\partial}{\partial a}\int\limits_b^{\infty}dx\, e^{-ax^2}=-\frac {\partial}{\partial a}\left\{\sqrt{\frac {\pi}{4a}}\operatorname{erfci}\left(b\sqrt a\right)\right\}$$Expanding the parenthesis and differentiating with respect to $a$ gives us$$I(a)=\frac 1{4a}\sqrt{\frac {\pi}a}+\frac {be^{-ab^2}}{4a}$$Let $a=1$ to retrieve the desired integral$$I(1)\color{blue}{=\frac {\sqrt{\pi}}4+\frac {be^{-b^2}}4}$$

• Thank you for the answer! I think you meant "...parameter and $b$ as the lower limit for the integral..." Commented May 7, 2018 at 2:28
• @JoshuaBautista Yup! That's precisely what I meant. When I did the problem, I wrote the lower limit as $b$ and forgot to change it in the answer. Commented May 7, 2018 at 2:31
• By the way, how did you do the derivative of the (complementary) error function? Commented May 7, 2018 at 2:47
• @JoshuaBautista I split the complementary function as $1-\operatorname{erf}(x)$ and used the basic definition to see$$\frac {d}{dx}\operatorname{erf}(x)=\frac {2 e^{-x^2}}{\sqrt{\pi}}$$ Commented May 7, 2018 at 3:03