## Integrals of Gradshteyn and Ryzhik: 3.322

We define the error function as:

\mathrm{erf}(z) = \frac{2}{\sqrt{\pi}} \int\limits_{0}^{z} \mathrm{e}^{-x^2} dx

## 3.322.1

\begin{align}
\int\limits_{u}^{\infty} \mathrm{e}^{-2ax-x^2} dx
&= \mathrm{e}^{a^2} \int\limits_{u}^{\infty} \mathrm{e}^{-(x+a)^2} dx
= \mathrm{e}^{a^2} \int\limits_{u+a}^{\infty} \mathrm{e}^{-y^2} dy \\
&= \frac{\sqrt{\pi}}{2} \mathrm{e}^{a^2} \mathrm{erf}(y) \Bigg|_{u+a}^{\infty} \\
&= \frac{\sqrt{\pi}}{2} \mathrm{e}^{a^2} \left[1-\,\mathrm{erf}(u+a)\right],\,\, u \gt 0
\end{align}
We completed the square in the argument of the exponential function and then used
the substitution $$y=x+a$$.

## 3.322.2

\int\limits_{0}^{\infty} \mathrm{e}^{-2ax-x^2} dx =
\frac{\sqrt{\pi}}{2} \mathrm{e}^{a^2} \left[1-\,\mathrm{erf}(a)\right]

follows from 3.322.1.

## 3.322.3

\mathrm{PV} \int\limits_{0}^{\infty} \mathrm{e}^{\pm i\lambda x^2} dx
= \frac{1}{\sqrt{\lambda}} \int\limits_{0}^{\infty} \mathrm{e}^{\pm i y^2} dy
= \frac{1}{2}\sqrt{\frac{\pi}{\lambda}} \mathrm{e}^{\pm i \pi /4}

we let $$y^2=\lambda x^2$$ and this problem was solved here.

## Integrals of Gradshteyn and Ryzhik: 3.321

We define the error function as:

\mathrm{erf}(z) = \frac{2}{\sqrt{\pi}} \int\limits_{0}^{z} \mathrm{e}^{-x^2} dx

## 3.321.2

\int\limits_{0}^{u} \mathrm{e}^{-q^{2}x^{2}} dx = \frac{1}{q} \int\limits_{0}^{qu} \mathrm{e}^{-z^{2}} dz
= \frac{\sqrt{\pi}}{2q} \mathrm{erf}(z) \Big|_{0}^{qu}
= \frac{\sqrt{\pi}}{2q} \mathrm{erf}(qu),\,\,q \gt 0

using the substitution $$z=qx$$

## 3.321.3

\int\limits_{0}^{\infty} \mathrm{e}^{-q^{2}x^{2}} dx = \frac{\sqrt{\pi}}{2q},\,\,q \gt 0

follows from 3.321.2

## 3.321.4

I = \int\limits_{0}^{u} x\mathrm{e}^{-q^{2}x^{2}} dx
= \frac{\sqrt{\pi}}{2q} \,x\, \mathrm{erf}(qx) \,- \frac{\sqrt{\pi}}{2q} \int \mathrm{erf}(qx) dx

using integration by parts.
\begin{align}
\int \mathrm{erf}(qx) dx &= \frac{1}{q} \int \mathrm{erf}(y) dy \\
&= \frac{1}{q} \left[y\,\mathrm{erf}(y) – \frac{2}{\sqrt{\pi}} \int y\,\mathrm{e}^{-y^2} dy \right] \\
&= \frac{1}{q} y\,\mathrm{erf}(y) + \frac{1}{q\sqrt{\pi}} \mathrm{e}^{-y^2} \\
&= x\,\mathrm{erf}(qx) + \frac{1}{q\sqrt{\pi}} \mathrm{e}^{-q^{2}x^{2}}
\end{align}
using integration by parts and the substitution $$y=qx$$

I = \frac{\sqrt{\pi}}{2q} x \,\mathrm{erf}(qx) \,- \frac{\sqrt{\pi}}{2q} x \,\mathrm{erf}(qx)
\,- \frac{1}{2q^2} \mathrm{e}^{-q^{2}x^{2}} \Big|_{0}^{u}
= \frac{1}{2q^2} \left[1 – \mathrm{e}^{-q^{2}u^{2}} \right]

## 3.321.5

\begin{align}
I &= \int\limits_{0}^{u} x^{2} \mathrm{e}^{-q^{2}x^{2}} dx
= \frac{-1}{2q^2} x \mathrm{e}^{-q^{2}x^{2}} + \frac{1}{2q^2} \int\mathrm{e}^{-q^{2}x^{2}} dx \\
&= \frac{1}{2q^3} \left[-qx \mathrm{e}^{-q^{2}x^{2}} + \frac{\sqrt{\pi}}{2} \mathrm{erf}(qx) \right]\Big|_{0}^{u} \\
&= \frac{1}{2q^3} \left[\frac{\sqrt{\pi}}{2} \mathrm{erf}(qu) \,-\, qu \mathrm{e}^{-q^{2}x^{2}} \right]
\end{align}
We used integration by parts, 3.321.4, and 3.321.2.

## 3.321.6

\begin{align}
I &= \int\limits_{0}^{u} x^{3} \mathrm{e}^{-q^{2}x^{2}} dx
= \frac{\sqrt{\pi}}{4q^3}x\,\mathrm{erf}(qx) \,- \frac{x^2}{2q^2}\mathrm{e}^{-q^{2}x^{2}}
– \frac{\sqrt{\pi}}{4q^3} \int \mathrm{erf}(qx) dx + \frac{1}{2q^2} \int x\,\mathrm{e}^{-q^{2}x^{2}} dx \\
&= \frac{\sqrt{\pi}}{4q^3}\,x\,\mathrm{erf}(qx) \,- \frac{x^2}{2q^2}\mathrm{e}^{-q^{2}x^{2}}
– \frac{\sqrt{\pi}}{4q^3}\,x\,\mathrm{erf}(qx) \,- \frac{1}{4q^4}\mathrm{e}^{-q^{2}x^{2}}
– \frac{1}{4q^4}\mathrm{e}^{-q^{2}x^{2}} \\
&= \frac{1}{2q^4} (-q^{2}x^{2} – 1)\mathrm{e}^{-q^{2}x^{2}}\Big|_{0}^{u} \\
&= \frac{1}{2q^4} \left[1-(1+q^{2}u^{2}) \mathrm{e}^{-q^{2}u^{2}} \right]
\end{align}
using integration by parts, 3.321.5, the work done in the solution of 3.321.4 and the result 3.321.4.

## 3.321.7

\begin{align}
I &= \int\limits_{0}^{u} x^{4} \mathrm{e}^{-q^{2}x^{2}} dx
= -\frac{1}{2q^4}x\mathrm{e}^{-q^{2}x^{2}} – \frac{1}{2q^4}q^{2}x^{3}\mathrm{e}^{-q^{2}x^{2}}
+ \frac{1}{2q^4}\int \mathrm{e}^{-q^{2}x^{2}} dx + \frac{q^{2}}{2q^4}\int x^{2}\mathrm{e}^{-q^{2}x^{2}} dx \\
&= \frac{1}{2q^5}\left[-qx\,\mathrm{e}^{-q^{2}x^{2}} – q^{3}x^{3}\,\mathrm{e}^{-q^{2}x^{2}}
+ \frac{\sqrt{\pi}}{2} \mathrm{erf}(qx) + \frac{\sqrt{\pi}}{4} \mathrm{erf}(qx)
-\frac{1}{2}qx\,\mathrm{e}^{-q^{2}x^{2}} \right]\Big|_{0}^{u} \\
&= \frac{1}{2q^5} \left[\frac{3\sqrt{\pi}}{4}\mathrm{erf}(qx)
– qx\,\mathrm{e}^{-q^{2}x^{2}}\left(\frac{3}{2} + q^{2}x^{2}\right) \right]\Big|_{0}^{u} \\
&= \frac{1}{2q^5} \left[\frac{3\sqrt{\pi}}{4}\mathrm{erf}(qu)
– qu\,\mathrm{e}^{-q^{2}u^{2}}\left(\frac{3}{2} + q^{2}u^{2}\right) \right]
\end{align}
using integration by parts, 3.321.6, 3.321.2, and 3.321.5.

## Evaluate the Integral $$\int_{0}^{\infty} \mathrm{e}^{-ax^2}\sin(wx) dx$$

This problem was posed at Mathematics Stack Exchange, here is my solution.

\begin{align}
I &= \int\limits_{0}^{\infty} \mathrm{e}^{-ax^2 + iwx} dx \\
\tag{a}
&= \mathrm{e}^{-\frac{w^2}{4a}} \int\limits_{0}^{\infty} \mathrm{e}^{-a(x-\frac{iw}{2a})^2} dx \\
&= \mathrm{e}^{-\frac{w^2}{4a}} \int \mathrm{e}^{-az^2} dz \\
&= \mathrm{e}^{-\frac{w^2}{4a}} \frac{1}{2}\sqrt{\frac{\pi}{a}} \mathrm{erf}(z\sqrt{a}) \\
&= \mathrm{e}^{-\frac{w^2}{4a}} \frac{1}{2}\sqrt{\frac{\pi}{a}}
\mathrm{erf}\left(x\sqrt{a} – \frac{iw}{2\sqrt{a}} \right) \Big|_{0}^{\infty} \\
\tag{b}
&= \mathrm{e}^{-\frac{w^2}{4a}} \frac{1}{2}\sqrt{\frac{\pi}{a}} \left[ 1 + i\,\mathrm{erfi}\left(\frac{w}{2\sqrt{a}} \right) \right]
\end{align}

a. Complete the square.

b. $$\lim_{x \to \infty} \mathrm{erf}(x + ic) = 1$$ for finite $$c, \, c \in \mathbb{C}$$ and $$\mathrm{erf}(-iz) = -i\mathrm{erfi}(z)$$

\int\limits_{0}^{\infty} \mathrm{e}^{-ax^2}\sin(wx) dx = \mathfrak{I}(I)
= \mathrm{e}^{-\frac{w^2}{4a}} \frac{1}{2}\sqrt{\frac{\pi}{a}} \mathrm{erfi}\left(\frac{w}{2\sqrt{a}} \right)
= \frac{1}{\sqrt{a}} \mathrm{F}\left(\frac{w}{2\sqrt{a}} \right)

Where

\mathrm{F}(x) = \frac{\sqrt{\pi}}{2} \mathrm{e}^{-x} \mathrm{erfi}(x)
= \mathrm{e}^{-x^2} \int\limits_{0}^{x} \mathrm{e}^{z^2} dz

is Dawson’s integral.

## 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
\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

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

## Prove $$\int_{-\infty}^{\infty} \mathrm{e}^{ist^{2}} dt = \mathrm{e}^{is\pi /4}\sqrt{\pi}$$ for $$s = \pm 1$$

First integral, for $$s=1$$
\begin{align}
2\int \mathrm{e}^{it^{2}} dt &= 2\frac{1}{\sqrt{i}} \int \mathrm{e}^{x^{2}} dx \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erfi}(x) \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erfi}(t\sqrt{i})
\end{align}

Thus
\begin{align}
2\int\limits_{0}^{\infty} \mathrm{e}^{it^{2}} dt &= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erfi}(t\sqrt{i}) \Big|_{0}^{\infty} \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} (i-0) = \sqrt{i}\sqrt{\pi} = \mathrm{e}^{i\pi /4}\sqrt{\pi}
\end{align}

Second integral, for $$s=-1$$
\begin{align}
2\int \mathrm{e}^{-it^{2}} dt &= 2\frac{1}{\sqrt{i}} \int \mathrm{e}^{-x^{2}} dx \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erf}(x) \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erf}(t\sqrt{i})
\end{align}

Thus
\begin{align}
2\int\limits_{0}^{\infty} \mathrm{e}^{-it^{2}} dt &= \frac{1}{\sqrt{i}} \sqrt{\pi} \mathrm{erf}(t\sqrt{i}) \Big|_{0}^{\infty} \\
&= \frac{1}{\sqrt{i}} \sqrt{\pi} (1-0) = \frac{1}{\sqrt{i}} \sqrt{\pi} = \mathrm{e}^{-i\pi /4}\sqrt{\pi}
\end{align}

And we have

\int\limits_{-\infty}^{\infty} \mathrm{e}^{ist^{2}} dt = \mathrm{e}^{is\pi /4}\sqrt{\pi}

for $$s = \pm 1$$

## Given $$f(x) = \int_{1}^{\sqrt{x}} \mathrm{e}^{-t^{2}} dt$$ Find $$\int_{0}^{1} \frac{f(x)}{\sqrt{x}} dx$$

This question appeared on Mathematics Stack Exchange. My solution is an alternative to the better solution here.

f(x) = \int\limits_{1}^{\sqrt{x}} \mathrm{e}^{-t^{2}} dt
\label{eq:161108-1}
\tag{1}

\int\limits_{0}^{1} \frac{f(x)}{\sqrt{x}} dx
\label{eq:161108-2}
\tag{2}

We need the following result

\int \mathrm{erf}(x) dx = x\,\mathrm{erf}(x) + \frac{\mathrm{e}^{-x^{2}}}{\sqrt{\pi}}
\label{eq:161108-3}
\tag{3}

Proof: Integrate by parts
\begin{align}
\int \mathrm{erf}(x) dx &= x\,\mathrm{erf}(x) -\frac{2}{\sqrt{\pi}} \int x\,\mathrm{e}^{-x^{2}} dx \\
&= x\,\mathrm{erf}(x) + \frac{\mathrm{e}^{-x^{2}}}{\sqrt{\pi}}
\end{align}
we used the substitution $$u=x^{2}$$.

Now we evaluate equation \eqref{eq:161108-1}

f(x) = \frac{\sqrt{\pi}}{2} \mathrm{erf}(x) \Big|_{1}^{\sqrt{x}} = \frac{\sqrt{\pi}}{2} [\mathrm{erf}(\sqrt{x}) – \mathrm{erf}(1)]
\label{eq:161108-4}
\tag{4}

Substitute equation \eqref{eq:161108-4} into equation \eqref{eq:161108-2} and evaluate the following two integrals.

\begin{align}
I_{1} &= \int\limits_{0}^{1} \frac{\mathrm{erf}(\sqrt{x})}{\sqrt{x}} dx \\
&= 2\int\limits_{0}^{1} \mathrm{erf}(z) dz \\
&= 2\,\mathrm{erf}(1) + \frac{2}{\mathrm{e}\sqrt{\pi}} – \frac{2}{\sqrt{\pi}}
\end{align}
we used the substitution $$z=\sqrt{x}$$.

I_{2} = \int\limits_{0}^{1} \frac{1}{\sqrt{x}} dx = 2

Putting all of the pieces together yields our final result
\begin{align}
\int\limits_{0}^{1} \frac{f(x)}{\sqrt{x}} dx
&= \frac{\sqrt{\pi}}{2} \left(2\,\mathrm{erf}(1) + \frac{2}{\mathrm{e}\sqrt{\pi}} – \frac{2}{\sqrt{\pi}} – 2\,\mathrm{erf}(1) \right) \\
&= \frac{1}{\mathrm{e}} – 1
\end{align}

## Prove $$\mathrm{erf}(x) = \frac{1}{\pi} \int_{0}^{\infty} \mathrm{e}^{-t} \frac{\sin(2x\sqrt{t})}{t} dt$$

How to prove

\mathrm{erf}(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} \mathrm{e}^{-t} \frac{\sin(2x\sqrt{t})}{t} dt

was a question posed at Mathematics Stack Exchange. The poster did not want a solution using contour integration. Here is my solution.

\begin{align}
\tag{1a}
\int\limits_{0}^{\infty} \mathrm{e}^{-t} \frac{\sin(2x\sqrt{t})}{t} dt
&= x \int\limits_{-1}^{1} \int\limits_{0}^{\infty} \mathrm{e}^{-t} \mathrm{e}^{i2x\theta \sqrt{t}} \frac{1}{\sqrt{t}} dt d\theta \\
\tag{1b}
&= 2x \int\limits_{-1}^{1} \int\limits_{0}^{\infty} \mathrm{e}^{-y^{2}+i2x\theta y} dy d\theta \\
\tag{1c}
&= 2x \int\limits_{-1}^{1} \mathrm{e}^{-x^{2} \theta ^{2}} \int\limits_{0}^{\infty} \mathrm{e}^{-(y-ix\theta)^{2}} dy d\theta \\
\end{align}

Notes:

a. Use

\frac{\sin(\phi)}{\phi} = \frac{1}{2}\int\limits_{-1}^{1} \mathrm{e}^{i\phi w} dw

b. $$\sqrt{t} = y$$

c. Complete the square.

Evaluate
\begin{align}
\int \mathrm{e}^{-(y-ix\theta)^{2}} dy &= \int \mathrm{e}^{-z^{2}} dz \\
&= \frac{\sqrt{\pi}}{2} \mathrm{erf}(z) = \frac{\sqrt{\pi}}{2} \mathrm{erf}(y-ix\theta)
\end{align}
here we let $$z = y-ix\theta$$. Applying limits to the integral yields
\begin{align}
\int\limits_{0}^{\infty} \mathrm{e}^{-(y-ix\theta)^{2}} dy
&= \frac{\sqrt{\pi}}{2} \mathrm{erf}(y-ix\theta) \Big|_{0}^{\infty} \\
&= \frac{\sqrt{\pi}}{2} [1 + i \mathrm{erfi}(x\theta)]
\tag{2}
\end{align}

Substituting equation 2 into equation 1c yields two integrals. Dropping constants we have first
\begin{align}
\int\limits_{-1}^{1} \mathrm{e}^{-x^{2} \theta ^{2}} d\theta &= \frac{1}{x} \int \mathrm{e}^{-w^{2}} dw \\
&= \frac{\sqrt{\pi}}{2x} \mathrm{erf}(w) \\
&= \frac{\sqrt{\pi}}{2x} \mathrm{erf}(x\theta) \Big|_{-1}^{1} \\
&= \frac{\sqrt{\pi}}{x} \mathrm{erf}(x)
\end{align}
secondly, we have

\int\limits_{-1}^{1} \mathrm{e}^{-x^{2} \theta ^{2}} \mathrm{erfi}(x\theta) d\theta = 0

noting that the imaginary error function is an odd function.

Putting the pieces together yields
\begin{align}
\int\limits_{0}^{\infty} \mathrm{e}^{-t} \frac{\sin(2x\sqrt{t})}{t} dt
&= 2x \int\limits_{-1}^{1} \mathrm{e}^{-x^{2} \theta ^{2}} \int\limits_{0}^{\infty} \mathrm{e}^{-(y-ix\theta)^{2}} dy d\theta \\
&= 2x \frac{\sqrt{\pi}}{2} \frac{\sqrt{\pi}}{x} \mathrm{erf}(x) \\
&= \pi\, \mathrm{erf}(x)
\end{align}

## Evaluate $$\int_{0}^{\infty} \mathrm{e}^{-ax^{2}} \cos(bx) \mathrm{d}x$$

How to evaluate

I = \int\limits_{0}^{\infty} \mathrm{e}^{-ax^{2}} \cos(bx) \mathrm{d}x
\tag{1}
\label{eq:20161022-1}

was a question posed at Mathematics Stack Exchange. I encourage readers to follow the link to see solutions that use a rectangular contour to evaluate this integral as an alternative method to the one presented below.

Let
\begin{align}
I_{1} &= \int\limits_{0}^{\infty} \mathrm{e}^{-ax^{2}} \mathrm{e}^{ibx} \mathrm{d}x
= \int\limits_{0}^{\infty} \mathrm{e}^{-ax^{2}+ibx} \mathrm{d}x \\
&= \mathrm{e}^{-b^{2}/4a} \int\limits_{0}^{\infty} \mathrm{e}^{-a(x-ib/2a)^{2}} \mathrm{d}x \\
\tag{2}
\label{eq:20161022-2}
\end{align}
Here we completed the square and note that $$\mathrm{Re}\,I_{1} = I$$.

Consider the indefinite integral
\begin{align}
\int \mathrm{e}^{-a(x-ib/2a)^{2}} \mathrm{d}x
&= \int \mathrm{e}^{-ay^{2}} \mathrm{d}y \\
&= \frac{1}{\sqrt{a}} \int \mathrm{e}^{-z^{2}} \mathrm{d}z = \frac{1}{2} \sqrt{\frac{\pi}{a}} \mathrm{erf}(z) \\
&= \frac{1}{2} \sqrt{\frac{\pi}{a}} \mathrm{erf}\left(x\sqrt{a} – \frac{ib}{2\sqrt{a}}\right)
\tag{3}
\label{eq:20161022-3}
\end{align}
we used the substitutions, $$y=x- \frac{ib}{2a}$$ and $$z^{2} = ay^{2}$$.

Examining the error function expression, we have

\lim_{x \to 0} \mathrm{erf}\left(x\sqrt{a} – \frac{ib}{2\sqrt{a}}\right)
= \mathrm{erf}\left(- \frac{ib}{2\sqrt{a}}\right)
= -i\,\mathrm{erfi}\left(\frac{b}{2\sqrt{a}}\right)
\tag{4}
\label{eq:20161022-4}

which is a pure imaginary quantity with the assumption that all of the variables in the argument of the imaginary error function are real and $$a \gt 0$$. We also have

\lim_{x \to \infty} \mathrm{erf}\left(x\sqrt{a} – \frac{ib}{2\sqrt{a}}\right) = 1
\tag{5}
\label{eq:20161022-5}

Using equations \eqref{eq:20161022-4} and \eqref{eq:20161022-5} in equation \eqref{eq:20161022-3} we obtain

\mathrm{Re}\left(\int\limits_{0}^{\infty} \mathrm{e}^{-a(x-ib/2a)^{2}} \mathrm{d}x \right) = \frac{1}{2} \sqrt{\frac{\pi}{a}}
\tag{6}
\label{eq:20161022-6}

Combining equations \eqref{eq:20161022-6} and \eqref{eq:20161022-2} yields our final result

\int\limits_{0}^{\infty} \mathrm{e}^{-ax^{2}} \cos(bx) \mathrm{d}x = \frac{1}{2} \sqrt{\frac{\pi}{a}} \,\mathrm{e}^{-b^{2}/4a}

## Evaluate $$\frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} x^{2} \mathrm{e}^{-x^{2}/2} \mathrm{d}x$$

How to evaluate

\frac{1}{\sqrt{2 \pi}} \int\limits_{-\infty}^{\infty} x^{2} \mathrm{e}^{-x^{2}/2} \mathrm{d}x

was a question posed at Mathematics Stack Exchange. Here is my solution.

We begin with a slightly different integral and then use the trick of differentiating under the integral. Let
\begin{align}
I(a) &= \int\limits_{0}^{\infty} \mathrm{e}^{-ax^{2}} \mathrm{d}x \\
&= \frac{1}{\sqrt{a}} \int\limits_{0}^{\infty} \mathrm{e}^{-y^{2}} \mathrm{d}y \\
&= \frac{\sqrt{\pi}}{2} \frac{1}{\sqrt{a}} \mathrm{erf}(y) \Big|_{0}^{\infty} \\
&= \frac{\sqrt{\pi}}{2} \frac{1}{\sqrt{a}}
\end{align}
We used the substitution $$y^{2} = ax^{2}$$.

Then
\begin{align}
I &= \frac{1}{\sqrt{2 \pi}} \int\limits_{-\infty}^{\infty} x^{2} \mathrm{e}^{-x^{2}/2} \mathrm{d}x
= \frac{2}{\sqrt{2 \pi}} \int\limits_{0}^{\infty} x^{2} \mathrm{e}^{-x^{2}/2} \mathrm{d}x \\
&= -\frac{2}{\sqrt{2 \pi}} \lim_{a \to 1/2} \frac{\partial I(a)}{\partial a}
= \frac{2}{\sqrt{2 \pi}} \lim_{a \to 1/2} \int\limits_{0}^{\infty} x^{2} \mathrm{e}^{-ax^{2}} \mathrm{d}x
= \frac{2}{\sqrt{2 \pi}} \int\limits_{0}^{\infty} x^{2} \mathrm{e}^{-x^{2}/2} \mathrm{d}x \\
&= -\frac{2}{\sqrt{2 \pi}} \frac{\sqrt{\pi}}{2} \lim_{a \to 1/2} \frac{\partial}{\partial a} a^{-1/2}
= -\frac{1}{\sqrt{2}} \left(-\frac{1}{2}\right) \lim_{a \to 1/2} a^{-3/2} \\
&= 1
\end{align}

## Evaluate the Integral $$\int_{0}^{\infty} \frac{\mathrm{e}^{-x}}{x^{1/2}+ax^{3/2}} \mathrm{d}x$$

How to evaluate

\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-x}}{x^{1/2}+ax^{3/2}} \mathrm{d}x

was a question posed at Mathematics Stack Exchange. Here is my solution.

\begin{align}
\tag{a}
\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-x}}{x^{1/2}+ax^{3/2}} \mathrm{d}x &=
2\int\limits_{0}^{\infty} \frac{z\mathrm{e}^{-z^{2}}}{z+az^{3}} \mathrm{d}z \\
\tag{b}
&= \frac{2}{\sqrt{a}} \int\limits_{0}^{\infty} \mathrm{e}^{-y^{2}/a} \frac{1}{1+y^{2}} \mathrm{d}y \\
\tag{c}
&= \frac{\pi}{\sqrt{a}} \mathrm{e}^{1/a} \,\mathrm{erfc}\left(\frac{1}{\sqrt{a}}\right)
\end{align}

Notes:

a. $$x=z^{2}$$
b. $$y^{2}=az^{2}$$
c. From DLMF, we have the following integral definition of the complementary error function

\mathrm{erfc}(z) = \frac{2}{\pi} \mathrm{e}^{-z^{2}} \int\limits_{0}^{\infty} \mathrm{e}^{-z^{2}t^{2}}
\frac{1}{t^{2} + 1} \mathrm{d}t

To derive the complementary error function integral above, we begin with

\frac{2}{\pi} \mathrm{e}^{-z^{2}} \int\limits_{0}^{\infty} \frac{\mathrm{e}^{-z^{2}x^{2}}}{x^{2} + 1} \mathrm{d}x =
\frac{2z}{\pi} \mathrm{e}^{-z^{2}} \int\limits_{0}^{\infty} \frac{\mathrm{e}^{-t^{2}}}{z^{2} + t^{2}} \mathrm{d}t
= \frac{z}{\pi} \mathrm{e}^{-z^{2}} \int\limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-t^{2}}}{z^{2} + t^{2}} \mathrm{d}t

We used the substitution $$x=t/z$$.

For the integral

\int\limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-t^{2}}}{z^{2} + t^{2}} \mathrm{d}t

we let $$f(t) = \mathrm{e}^{-t^{2}}$$ and $$g(t) = 1/(z^{2} + t^{2})$$ and take Fourier transforms of each,

\mathrm{F}(s) = \mathcal{F}[f(t)] = \frac{\mathrm{e}^{-s^{2}/4}}{\sqrt{2}}

and

\mathrm{G}(s) = \mathcal{F}[g(t)] = \frac{1}{z}\sqrt{\frac{\pi}{2}} \mathrm{e}^{-z|s|}

then invoke Parseval’s theorem

\int\limits_{-\infty}^{\infty} f(t)\overline{g(t)} \mathrm{d}t
= \int\limits_{-\infty}^{\infty} \mathrm{F}(s)\overline{\mathrm{G}(s)} \mathrm{d}s

Dropping constants, the integral becomes
\begin{align}
\int\limits_{-\infty}^{\infty} \mathrm{e}^{-s^{2}/4} \mathrm{e}^{-z|s|} \mathrm{d}s
&= 2\int\limits_{0}^{\infty} \mathrm{e}^{-s^{2}/4} \mathrm{e}^{-z|s|} \mathrm{d}s \\
&= 2\mathrm{e}^{z^{2}} \int\limits_{0}^{\infty} \mathrm{e}^{-(s+2z)^{2}/4} \mathrm{d}s \\
&= 4\mathrm{e}^{z^{2}} \int\limits_{0}^{\infty} \mathrm{e}^{-y^{2}} \mathrm{d}y \\
&= 2\sqrt{\pi}\mathrm{e}^{z^{2}} \mathrm{erfc}(z)
\end{align}
We completed the square in the exponent and used the substitution $$y=z+s/2$$.

Putting the pieces together yields our desired result
\begin{align}
\frac{2}{\pi} \mathrm{e}^{-z^{2}} \int\limits_{0}^{\infty} \frac{\mathrm{e}^{-z^{2}x^{2}}}{x^{2} + 1} \mathrm{d}x &=
\frac{z}{\pi} \mathrm{e}^{-z^{2}} \int\limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-t^{2}}}{z^{2} + t^{2}} \mathrm{d}t \\
&= \frac{z}{\pi} \mathrm{e}^{-z^{2}} \frac{1}{\sqrt{2}} \frac{1}{z} \sqrt{\frac{\pi}{2}} 2\sqrt{\pi} \mathrm{e}^{z^{2}} \mathrm{erfc}(z) \\
&= \mathrm{erfc}(z)
\end{align}

Thanks to Jack D’Aurizio for outlining this derivation.