Evaluate the Integral \( \int x^{2} \mathrm{e}^{-x^{2}} dx \)

How to evaluate
\int x^{2} \mathrm{e}^{-x^{2}} dx
was a question posed at Mathematics Stack Exchange. Here is my solution

Integrate by parts

\int x^{2} \mathrm{e}^{-x^{2}} dx = \frac{1}{2} \sqrt{\pi} x^{2} \mathrm{erf}(x) – \sqrt{\pi} \int x \, \mathrm{erf}(x) dx

Integrate by parts again
\int x \,\mathrm{erf}(x) dx
&= x^{2} \mathrm{erf}(x) + \frac{1}{\sqrt{\pi}} x \mathrm{e}^{-x^{2}}
– \int x \,\mathrm{erf}(x) dx – \frac{1}{\sqrt{\pi}} \int \mathrm{e}^{-x^{2}} dx \\
&= x^{2} \mathrm{erf}(x) + \frac{1}{\sqrt{\pi}} x \,\mathrm{e}^{-x^{2}}
– \int x \mathrm{erf}(x) dx – \frac{1}{2} \mathrm{erf}(x) \\
&= \frac{1}{2} x^{2} \mathrm{erf}(x) + \frac{1}{2\sqrt{\pi}} x \mathrm{e}^{-x^{2}}
– \frac{1}{4} \mathrm{erf}(x)

Thus we have
\int x^{2} \mathrm{e}^{-x^{2}} dx = \frac{\sqrt{\pi}}{4} \mathrm{erf}(x) – \frac{1}{2} x \mathrm{e}^{-x^{2}}

Leave a Reply

Your email address will not be published. Required fields are marked *