Integrals of Gradshteyn and Ryzhik: 3.322

We define the error function as:
\begin{equation}
\mathrm{erf}(z) = \frac{2}{\sqrt{\pi}} \int\limits_{0}^{z} \mathrm{e}^{-x^2} dx
\end{equation}

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

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

3.322.3

\begin{equation}
\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}
\end{equation}
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:
\begin{equation}
\mathrm{erf}(z) = \frac{2}{\sqrt{\pi}} \int\limits_{0}^{z} \mathrm{e}^{-x^2} dx
\end{equation}

3.321.2

\begin{equation}
\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
\end{equation}
using the substitution \(z=qx\)

3.321.3

\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-q^{2}x^{2}} dx = \frac{\sqrt{\pi}}{2q},\,\,q \gt 0
\end{equation}
follows from 3.321.2

3.321.4

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

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

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

Where
\begin{equation}
\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
\end{equation}
is Dawson’s integral.

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}

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
\begin{equation}
\int\limits_{-\infty}^{\infty} \mathrm{e}^{ist^{2}} dt = \mathrm{e}^{is\pi /4}\sqrt{\pi}
\end{equation}
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.

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

We need the following result
\begin{equation}
\int \mathrm{erf}(x) dx = x\,\mathrm{erf}(x) + \frac{\mathrm{e}^{-x^{2}}}{\sqrt{\pi}}
\label{eq:161108-3}
\tag{3}
\end{equation}
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}
\begin{equation}
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}
\end{equation}

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}\).

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

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
\begin{equation}
\mathrm{erf}(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} \mathrm{e}^{-t} \frac{\sin(2x\sqrt{t})}{t} dt
\end{equation}
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
\begin{equation}
\frac{\sin(\phi)}{\phi} = \frac{1}{2}\int\limits_{-1}^{1} \mathrm{e}^{i\phi w} dw
\end{equation}

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
\begin{equation}
\int\limits_{-1}^{1} \mathrm{e}^{-x^{2} \theta ^{2}} \mathrm{erfi}(x\theta) d\theta = 0
\end{equation}
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
\begin{equation}
I = \int\limits_{0}^{\infty} \mathrm{e}^{-ax^{2}} \cos(bx) \mathrm{d}x
\tag{1}
\label{eq:20161022-1}
\end{equation}
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
\begin{equation}
\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}
\end{equation}
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
\begin{equation}
\lim_{x \to \infty} \mathrm{erf}\left(x\sqrt{a} – \frac{ib}{2\sqrt{a}}\right) = 1
\tag{5}
\label{eq:20161022-5}
\end{equation}

Using equations \eqref{eq:20161022-4} and \eqref{eq:20161022-5} in equation \eqref{eq:20161022-3} we obtain
\begin{equation}
\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}
\end{equation}

Combining equations \eqref{eq:20161022-6} and \eqref{eq:20161022-2} yields our final result
\begin{equation}
\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}
\end{equation}

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

How to evaluate
\begin{equation}
\frac{1}{\sqrt{2 \pi}} \int\limits_{-\infty}^{\infty} x^{2} \mathrm{e}^{-x^{2}/2} \mathrm{d}x
\end{equation}
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
\begin{equation}
\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-x}}{x^{1/2}+ax^{3/2}} \mathrm{d}x
\end{equation}
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
\begin{equation}
\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
\end{equation}

To derive the complementary error function integral above, we begin with
\begin{equation}
\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
\end{equation}
We used the substitution \(x=t/z\).

For the integral
\begin{equation}
\int\limits_{-\infty}^{\infty} \frac{\mathrm{e}^{-t^{2}}}{z^{2} + t^{2}} \mathrm{d}t
\end{equation}
we let \(f(t) = \mathrm{e}^{-t^{2}}\) and \(g(t) = 1/(z^{2} + t^{2})\) and take Fourier transforms of each,
\begin{equation}
\mathrm{F}(s) = \mathcal{F}[f(t)] = \frac{\mathrm{e}^{-s^{2}/4}}{\sqrt{2}}
\end{equation}
and
\begin{equation}
\mathrm{G}(s) = \mathcal{F}[g(t)] = \frac{1}{z}\sqrt{\frac{\pi}{2}} \mathrm{e}^{-z|s|}
\end{equation}
then invoke Parseval’s theorem
\begin{equation}
\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
\end{equation}
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.