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

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

Integrate by parts

\begin{equation}
\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
\end{equation}

Integrate by parts again
\begin{align}
\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)
\end{align}

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

Leave a Reply

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