Compute $\lim\limits_{n\to\infty} \int_{0}^{2\pi} \cos x \cos 2x\cdots \cos nx \space{dx}$

Let $u = e^{ix}$. Then $\cos x \cos 2x ... \cos nx = \frac{1}{2^n}\prod_{k=1}^n (u^k + u^{-k})$.

Write $$\prod_{k=1}^n (z^k + z^{-k}) = \sum_{j=-N}^N a_j z^j$$

where $N=\frac{n(n+1)}2$.

Then the integral above is just $\frac{2\pi}{2^n}a_0$.

Combinatorially, we can see that $a_0$ is the number of ways of picking a subset of $\{1,2,...,n\}$ which adds up to $\frac{n(n+1)}{4}$.

Now, the set of subsets of $\{1,...,n\}$ that add up to a particular value is an antichain, so we have a bound on the size of $a_0$, namely, $$0\leq a_0 \leq \binom {n}{\lfloor n/2\rfloor}$$.

And we know that $$\lim_{n\to\infty}\frac{1}{2^n}\binom {n}{\lfloor n/2\rfloor} =0$$

So we know your limit is zero.

(The maximum size of an antichain in the Boolean poset is Sperner's theorem.)

Note that when $n\equiv 1,2\pmod 4$, $\frac{n(n+1)}4$ is not an integer, so in those cases, $a_0=0$. Anybody have an "interesting" lower bound on $a_0$ for the other cases?

[In comments below, Robert Israel shows that when $n\equiv 0,3\pmod 4$, $a_0\geq 2^{\lfloor (n+1)/4\rfloor}$. I suspect that there is a polynomial, $q$, such that $a_0\geq \frac{2^n}{q(n)}$.]

This proof generalizes. Given any sequence of positive integers, $\{b_1,...,b_n\}$, we have the same result:

$$\int_{0}^{2\pi} \cos b_1 x \cos b_2 x ... \cos b_n x dx= \frac{2\pi}{2^n}A$$

where $A$ is the count of an antichain, so $0\leq A\leq \binom {n}{\lfloor n/2\rfloor}$

If $b_i=1$ for all $i$, then we get exact equality when $n$ is even, which is to say that:

$$\int_{0}^{2\pi} \cos^{2m} x dx = \frac{2\pi}{2^{2m}} \binom {2m}{m}$$


Another analysis proof:

It suffices to show that $$\lim_{n \rightarrow \infty} \int_0^{2\pi}|\cos x \cos 2x\cdots \cos nx|\,dx = 0$$ Define $f_n(x) = |\cos x \cos 2x\cdots \cos nx|$. Then since each $|\cos kx | \leq 1$, $f_n(x) \geq f_{n+1}(x)$ for all $n$ and $x$. Since $|f_n(x)| \leq 1$ for all $n$ and $x$, the Lebesgue dominated convergence theorem says $$\lim_{n \rightarrow \infty} \int_0^{2\pi} |\cos x \cos 2x\cdots \cos nx|\,dx = \int_0^{2\pi} \lim_{n \rightarrow \infty}|\cos x \cos 2x\cdots \cos nx|\,dx$$ So it suffices to show that the limit on the inside is zero for almost every $x$. But whenever $x$ is not a rational multiple of $\pi$, $\{nx: n = 1,2,..\}$ is dense in $[0,2\pi]$. Which means given such $x$, there is a sequence $n_1, n_2,...$ such that $$\lim_{k \rightarrow \infty} n_k x = {\pi \over 2}$$ So $$\lim_{k \rightarrow \infty} \cos(n_k x) = \cos({\pi \over 2}) = 0$$ Since $\lim_{n \rightarrow \infty}|\cos x \cos 2x\cdots \cos nx|$ is at most any given $|\cos (n_k x)|$, we conclude that $\lim_{n \rightarrow \infty}|\cos x \cos 2x\cdots \cos nx| = 0$ for all $x$ not a rational multiple of $\pi$. Since the multiples of $\pi$ are a set of measure zero, we are done.


We have

$$\begin{array}{c l}\int_0^{2\pi}\cos x\cdots\cos nx dx= & \int_0^{2\pi}\prod_{k=1}^n\frac{e^{ikx}+e^{-ikx}}{2}dx \\ & =\frac{1}{2^n}\int_0^{2\pi}e^{-n(n+1)/2\,x}\prod_{k=1}^n(1+e^{i2kx})dx \\ & = \frac{1}{2^n}\sum_{K\subseteq [n]}\int_0^{2\pi}\exp\left(-\frac{n(n+1)}{2}i+2i\sum_{k\in K}k\right)dx \\ & =\frac{2\pi|L_n|}{2^n}. \end{array}$$

where $L_n$ is the set of subsets $K$ of $[n]=\{1,\cdots,n\}$ such that $$2\sum_{k\in K}k=\frac{n(n+1)}{2}.$$

(Note this is zero when $n\ne 0,-1$ mod $4$.) Perhaps one can show $|L_n|=\Omega(2^n)$ with a combinatorial argument? Since it's $0$ infinitely often it would also suffice to show the limit exists.


You can prove instead that

$$\lim_{n\to\infty} \int_{0}^{2\pi} \left| \cos x \cos 2x\cdots \cos nx \space{dx} \right| = 0 \,.$$

Let $\epsilon >0$. Then for all $n$ we have

$$\int_{0}^{2\pi} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx} = \int_{0}^{\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx} $$ $$+ \int_{\frac{\epsilon}5}^{\pi-\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx} + \int_{\pi-\frac{\epsilon}5}^{\pi+\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx}$$ $$ + \int_{\pi+\frac{\epsilon}5}^{2\pi-\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx}+\int_{2 \pi-\frac{\epsilon}3}^{2\pi} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx}$$ $$\leq \frac{4\epsilon}{5}+\int_{\frac{\epsilon}5}^{\pi-\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx}+ \int_{\pi+\frac{\epsilon}5}^{2\pi-\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx}$$

I split it this way to avoid the points $x$ where $\cos(kx) \in \{ \pm 1 \}$.

Now, we claim that for all $x \in [\frac{\epsilon}{5}, \pi-\frac{\epsilon}{5}] \cup [\pi+\frac{\epsilon}{5}, 2\pi-\frac{\epsilon}{5}]$ we have

$$\lim_n \left| \cos x \cos 2x\cdots \right| =0$$

This is easy to prove, by splitting it in two cases: x rational and irrational with respect to $\pi$. In the first case, it follows from the Dirichclet Principle that there exists a $k$ so that for all $n$ one of $|\cos nx| , |\cos (n+1)x|, ..., |\cos (n+k)x|$ is less than $\frac{1}{2}$, while the second case is easy to threat by writing $x= \frac{k}m \pi$ with $gcd(m,k)=1$ and $m\neq 1$.

To complete the proof, all these functions are uniformly bounded by $1$ and they converge pointwise to $0$, thus by Lebesgue dominant convergence theorem we have

$$\int_{\frac{\epsilon}5}^{\pi-\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx}+ \int_{\pi+\frac{\epsilon}5}^{2\pi-\frac{\epsilon}5} \left| \cos x \cos 2x\cdots \cos nx \right| \space{dx} \to 0$$

P.S. This proof is probably an overkill...


Let $X_j$ be independent coin flips ($0$ or $1$ with equal probabilities) and $S_n = \sum_{j=1}^n j X_j$. From Thomas Andrews's answer, we see that $\int_0^{2\pi} \cos(x) \cos(2x) \ldots \cos(nx)\ dx = 2 \pi P(S_n = n(n+1)/4)$. We have $E[S_n] = n(n+1)/4$ and $\text{Var}(S_n) = \dfrac{1}{4} \sum_{j=1}^n j^2 = \dfrac{n(n+1)(2n+1)}{24}$. Moreover, Lindeberg's version of the Central Limit Theorem (which does not require the random variables to be identically distributed) applies. We conclude that for any $\alpha > 0$, $P(|S_n - n(n+1)/4| < \alpha \sqrt{n(n+1)(2n+1)/24}) \to \Phi(\alpha) - \Phi(-\alpha)$ as $n \to \infty$, where $\Phi$ is the CDF of the standard normal distribution. Since $\Phi(\alpha) - \Phi(-\alpha) \to 0$ as $\alpha \to 0$, we conclude that $P(S_n = n(n+1)/4) \to 0$.