### A Curious Integral

#### Posted by John Baez

On Mathstodon, Robin Houston pointed out a video where Oded Margalit claimed that it’s an open problem why this integral:

$\displaystyle{ \int_0^\infty\cos(2x)\prod_{n=1}^\infty\cos\left(\frac{x}{n} \right) d x }$

is so absurdly close to $\frac{\pi}{8}$, but not quite equal.

They agree to 41 decimal places, but they’re not the same!

$\begin{array}{rcl} \displaystyle{ \int_0^\infty\cos(2x)\prod_{n=1}^\infty\cos\left(\frac{x}{n}\right) d x } &=& 0.3926990816987241548078304229099378605246454... \\ \\ \displaystyle{\frac\pi8} &=& 0.3926990816987241548078304229099378605246461... \\ \end{array}$

So, a bunch of us tried to figure out what was going on.

Jaded nonmathematicians told us it’s just a coincidence, so what is there to explain? But of course an agreement this close is unlikely to be “just a coincidence”. It might be, but you’ll never get anywhere in math with that attitude.

We were reminded of the famous cosine Borwein integral

$\displaystyle{ \int_0^\infty 2 \cos(x) \prod_{n = 0}^{N} \frac{\sin (x/(2n+1))}{x/(2n+1)} \, d x}$

which equals $\frac{\pi}{2}$ for $N$ up to and including 55, but not for any larger $N$:

$\displaystyle{ \int_0^\infty 2 \cos(x) \prod_{n = 0}^{56} \frac{\sin (x/(2n+1))}{x/(2n+1)} \, d x \; \; \approx \;\; \frac{\pi}{2} - 2.3324 \cdot 10^{-138} }$

But it was Sean O who really cracked the case, by showing that the integral we were struggling with could actually be reduced to an $N = \infty$ version of the cosine Borwein integral, namely

$\displaystyle{ \int_0^\infty 2 \cos(x) \prod_{n = 0}^{\infty} \frac{\sin (x/(2n+1))}{x/(2n+1)} \, d x}$

The point is this. A little calculation using the Weierstrass factorizations

$\frac{\sin x}{x} = \prod_{n = 1}^\infty \left( 1 - \frac{x^2}{\pi^2 n^2} \right)$

$\cos x = \prod_{n = 0}^\infty \left( 1 - \frac{4x^2}{\pi^2 (2n+1)^2} \right)$

lets you show

$\prod_{n = 1}^\infty \cos\left(\frac{x}{n}\right) = \prod_{n = 0}^\infty \frac{\sin (2x/(2n+1))}{2x/(2n+1)}$

and thus

$\displaystyle{ \int_0^\infty \cos(2x) \prod_{n=1}^\infty \cos\left(\frac{x}{n} \right) \; d x } = \displaystyle{ \int_0^\infty\cos(2x) \prod_{n = 0}^\infty \frac{\sin (2x/(2n+1))}{2x/(2n+1)} d x }$

Then, a change of variables on the right-hand side gives

$\displaystyle{ \int_0^\infty \cos(2x) \prod_{n=1}^\infty \cos\left(\frac{x}{n} \right) \; d x } = \frac{1}{4} \displaystyle{ \int_0^\infty 2\cos(x) \prod_{n = 0}^\infty \frac{\sin (x/(2n+1))}{x/(2n+1)} d x }$

So, showing that

$\displaystyle{ \int_0^\infty\cos(2x)\prod_{n=1}^\infty\cos\left(\frac{x}{n} \right) d x }$

is microscopically less than $\frac{\pi}{8}$ is equivalent to showing that

$\displaystyle{ \int_0^\infty 2\cos(x) \prod_{n = 0}^\infty \frac{\sin (x/(2n+1))}{x/(2n+1)} d x }$

is microscopically less than $\frac{\pi}{2}$.

This sets up a clear strategy for solving the mystery! People understand why the cosine Borwein integral

$\displaystyle{ \int_0^\infty 2 \cos(x) \prod_{n = 0}^{N} \frac{\sin (x/(2n+1))}{x/(2n+1)} \, d x}$

equals $\frac{\pi}{2}$ for $N$ up to $55$, and then drops ever so slightly below $\frac{\pi}{2}$. The mechanism is clear once you watch the right sort of movie. It’s very visual. Greg Egan explains it here with an animation, based on ideas by Hanspeter Schmid:

- John Baez, Patterns that eventually fail,
*Azimuth*, September 20, 2018.

Or you can watch this video, which covers a simpler but related example:

- 3Blue1Brown, Researchers thought this was a bug (Borwein integrals).

So, we just need to show that as $N \to +\infty$, the value of the cosine Borwein integral doesn’t drop much more! It drops by just a tiny amount: about $7 \times 10^{-43}$.

Alas, this doesn’t seem easy to show. At least I don’t know how to do it yet. But what had seemed an utter mystery has now become a chore in analysis: estimating how much

$\displaystyle{ \int_0^\infty 2 \cos(x) \prod_{n = 0}^{N} \frac{\sin (x/(2n+1))}{x/(2n+1)} \, d x}$

drops each time you increase $N$ a bit.

At this point if you’re sufficiently erudite you are probably screaming: *“BUT THIS IS ALL WELL-KNOWN!”*

And you’re right! We had a lot of fun discovering this stuff, but it was not new. When I was posting about it on MathOverflow, I ran into an article that mentions a discussion of this stuff:

- Eric W. Weisstein, Infinite cosine product integral, from MathWorld—A Wolfram Web Resource.

and it turns out Borwein and his friends had already studied it. There’s a little bit here:

- J. M. Borwein, D. H. Bailey, V. Kapoor and E. W. Weisstein, Ten problems in experimental mathematics,
*Amer. Math. Monthly***113**(2006), 481–509.

and a lot more in this book:

- J. M. Borwein, D. H. Bailey and R. Girgensohn,
*Experimentation in Mathematics: Computational Paths to Discovery*, Wellesley, Massachusetts, A K Peters, 2004.

In fact the integral

$\displaystyle{ \int_0^\infty 2 \cos(x) \prod_{n = 0}^{\infty} \frac{\sin (x/(2n+1))}{x/(2n+1)} \, d x}$

was discovered by Bernard Mares at the age of 17. Apparently he posed the challenge of proving that it was less than $\frac{\pi}{4}$. Borwein and others dived into this and figured out how.

But there is still work left to do!

As far as I can tell, the known proofs that

$\displaystyle{ \frac{\pi}{8} - \int_0^\infty\cos(2x)\prod_{n=1}^\infty\cos\left(\frac{x}{n} \right) d x } \; \approx \; 7.4073 \cdot 10^{-43}$

all involve a lot of brute-force calculation. Is there a more conceptual way to understand this difference, at least approximately? There *is* a clear conceptual proof that

$\displaystyle{ \frac{\pi}{8} - \int_0^\infty\cos(2x)\prod_{n=1}^\infty\cos\left(\frac{x}{n} \right) d x } \;\; > \;\; 0$

That’s what Greg Egan explained in my blog article. But can we get a clear proof that

$\displaystyle{ \frac{\pi}{8} - \int_0^\infty\cos(2x)\prod_{n=1}^\infty\cos\left(\frac{x}{n} \right) d x } \; \; < \; \; C$

for some small constant $C$, say $10^{-40}$ or so?

One can argue that until we do, Oded Margalit is right: there’s an open problem here. Not a problem in proving that something is true. A problem in understanding *why* it is true.

## Re: A Curious Integral

This is really interesting result! There’s a recent video (2 months ago) from 3Blue1Brown that talks about the Borwein Integrals, and a friend had this problem in a class too.

I also want to comment that these is a typo in the equality (it misses a 2 in the denominator), it should be like this: $\prod_{n=1}^\infty \cos \left( \frac{x}{n} \right) = \prod_{n=1}^\infty\frac{ \sin(2x/(2n+1)}{2x/(2n+1)}$