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

Compute the following limit: $$\lim_{n\to\infty} \int_{0}^{2\pi} \cos x \cos 2x\cdots \cos nx \space{dx}$$

Today I was working on a W. L. Putnam competition's problem containing this integral and wondered how I may compute its value when $n$ goes to $\infty$. So far I've found no answer.
Could you give me some suggestions about the way I should go?

-
It seems to me that the limit is zero. There are infinitely many choices of $n$ that produce exactly zero. Anyway, I believe that using the formulae in it.wikipedia.org/wiki/Formule_di_Werner you can inductively compute a primitive. This primitive is a sum of sines (which produce zeroes after integration) and a term which is either a sine or a polynomial. But the coefficient of this polynomial becomes smaller and smaller as $n \to +\infty$. –  Siminore Jul 13 '12 at 14:31
@Siminore: ma i non lo so parlare italiano. Grazie! –  Chris's sis Jul 13 '12 at 14:34
@Siminore, i also think that the limit is $0$ but i don't know how to prove it. Yeah, it could be a way. –  Chris's sis Jul 13 '12 at 14:36
This is in English. :) –  Ｊ. Ｍ. Jul 13 '12 at 14:37
Sorry, it seems that the name of Werner is not very popular in the american literature. Anyway, mathematics formulae are written in a universal language ;-) –  Siminore Jul 13 '12 at 14:43
show 1 more comment

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}$$

-
Ah, I wasn't thinking in terms of posets! –  anon Jul 13 '12 at 15:04
I was thinking exactly along these lines except I didn't think that much about the $a_0$ term. My logic was that whatever it would be, it would still be a polynomial in $n$, and $2^{n}$ would always grow faster than a polynomial in $n$ which implies that the limit would zero. Would this have sufficed on the exam? I don't think that they expect the people taking the exam to know these facts about chains and what-not. –  Ahsan Jul 13 '12 at 18:28
But I agree, Sperner's theorem was definitely not something I learned until grad school (even though it is a relatively elementary thorem.) –  Thomas Andrews Jul 13 '12 at 18:39
Note that for $n \equiv 0 \mod 4$, $a_0 \ge 2^{n/4}$ since in each four-tuple $(4j+1,4j+2,4j+3,4j+4)$ you can choose either $\{4j+1,4j+4\}$ or $\{4j+2,4j+3\}$. So there is certainly no polynomial upper bound. –  Robert Israel Jul 13 '12 at 20:03
And similarly for $n \equiv 3 \mod 4$, $a_0 \ge 2^{(n+1)/4}$ since you can take $\{1,2\}$ or $\{3\}$ and then in each $\{4j,\ldots,4j+3\}$ either $\{4j+1,4j+2\}$ or $\{4j,4j+3\}$. –  Robert Israel Jul 13 '12 at 20:08

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.

-
Are $L_n$ Lucas' numbers? –  Pedro Tamaroff Jul 13 '12 at 15:05
@PeterTamaroff I just felt like using the letter $L$. –  anon Jul 13 '12 at 15:06
Ah, OK. Because $F_n<\phi^n$ so you might have gotten somewhere. –  Pedro Tamaroff Jul 13 '12 at 15:07

$$\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...

-
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.
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$.