## Integrate $$\int_{0}^{1} \frac{\mathrm{ln}^{3}(x)}{1+x} \mathrm{d} x$$

The following integral was a question on Mathematics Stack Exchange

\int\limits_{0}^{1} \frac{\mathrm{ln}^{3}(x)}{1+x} \mathrm{d} x
\label{eq:160812a1}
\tag{1}

We begin with the substitution $$x=\mathrm{e}^{-y}$$ so our integral becomes

-\int\limits_{0}^{\infty} \frac{y^{3}}{1+\mathrm{e}^{\,y}} \mathrm{d} y
\label{eq:160812a2}
\tag{2}

This integral is a Mellin transform of the function

f(y) = \frac{1}{1+\mathrm{e}^{\,y}}
\label{eq:160812a3}
\tag{3}

where the Mellin transform is defined as

\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:160812a4}
\tag{4}

From Tables of Integral Transforms (Bateman Manuscript) Volume 1, we have

\mathcal{M}[(\mathrm{e}^{\alpha x} + 1)^{-1}](s) = \frac{1}{\alpha^{s}} \Gamma(s) (1-2^{1-s}) \zeta(s)
\label{eq:160812a5}
\tag{5}

With $$s = 4$$ and $$\alpha = 1$$ we have

-\int\limits_{0}^{\infty} \frac{y^{3}}{1+\mathrm{e}^{\,y}} \mathrm{d} y = -\Gamma(4) (1-2^{1-4}) \zeta(4) = -\frac{7\pi^{4}}{120}
\label{eq:160812a6}
\tag{6}

Thus

\int\limits_{0}^{1} \frac{\mathrm{ln}^{3}(x)}{1+x} \mathrm{d} x = -\frac{7\pi^{4}}{120}
\label{eq:160812a7}
\tag{7}

We can rewrite \eqref{eq:160812a5} as
\begin{align}
\mathcal{M}[(\mathrm{e}^{\alpha x} + 1)^{-1}](s) & = \frac{1}{\alpha^{s}} \Gamma(s) (1-2^{1-s}) \zeta(s) \\
& = \frac{1}{\alpha^{s}} \Gamma(s) \eta(s)
\label{eq:160812a8}
\tag{8}
\end{align}
where

\eta(s) = (1-2^{1-s}) \zeta(s) = \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^{s}}

is the Dirichlet eta function, also known as the alternating Riemann zeta function.

Note that for Wolfram Alpha, $$\eta(s)$$ defaults to the Dedekind eta function. To obtain the Dirichlet eta function type “dirichlet eta(s)”.

## The nth Catalan Number Expressed as a Beta Function

John Cook who blogs here, posted the following expression for the nth Catalan number on one of his twitter accounts

C_{n} = \frac{1}{2\pi} \int\limits_{0}^{4} x^{n} \sqrt{\frac{4-x}{x}} \mathrm{d} x
\label{eq:1608121}
\tag{1}

Let us express this as a Beta function
\begin{align}
\int\limits_{0}^{4} x^{n} \sqrt{\frac{4-x}{x}} \mathrm{d} x & = x^{n-\frac{1}{2}} (4-x)^{\frac{1}{2}} \mathrm{d} x \\
& = 4^{n+1} \int\limits_{0}^{1} y^{n-\frac{1}{2}} (1-y)^{\frac{1}{2}} \mathrm{d} y \\
& = 4^{n+1} \, \mathrm{B}\left(n + \frac{1}{2}, \frac{3}{2} \right)
\label{eq:1608122}
\tag{2}
\end{align}
We used the substitution $$y=\frac{x}{4}$$.

Now we have

C_{n} = \frac{1}{2\pi} \int\limits_{0}^{4} x^{n} \sqrt{\frac{4-x}{x}} \mathrm{d} x = \frac{2^{2n+1}}{\pi} \mathrm{B}\left(n + \frac{1}{2}, \frac{3}{2} \right)
\label{eq:1608123}
\tag{3}

We will check this by using the following definition of the nth Catalan number

C_{n} = \frac{(2n)!}{(n+1)! \, n!}
\label{eq:1608124}
\tag{4}

Using the following Gamma function expressions

\Gamma(n+1) = n\Gamma(n), \quad
\Gamma\left(\frac{3}{2}\right) = \frac{\sqrt{\pi}}{2}, \quad
\Gamma\left(n + \frac{1}{2}\right) = \frac{(2n)!\sqrt{\pi}}{4^{n}n!}

We have
\begin{align}
\frac{2^{2n+1}}{\pi} \mathrm{B}\left(n + \frac{1}{2}, \frac{3}{2} \right) & = \frac{2^{2n+1}}{\pi} \frac{\Gamma\left(n + \frac{1}{2}\right) \Gamma\left(\frac{3}{2}\right)}{\Gamma(n+2)} \\
& = \frac{2^{2n+1}}{\pi} \frac{(2n)!\sqrt{\pi}}{2^{2n}n!} \frac{\sqrt{\pi}}{2} \frac{1}{(n+1)!} \\
& = \frac{(2n)!}{(n+1)! \, n!}
\label{eq:1608125}
\tag{5}
\end{align}
thus equation \eqref{eq:1608123} is correct.

## Derivation of Beta Function Expressions

In this post, I will derive some basic expressions of the beta function. I will follow the equation numbering of Higher Transcendental Functions (Bateman Manuscript), Volume 1, page 9 (print), page 35 (pdf).

We begin with the basic integral definition of the beta function

\mathrm{B}(x,y) = \int\limits^{1}_{0} t^{x-1} (1-t)^{y-1} \mathrm{d} t
\quad \mathrm{for} \,\, \mathrm{Re} \, x > 0 \,\, \mathrm{and} \,\, \mathrm{Re} \, y > 0
\label{eq:bf1}
\tag{1}

\mathrm{B}(x,y) = \int\limits_{0}^{\infty} \frac{v^{x-1}}{(1+v)^{x+y}} \mathrm{d} v
\quad \mathrm{for} \,\, \mathrm{Re} \, x > 0 \,\, \mathrm{and} \,\, \mathrm{Re} \, y > 0
\label{eq:bf2}
\tag{2}

To derive this equation, we begin with \eqref{eq:bf1} and make the substitution

t = \frac{v}{1+v}

to obtain

\mathrm{B}(x,y) = \int\limits_{0}^{\infty} \frac{v^{x-1}}{(1+v)^{x-1}} \Big(1 – \frac{v}{1+v}\Big)^{y-1} \frac{1}{(1+v)^{2}} \mathrm{d} v

simplification yields \eqref{eq:bf2}.

\mathrm{B}(x,y) = \int\limits_{0}^{1} \frac{(v^{x-1}+v^{y-1})}{(1+v)^{x+y}} \mathrm{d} v
\quad \mathrm{for} \,\, \mathrm{Re} \, x > 0 \,\, \mathrm{and} \,\, \mathrm{Re} \, y > 0
\label{eq:bf3}
\tag{3}

To obtain \eqref{eq:bf3} we begin with \eqref{eq:bf2} and break up the integral

\mathrm{B}(x,y) = \int\limits_{0}^{1} \frac{v^{x-1}}{(1+v)^{x+y}} \mathrm{d} v + \int\limits_{1}^{\infty} \frac{v^{x-1}}{(1+v)^{x+y}} \mathrm{d} v

and designate the last integral as I.

For I, we make the substitution $$w = v^{-1}$$

\mathrm{I} = \int\limits_{0}^{1} \frac{1}{w^{x-1}} \frac{w^{x+y}}{(1+w)^{x+y}} \frac{1}{w^{2}} \mathrm{d} w

Simplifying and then making the substitution for I yields \eqref{eq:bf3}.

\mathrm{B}(x,y) = \mathrm{B}(y,x)
\label{eq:bf4}
\tag{4}

Equation \eqref{eq:bf4} follows directly from equation \eqref{eq:bf3}.

\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)}
\label{eq:bf5}
\tag{5}

To derive equation \eqref{eq:bf5}, let us start with the basic integral definition of the gamma function and then make the substitution $$x = at$$

\begin{align}
\Gamma(z) & = \int\limits_{0}^{\infty} x^{z-1} \mathrm{e}^{-x} \mathrm{d} x \\
& = a^{z} \int\limits_{0}^{\infty} t^{z-1} \mathrm{e}^{-at} \mathrm{d} t \\
\end{align}

Rearranging terms yields

\frac{1}{a^{z}} = \frac{1}{\Gamma(z)} \int\limits_{0}^{\infty} t^{z-1} \mathrm{e}^{-at} \mathrm{d} t

and making the substitutions $$z = \alpha + \beta$$ and $$a = 1 + v$$, we obtain

\frac{1}{(1+v)^{\alpha + \beta}} = \frac{1}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} t^{\alpha + \beta – 1} \mathrm{e}^{-(1+v)t} \mathrm{d} t

Combining this with equation \eqref{eq:bf2}, we have

\begin{align}
\mathrm{B}(\alpha,\beta) & = \frac{1}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} \int\limits_{0}^{\infty} v^{\beta – 1} t^{\alpha + \beta – 1}
\mathrm{e}^{-t} \mathrm{e}^{-vt} \mathrm{d} t \mathrm{d} v \\
& = \frac{1}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} \Big[\int\limits_{0}^{\infty} t^{\alpha – 1} \mathrm{e}^{-t} \mathrm{d} t \Big] t^{\beta} v^{\beta – 1} \mathrm{e}^{-vt} \mathrm{d} v \\
& = \frac{\Gamma(\alpha)}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} t^{\beta} v^{\beta – 1} \mathrm{e}^{-vt} \mathrm{d} v \\
& = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha + \beta)} \\
\end{align}

\mathrm{B}(x,y+1) = \frac{y}{x}\mathrm{B}(x+1,y) = \frac{y}{x+y}\mathrm{B}(x,y)
\label{eq:bf6}
\tag{6}

To derive equation \eqref{eq:bf6}, use \eqref{eq:bf5} to convert the beta functions into gamma functions and use

\Gamma(z+1) = z\Gamma(z)

\begin{align}
\mathrm{B}(x,y+1) & = \frac{\Gamma(x)\Gamma(y+1)}{\Gamma(x+y+1)} \\
& = \frac{y\Gamma(x)\Gamma(y)}{(x+y)\Gamma(x+y)} \\
& = \frac{y\mathrm{B}(x,y)}{x+y} \\
\end{align}

\begin{align}
\mathrm{B}(x+1,y) & = \frac{\Gamma(x+1)\Gamma(y)}{\Gamma(x+y+1)} \\
& = \frac{x\Gamma(x)\Gamma(y)}{(x+y)\Gamma(x+y)} \\
& = \frac{y\mathrm{B}(x,y)}{x+y} \\
\end{align}

\mathrm{B}(x,y)\mathrm{B}(x+y,z) = \mathrm{B}(y,z)\mathrm{B}(y+z,x) = \mathrm{B}(z,x)\mathrm{B}(x+z,y)
\label{eq:bf7}
\tag{7}

For equation \eqref{eq:bf7} we convert the beta functions to gamma functions.
\begin{align}
\mathrm{B}(x,y)\mathrm{B}(x+y,z) & = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)} \times \frac{\Gamma(x + y)\Gamma(z)}{\Gamma(x + y + z)} \times
\frac{\Gamma(y + z)}{\Gamma(y + z)} \\
& = \frac{\Gamma(y)\Gamma(z)}{\Gamma(y + z)} \times \frac{\Gamma(y + z)\Gamma(x)}{\Gamma(x + y + z)} \\
& = \mathrm{B}(y,z)\mathrm{B}(y+z,x) \\
\end{align}

\begin{align}
\mathrm{B}(x,y)\mathrm{B}(x+y,z) & = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)} \times \frac{\Gamma(x + y)\Gamma(z)}{\Gamma(x + y + z)} \times
\frac{\Gamma(x + z)}{\Gamma(x + z)} \\
& = \frac{\Gamma(z)\Gamma(x)}{\Gamma(z + x)} \times \frac{\Gamma(x + z)\Gamma(y)}{\Gamma(x + y + z)} \\
& = \mathrm{B}(z,x)\mathrm{B}(x+z,y) \\
\end{align}

\mathrm{B}(x,y)\mathrm{B}(x+y,z)\mathrm{B}(x+y+z,u) = \frac{\Gamma(x)\Gamma(y)\Gamma(z)\Gamma(u)}{\Gamma(x + y + z + u)}
\label{eq:bf8}
\tag{8}

Here, we use equation \eqref{eq:bf5}

\mathrm{B}(x,y)\mathrm{B}(x+y,z)\mathrm{B}(x+y+z,u) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y} \times \frac{\Gamma(x+y)\Gamma(z)}{\Gamma(x + y + z} \times \frac{\Gamma(x+y+z)\Gamma(u)}{\Gamma(x + y + z + u}

The generalization of equation \eqref{eq:bf8} is evident.

\frac{1}{\mathrm{B}(n,m)} = m \binom{n+m-1}{n-1} = n \binom{n+m-1}{m-1} \,\, \mathrm{for} \,\, n,m \in \mathbb{Z}^{+}
\label{eq:bf9}
\tag{9}

We use the following relationships and then invoke equation \eqref{eq:bf5}

n! = \Gamma(n+1), \quad n! = n(n-1)!, \quad \binom{n}{k} = \frac{n!}{k!(n-k)!}

\frac{1}{\mathrm{B}(n,m)} = \frac{\Gamma(n + m)}{\Gamma(n)\Gamma(m)} = \frac{(n + m – 1)!}{(n – 1)!(m – 1)!} =
m\frac{(n + m – 1)!}{m!(n – 1)!} = m \binom{n+m-1}{n-1}

We can do the same for the last part of equation \eqref{eq:bf9}.

Additional information about the beta function can be found at the following online references

## A Laplace Transform Proof of $$\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}$$

This proof appeared in Irresistible Integrals: Symbolics, Analysis and Experiments in the Evaluation of Integrals by George Boros and Victor Moll. Here, I fill in the steps of the proof.

We begin with 3 fundamental results of the Laplace transform: the basic definition, convolution, and the Laplace transform of a convolution.

\mathcal{L}[f(t)](s) = \int\limits_{0}^{\infty} \mathrm{e}^{-st} f(t) \mathrm{d} t
\label{eq:1608061}
\tag{1}

(f*g)(t) = \int\limits_{0}^{t} f(\tau) g(t-\tau) \mathrm{d} \tau
\label{eq:1608062}
\tag{2}

\mathcal{L}[f*g] = \mathcal{L}[f]\mathcal{L}[g]
\label{eq:1608063}
\tag{3}

We begin with the following two functions

f(t) = t^{x-1} \quad \mathrm{and} \quad g(t) = t^{y-1}
\label{eq:1608064}
\tag{4}

These functions were chosen for two reasons. First, they appear in the basic integral definition of the beta function

\mathrm{B}(x,y) = \int\limits_{0}^{1} t^{x-1} (1-t)^{y-1} \mathrm{d} t
\label{eq:1608065}
\tag{5}

and, as we now show, their Laplace transforms result in gamma functions
\begin{align}
\mathcal{L}[f(t)] & = \mathcal{L}[t^{x-1}] = \int\limits_{0}^{\infty} \mathrm{e}^{-st} t^{x-1} \mathrm{d} t \\
& = \frac{1}{s^{x}} \int\limits_{0}^{\infty} \mathrm{e}^{-v} v^{x-1} \mathrm{d} v \\
& = \frac{\Gamma(x)}{s^{x}}
\label{eq:1608066}
\tag{6}
\end{align}
where we have used the substitution $$v = st$$. Likewise, taking the Laplace transform of $$g(t)$$ yields,

\mathcal{L}[g(t)] = \mathcal{L}[t^{y-1}] = \frac{\Gamma(y)}{s^{y}}
\label{eq:1608067}
\tag{7}

Now we substitute equations \eqref{eq:1608067}, \eqref{eq:1608066}, and \eqref{eq:1608062} into \eqref{eq:1608063}

\frac{\Gamma(x)}{s^{x}} \frac{\Gamma(y)}{s^{y}} = \mathcal{L}\left[\int\limits_{0}^{t} \tau^{x-1} (t – \tau)^{y-1} \mathrm{d} \tau \right]
\label{eq:1608068}
\tag{8}

To evaluate the integral, we let $$\tau = tu$$
\begin{align}
\int\limits_{0}^{t} \tau^{x-1} (t – \tau)^{y-1} \mathrm{d} \tau & = t^{x+y-1} \int\limits_{0}^{1} u^{x-1} (1 – u)^{y-1} \mathrm{d} u \\
& = t^{x+y-1} \mathrm{B}(x,y)
\label{eq:1608069}
\tag{9}
\end{align}

Thus, we have
\begin{align}
\mathcal{L}[t^{x+y-1} \mathrm{B}(x,y)] & = \frac{\Gamma(x)}{s^{x}} \frac{\Gamma(y)}{s^{y}} \\
& = \mathrm{B}(x,y) \int\limits_{0}^{\infty} \mathrm{e}^{-st} t^{x+y-1} \mathrm{d} t \\
& = \mathrm{B}(x,y) \frac{1}{s^{x+y}} \int\limits_{0}^{\infty} \mathrm{e}^{-v} v^{x+y-1} \mathrm{d} v \\
& = \mathrm{B}(x,y) \frac{\Gamma(x+y)}{s^{x+y}}
\label{eq:16080610}
\tag{10}
\end{align}

Combining the first and last results from the right hand side of the above equation yields our final result

\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}

## Integrate $$\int_{0}^{a} (a^{2}-x^{2})^{n-1/2} \mathrm{d} x$$

From Victor Moll’s attempt to solve all of the integrals in Gradshteyn and Ryzhik, we have

\int\limits_{0}^{a} (a^{2}-x^{2})^{n-1/2} \mathrm{d} x = a^{2n} \frac{(2n-1)!!}{(2n)!!} \frac{\pi}{2}
\label{eq:1608041}
\tag{1}

Moll’s solution is at the link, so let us solve this another way. We first use the substitution used by Moll, let $$x=av$$ to obtain

\int\limits_{0}^{a} (a^{2}-x^{2})^{n-1/2} \mathrm{d} x = a^{2n} \int\limits_{0}^{1} (1-v^{2})^{n-1/2} \mathrm{d} v
\label{eq:1608042}
\tag{2}

We designate the integral on the right hand side as I and make the substitution $$z = v^{2}$$

\mathrm{I} = \int\limits_{0}^{1} (1-v^{2})^{n-1/2} \mathrm{d} v = \frac{1}{2} \int\limits_{0}^{1} z^{-1/2} (1-z)^{n-1/2} \mathrm{d} z
\label{eq:1608043}
\tag{3}

From the beginning this integral looked like a gamma or beta function, now, in this form it is obviously a beta function. We then have

\mathrm{I} = \frac{1}{2} \mathrm{B}\left(\frac{1}{2}, n + \frac{1}{2} \right)
\label{eq:1608044}
\tag{4}

and thus

\int\limits_{0}^{a} (a^{2}-x^{2})^{n-1/2} \mathrm{d} x = a^{2n} \frac{1}{2} \mathrm{B}\left(\frac{1}{2}, n + \frac{1}{2} \right)
\label{eq:1608045}
\tag{5}

Now we must show that the right hand sides of equations \eqref{eq:1608041} and \eqref{eq:1608045} are equal or

\mathrm{B}\left(\frac{1}{2}, n + \frac{1}{2} \right) \overset{\underset{\mathrm{?}}{}}{=} \pi \frac{(2n-1)!!}{(2n)!!}
\label{eq:1608046}
\tag{6}

We begin by expressing the beta function in terms of gamma functions

\mathrm{B}\left(\frac{1}{2}, n + \frac{1}{2} \right) = \frac{\Gamma(\frac{1}{2}) \Gamma(n + \frac{1}{2})}{\Gamma(n+1)} = \sqrt{\pi}
\frac{\Gamma(n + \frac{1}{2})}{\Gamma(n+1)}
\label{eq:1608047}
\tag{7}

Now we invoke the following two relationships between the gamma function and the double factorial, found at Wikipedia and Wolfram Math World respectively

(2n-1)!! = \frac{2^{n} \Gamma(n + \frac{1}{2})}{\sqrt{\pi}} \quad \mathrm{and} \quad (2n)!! = 2^{n}n! = 2^{n} \Gamma(n+1)

Substituting these expressions into \eqref{eq:1608046} shows that it is indeed an equality.

Putting everything together, we have

\int\limits_{0}^{a} (a^{2}-x^{2})^{n-1/2} \mathrm{d} x = a^{2n} \frac{(2n-1)!!}{(2n)!!} \frac{\pi}{2} = a^{2n} \frac{1}{2} \mathrm{B}\left(\frac{1}{2}, n + \frac{1}{2} \right)

## Integrate $$\int^{\infty}_{0}\frac{e^{-px^{2}} – e^{-qx^{2}}}{x^{2}} \mathrm{d}x$$

This integral appeared in Paul Nahin’s very interesting book Inside Interesting Integrals. Nahin begins with a completely different integral and derives this one. Let us evaluate the integral directly and then redo it with Nahin’s method.

We begin by breaking up the integral and looking at each piece. So we have

\mathrm I = \int\limits^{\infty}_{0} x^{-2}\mathrm{e}^{-px^{2}} \mathrm{d}x.

This looks very similar to a definition of the gamma function:

\Gamma(z) = \int\limits^{\infty}_{0} x^{z-1}\mathrm{e}^{-x} \mathrm{d}x.

We make the substitution $$y = px^{2}$$

\mathrm I = \frac{\sqrt{p}}{2} \int\limits^{\infty}_{0} \mathrm{e}^{-y} y^{-\frac{3}{2}} \mathrm{d}y.

Invoking the gamma function yields

\mathrm I = \frac{\sqrt{p}}{2} \Gamma\Big(-\frac{1}{2}\Big) = -\sqrt{p}\sqrt{\pi}.

Treating the other part of the original integral involving $$q$$ yields our final result

\int\limits^{\infty}_{0}\frac{\mathrm{e}^{-px^{2}} – \mathrm{e}^{-qx^{2}}}{x^{2}} \mathrm{d}x = \sqrt{\pi}(\sqrt{q}-\sqrt{p}).

As I mentioned earlier, Nahin derived this result beginning with an entirely different integral. A casual glance at the original integral should make us suspect that this is the case as it is clear that both parts of the integrand are identical. In other words, why solve the original integral as opposed to the integral that I used at the beginning of the analysis. Such is the case with many of the results in Inside Interesting Integrals. This is the result of working backward, yielding an evaluated integral via some methods as opposed to starting from an integral that one wants to evaluate. I am not criticizing this approach, as it has resulted in an enormous number of useful integral evaluations. Indeed, it can create an unlimited number of evaluated integrals. Also, such “accidental” integrals can result from contour integration even when directly attacking a given integral. Consider that it often happens that upon the last step in evaluating an integral via contour integration, one equates real and imaginary parts in which one is the solution to the original integral while the other is a bonus.

Let us now see how Nahin achieved his result. He begins with

\int\limits_{0}^{\infty} \mathrm{e}^{-x^{2}} \mathrm{d}x

for which Nahin derived the answer of $$\frac{1}{2} \sqrt{\pi}$$ earlier in the book. What is interesting here is that this integral can be done easily with the gamma function by letting $$x^{2} = y$$. This quickly results in

\int\limits_{0}^{\infty} \mathrm{e}^{-x^{2}} \mathrm{d}x = \frac{1}{2} \int\limits_{0}^{\infty} \mathrm{e}^{-y} y^{-1/2} \mathrm{d} y =
\frac{1}{2} \Gamma\Big(\frac{1}{2}\Big) = \frac{1}{2} \sqrt{\pi}.

If someone saw this, then they would immediately recognize that the integral sought can be evaluated via the gamma function as I did above. Nevertheless, let us continue with Nahin’s analysis.

Nahin makes a change of variable, $$x = t\sqrt{a}$$ to introduce the parameter $$a$$, and thus obtains

\int\limits_{0}^{\infty} \mathrm{e}^{-at^{2}} \mathrm{d}t = \frac{1}{2}\frac{\sqrt{\pi}}{\sqrt{a}}

Then he invokes a useful and interesting trick. He integrates the equation with respect to $$a$$, between two arbitrary end points, and changes the order of integration. Changing the order of integration requires some care, as it is only valid if the integral converges uniformly. Here, the integral is just a gamma function, which we know converges uniformly. This is usually the case for “well behaved”, “non-crazy” integrals. So, Nahin has for the left hand side

\int\limits_{p}^{q}\left\{\int\limits_{0}^{\infty} \mathrm{e}^{-at^{2}} \mathrm{d}t\right\}\mathrm{d}a = \int\limits_{0}^{\infty}\left\{\int\limits_{p}^{q}\mathrm{e}^{-at^{2}} \mathrm{d}a\right\} \mathrm{d}t = \int\limits_{0}^{\infty}\frac{\mathrm{e}^{-pt^{2}} – \mathrm{e}^{-qt^{2}}}{t^{2}} \mathrm{d}t.

The right hand side yields

\int\limits_{p}^{q}\frac{1}{2}\frac{\sqrt{\pi}}{\sqrt{a}} \mathrm{d}a = \sqrt{\pi}(\sqrt{q}-\sqrt{p}).

And thus we have our result.