# Wallis' integrals

In mathematics, and more precisely in analysis, the Wallis' integrals constitute a family of integrals introduced by John Wallis.

## Definition, basic properties

The Wallis' integrals are the terms of the sequence ${\displaystyle (W_{n})_{\,n\,\in \,\mathbb {N} \,}}$ defined by:

${\displaystyle W_{n}=\int _{0}^{\frac {\pi }{2}}\sin ^{n}(x)\,dx,}$

or equivalently (through a substitution: ${\displaystyle x={\frac {\pi }{2}}-t}$):

${\displaystyle W_{n}=\int _{0}^{\frac {\pi }{2}}\cos ^{n}(x)\,dx}$

In particular, the first few terms of this sequence are:

 ${\displaystyle W_{0}}$ ${\displaystyle W_{1}}$ ${\displaystyle W_{2}}$ ${\displaystyle W_{3}}$ ${\displaystyle W_{4}}$ ${\displaystyle W_{5}}$ ${\displaystyle W_{6}}$ ${\displaystyle W_{7}}$ ${\displaystyle W_{8}}$ ... ${\displaystyle {\frac {\pi }{2}}}$ ${\displaystyle 1}$ ${\displaystyle {\frac {\pi }{4}}}$ ${\displaystyle {\frac {2}{3}}}$ ${\displaystyle {\frac {3\pi }{16}}}$ ${\displaystyle {\frac {8}{15}}}$ ${\displaystyle {\frac {5\pi }{32}}}$ ${\displaystyle {\frac {16}{35}}}$ ${\displaystyle {\frac {35\pi }{256}}}$ ...

The sequence ${\displaystyle \ (W_{n})}$ is decreasing and has strictly positive terms. In fact, for all ${\displaystyle n\in \,\mathbb {N} }$ :

• ${\displaystyle \ W_{n}>0}$, because it is an integral of a non-negative continuous function which is not all zero in the integration interval
• ${\displaystyle W_{n}-W_{n+1}=\int _{0}^{\frac {\pi }{2}}\sin ^{n}(x)\,dx-\int _{0}^{\frac {\pi }{2}}\sin ^{n+1}(x)\,dx=\int _{0}^{\frac {\pi }{2}}\sin ^{n}(x)\,[1-\sin(x)]\,dx\geqslant 0}$
(by the linearity of integration and because the last integral is an integral of a non-negative function within the integration interval)

Note: Since the sequence ${\displaystyle \ (W_{n})}$ is decreasing and bounded below by 0, it converges to a non-negative limit. Indeed, the limit is zero (see below).

## Recurrence relation, evaluating the Wallis' integrals

By means of integration by parts, an interesting recurrence relation can be obtained:

Noting that for all real ${\displaystyle x}$, ${\displaystyle \quad \sin ^{2}(x)=1-\cos ^{2}(x)}$, we have, for all natural numbers ${\displaystyle n\geqslant 2}$,
${\displaystyle \int _{0}^{\frac {\pi }{2}}\sin ^{n}(x)\,dx=\int _{0}^{\frac {\pi }{2}}\sin ^{n-2}(x)\left[1-\cos ^{2}(x)\right]\,dx}$
${\displaystyle \int _{0}^{\frac {\pi }{2}}\sin ^{n}(x)\,dx=\int _{0}^{\frac {\pi }{2}}\sin ^{n-2}(x)\,dx-\int _{0}^{\frac {\pi }{2}}\sin ^{n-2}(x)\cos ^{2}(x)\,dx}$ (equation ${\displaystyle \mathbf {(1)} }$)

Integrating the second integral by parts, with:

• ${\displaystyle u'(x)=\cos(x)\sin ^{n-2}(x)}$, whose anti-derivative is ${\displaystyle u(x)={\frac {1}{n-1}}\sin ^{n-1}(x)}$
• ${\displaystyle v(x)=\cos(x)}$, whose derivative is ${\displaystyle v'(x)=-\sin(x)}$

we have:

${\displaystyle \int _{0}^{\frac {\pi }{2}}\sin ^{n-2}(x)\cos ^{2}(x)\,dx=\left[{\frac {1}{n-1}}\sin ^{n-1}(x)\cos(x)\right]_{0}^{\frac {\pi }{2}}+\int _{0}^{\frac {\pi }{2}}\ {\frac {1}{n-1}}\sin ^{n-1}(x)\sin(x)\,dx=0+{1 \over {n-1}}\,W_{n}}$

Substituting this result into ${\displaystyle \mathbf {(1)} }$ gives:

${\displaystyle W_{n}=W_{n-2}-{1 \over {n-1}}\,W_{n}}$

and thus

${\displaystyle \qquad \left(1+{\frac {1}{n-1}}\right)W_{n}=W_{n-2}}$ (equation ${\displaystyle \mathbf {(2)} }$)

This gives the well-known identity:

${\displaystyle n\,W_{n}=(n-1)\,W_{n-2}\qquad \,}$, valid for all ${\displaystyle n\geqslant 2\qquad \,}$.

This is a recurrence relation giving ${\displaystyle W_{n}}$ in terms of ${\displaystyle W_{n-2}}$. This, together with the values of ${\displaystyle W_{0}}$ and ${\displaystyle W_{1}}$, give us two sets of formulae for the terms in the sequence ${\displaystyle \ (W_{n})}$, depending on whether ${\displaystyle n}$ is odd or even.

• for ${\displaystyle \quad n=2\,p}$, ${\displaystyle \quad W_{2\,p}={\frac {2\,p-1}{2\,p}}\times {\frac {2\,p-3}{2\,p-2}}\times \cdots \times {\frac {1}{2}}\,W_{0}={\frac {2\,p}{2\,p}}\times {\frac {2\,p-1}{2\,p}}\times {\frac {2\,p-2}{2\,p-2}}\times {\frac {2\,p-3}{2\,p-2}}\times \cdots \times {\frac {2}{2}}\times {\frac {1}{2}}\,W_{0}={\frac {(2\,p)!}{2^{2\,p}\,(p!)^{2}}}{\frac {\pi }{2}}}$
• for ${\displaystyle \quad n=2\,p+1}$, ${\displaystyle \quad W_{2\,p+1}={\frac {2\,p}{2\,p+1}}\,{\frac {2\,p-2}{2\,p-1}}\cdots {\frac {2}{3}}\,W_{1}={\frac {2^{2\,p}\,(p!)^{2}}{(2\,p+1)!}}~}$

Note that all the even terms are irrational, whereas the odd terms are all rational.

## Another relation to evaluate the Wallis' integrals

Wallis's integrals can be evaluated by using Euler integral :

1. Euler integral of the first kind: the Beta function:
${\displaystyle \mathrm {B} (x,y)=\int _{0}^{1}t^{x-1}(1-t)^{y-1}\,dt={\frac {\Gamma (x)\Gamma (y)}{\Gamma (x+y)}}}$
2. Euler integral of the second kind: the Gamma function:
${\displaystyle \Gamma (z)=\int _{0}^{\infty }t^{z-1}\,e^{-t}\,dt}$

If we make the following substitution inside the Beta function: ${\displaystyle \quad \left\{{\begin{matrix}t=\sin ^{2}(u)\\1-t=\cos ^{2}(u)\\dt=2\sin(u)\cos(u)\,du\end{matrix}}\right.}$
We obtain :

${\displaystyle \mathrm {B} (a,b)=2\int _{0}^{\frac {\pi }{2}}\sin ^{2a-1}(u)\cos ^{2b-1}(u)\,du}$

We know that ${\displaystyle \Gamma ({\tfrac {1}{2}})={\sqrt {\pi }}}$, so this gives us the following relation to evaluate the Wallis'integrals:

${\displaystyle W_{n}={\frac {1}{2}}\mathrm {B} ({\frac {n+1}{2}},{\frac {1}{2}})={\frac {\sqrt {\pi }}{2}}{\frac {\Gamma ({\tfrac {n+1}{2}})}{\Gamma ({\tfrac {n}{2}}+1)}}.}$

## Equivalence

• From the recurrence formula above ${\displaystyle \mathbf {(2)} }$, we can deduce that
${\displaystyle \ W_{n+1}\sim W_{n}}$ (equivalence of two sequences).
Indeed, for all ${\displaystyle n\in \,\mathbb {N} }$ :
${\displaystyle \ W_{n+2}\leqslant W_{n+1}\leqslant W_{n}}$ (since the sequence is decreasing)
${\displaystyle {\frac {W_{n+2}}{W_{n}}}\leqslant {\frac {W_{n+1}}{W_{n}}}\leqslant 1}$ (since ${\displaystyle \ W_{n}>0}$)
${\displaystyle {\frac {n+1}{n+2}}\leqslant {\frac {W_{n+1}}{W_{n}}}\leqslant 1}$ (by equation ${\displaystyle \mathbf {(2)} }$).
By the sandwich theorem, we conclude that ${\displaystyle {\frac {W_{n+1}}{W_{n}}}\to 1}$, and hence ${\displaystyle \ W_{n+1}\sim W_{n}}$.
• By examining ${\displaystyle W_{n}W_{n+1}}$, one obtains the following equivalence:
${\displaystyle W_{n}\sim {\sqrt {\frac {\pi }{2\,n}}}\quad }$ ( and consequently ${\displaystyle \quad \lim _{n\rightarrow \infty }{\sqrt {n}}\,W_{n}={\sqrt {\pi /2}}\quad }$ ).

## Deducing Stirling's formula

Suppose that we have the following equivalence (known as Stirling's formula)

${\displaystyle \ n\,!\sim C\,{\sqrt {n}}\left({\frac {n}{\mathrm {e} }}\right)^{n}}$, where ${\displaystyle \ C\in \mathbb {R} ^{*}}$.

We now want to determine the value of this constant ${\displaystyle \ C}$ using the formula for ${\displaystyle W_{2\,p}}$.

• From above, we know that:
${\displaystyle W_{2\,p}\sim {\sqrt {\frac {\pi }{4\,p}}}={\frac {\sqrt {\pi }}{2}}\,{\frac {1}{\sqrt {p}}}}$ (equation ${\displaystyle \mathbf {(3)} }$)
• Expanding ${\displaystyle W_{2\,p}}$ and using the formula above for the factorials, we get:
${\displaystyle W_{2\,p}={\frac {(2\,p)!}{2^{2\,p}\,(p\,!)^{2}}}\,{\frac {\pi }{2}}\sim {\frac {C\,\left({\frac {2\,p}{\mathrm {e} }}\right)^{2p}\,{\sqrt {2\,p}}}{2^{2p}\,C^{2}\,\left({\frac {p}{\mathrm {e} }}\right)^{2p}\,\left({\sqrt {p}}\right)^{2}}}\,{\frac {\pi }{2}}}$ and hence:
${\displaystyle W_{2\,p}\sim {\frac {\pi }{C\,{\sqrt {2}}}}\,{\frac {1}{\sqrt {p}}}}$ (equation ${\displaystyle \mathbf {(4)} }$)
From ${\displaystyle \mathbf {(3)} }$ and ${\displaystyle \mathbf {(4)} }$, we obtain, by transitivity,
${\displaystyle {\frac {\pi }{C\,{\sqrt {2}}}}\,{\frac {1}{\sqrt {p}}}\sim {\frac {\sqrt {\pi }}{2}}\,{\frac {1}{\sqrt {p}}}}$, which gives :
${\displaystyle {\frac {\pi }{C\,{\sqrt {2}}}}={\frac {\sqrt {\pi }}{2}}}$, and hence ${\displaystyle C={\sqrt {2\,\pi }}}$.
We have thus proved Stirling's formula:
${\displaystyle \ n\,!\sim {\sqrt {2\,\pi \,n}}\,\left({\frac {n}{\mathrm {e} }}\right)^{n}}$.

## Evaluating the Gaussian Integral

The Gaussian integral can be evaluated through the use of Wallis' integrals.

We first prove the following inequalities:

• ${\displaystyle \forall n\in \mathbb {N} ^{*}\quad \forall u\in \mathbb {R} _{+}\quad u\leqslant n\quad \Rightarrow \quad (1-u/n)^{n}\leqslant e^{-u}}$
• ${\displaystyle \forall n\in \mathbb {N} ^{*}\quad \forall u\in \mathbb {R} _{+}\qquad e^{-u}\leqslant (1+u/n)^{-n}}$

In fact, letting ${\displaystyle \quad u/n=t}$, the first inequality (in which ${\displaystyle t\in [0,1]}$) is equivalent to ${\displaystyle 1-t\leqslant e^{-t}}$; whereas the second inequality reduces to ${\displaystyle e^{-t}\leqslant (1+t)^{-1}}$, which becomes ${\displaystyle e^{t}\geqslant 1+t}$. These 2 latter inequalities follow from the convexity of the exponential function (or from an analysis of the function ${\displaystyle t\mapsto e^{t}-1-t}$).

Letting ${\displaystyle u=x^{2}}$ and making use of the basic properties of improper integrals (the convergence of the integrals is obvious), we obtain the inequalities:

${\displaystyle \int _{0}^{\sqrt {n}}(1-x^{2}/n)^{n}dx\leqslant \int _{0}^{\sqrt {n}}e^{-x^{2}}dx\leqslant \int _{0}^{+\infty }e^{-x^{2}}dx\leqslant \int _{0}^{+\infty }(1+x^{2}/n)^{-n}dx}$ for use with the sandwich theorem (as ${\displaystyle n\to \infty }$).

The first and last integrals can be evaluated easily using Wallis' integrals. For the first one, let ${\displaystyle x={\sqrt {n}}\,\sin \,t}$ (t varying from 0 to ${\displaystyle \pi /2}$). Then, the integral becomes ${\displaystyle {\sqrt {n}}\,W_{2n+1}}$. For the last integral, let ${\displaystyle x={\sqrt {n}}\,\tan \,t}$ (t varying from ${\displaystyle 0}$ to ${\displaystyle \pi /2}$). Then, it becomes ${\displaystyle {\sqrt {n}}\,W_{2n-2}}$.

As we have shown before, ${\displaystyle \lim _{n\rightarrow +\infty }{\sqrt {n}}\;W_{n}={\sqrt {\pi /2}}}$. So, it follows that ${\displaystyle \int _{0}^{+\infty }e^{-x^{2}}dx={\sqrt {\pi }}/2}$.

Remark: There are other methods of evaluating the Gaussian integral. Some of them are more direct.

## Relation with the Beta and Gamma functions

One of the definitions of the Beta function reads:

${\displaystyle \mathrm {B} (x,y)=2\int _{0}^{\pi /2}(\sin \theta )^{2x-1}(\cos \theta )^{2y-1}\,d\theta ,\qquad \mathrm {Re} (x)>0,\ \mathrm {Re} (y)>0\!}$

Putting ${\displaystyle x={\frac {n+1}{2}}}$, ${\displaystyle y={\frac {1}{2}}}$ into this equation gives us an expression of the Wallis' integrals in terms of the Beta function:

${\displaystyle \mathrm {B} \left({\frac {n+1}{2}},{\frac {1}{2}}\right)=2\int _{0}^{\pi /2}(\sin \theta )^{n}(\cos \theta )^{0}\,d\theta =2\int _{0}^{\pi /2}(\sin \theta )^{n}\,d\theta =2W_{n}}$

or equivalently,

${\displaystyle W_{n}={\frac {1}{2}}\mathrm {B} \left({\frac {n+1}{2}},{\frac {1}{2}}\right)}$.

Exploiting the identity relating the Beta function to Gamma function:

${\displaystyle \mathrm {B} (x,y)={\dfrac {\Gamma (x)\,\Gamma (y)}{\Gamma (x+y)}}}$

We can rewrite the above in terms of the Gamma function:

${\displaystyle W_{n}={\frac {1}{2}}{\frac {\Gamma \left({\frac {n+1}{2}}\right)\Gamma \left({\frac {1}{2}}\right)}{\Gamma \left({\frac {n+1}{2}}+{\frac {1}{2}}\right)}}={\frac {\Gamma \left({\frac {n+1}{2}}\right)\Gamma \left({\frac {1}{2}}\right)}{2\,\Gamma \left({\frac {n+2}{2}}\right)}}}$

So, for odd ${\displaystyle n}$, writing ${\displaystyle n=2p+1}$, we have:

${\displaystyle W_{2p+1}={\frac {\Gamma \left(p+1\right)\Gamma \left({\frac {1}{2}}\right)}{2\,\Gamma \left(p+1+{\frac {1}{2}}\right)}}={\frac {p!\Gamma \left({\frac {1}{2}}\right)}{(2p+1)\,\Gamma \left(p+{\frac {1}{2}}\right)}}={\frac {2^{p}\;p!}{(2p+1)!!}}={\frac {2^{2\,p}\;(p!)^{2}}{(2p+1)!}}}$

whereas for even ${\displaystyle n}$, writing ${\displaystyle n=2p}$, we get:

${\displaystyle W_{2p}={\frac {\Gamma \left(p+{\frac {1}{2}}\right)\Gamma \left({\frac {1}{2}}\right)}{2\,\Gamma \left(p+1\right)}}={\frac {(2p-1)!!\;\pi }{2^{p+1}\;p!}}={\frac {(2p)!}{2^{2\,p}\;(p!)^{2}}}\cdot {\frac {\pi }{2}}}$

## Note

The same properties lead to Wallis product, which expresses ${\displaystyle {\frac {\pi }{2}}\,}$ (see ${\displaystyle \pi }$) in the form of an infinite product.