How to evaluate the definite integral $\int_0^{2\pi}\frac{\sin^2(M\pi\cos\theta)}{\sin^2(\pi\cos\theta)}\,d\theta?$ Given an integer parameter $M$, how to find the value of the definite integral
$$\int_0^{2\pi}\frac{\sin^2(M\pi\cos\theta)}{\sin^2(\pi\cos\theta)}\,d\theta?$$
This problem is encountered in antenna theory.
Thanks.
 A: We recognize something that looks like the Fejer kernel. You can easily verify that
$$\sum_{|k|\leq M-1} \left ( M - |k|\right)e^{ikx}=\frac{\sin^2\left( \frac {Mx}2\right)}{\sin^2\left ( \frac x 2\right)}$$
Thus
$$\begin{split}
\int_0^{2\pi} \frac{\sin^2\left( M\pi  \cos \theta\right)}{\sin^2\left ( \pi \cos \theta\right)}d\theta &= \sum_{|k|\leq M-1}(M-|k|)\int_0^{2\pi}e^{ik \cos\theta}d\theta\\
&=2\pi\sum_{|k|\leq M-1}(M-|k|)J_0(k)\\
&=2\pi \left(M +2 \sum_{k=1}^{M-1}(M-k) J_0(k)\right)
\end{split}
$$
A: I don't think there's a very clean looking solution, but here's my try.
We assume $M\ge 0$.
For brevity of writing, let $t(\theta)=\pi\cos\theta$. For ease, I will just call that $t$. We note that $$I_M=\int_0^{2\pi}\frac{\sin^2(Mt)}{\sin^2t}\ \mathrm d\theta=\int_0^{2\pi}\frac{2\sin^2(Mt)}{2\sin^2t}\ \mathrm d\theta=\int_0^{2\pi}\frac{1-\cos(2Mt)}{1-\cos(2t)}\ \mathrm d\theta$$
Now some trigonometry. We know that $$\cos((M+1)2t)+\cos((M-1)2t)=2\cos(2t)\cos(2Mt)$$
This gives us that $$1-\cos((M+1)2t)=2(1-\cos(2t))\cos(2Mt)+2(1-\cos(2Mt))-(1-\cos((M-1)2t))$$
Dividing by $1-\cos(2t)$ and integrating from $0$ to $2\pi$ gives us
$$I_{M+1}=2\int_{0}^{2\pi}\cos(2\pi M\cos\theta)\ \mathrm d\theta+2I_n-I_{n-1}$$
The integral is the Bessel function of the first kind, and gives $2\pi J_0(2\pi M)$. Plugging this in, we need to solve
$$I_{M+1}=4\pi J_0(2\pi M)+2I_M-I_{M-1}$$
with the boundary values $I_0=0,\ I_1=2\pi$.
Let $h_M=I_M-I_{M-1}$. Also let $4\pi J_0(2\pi M)=g_M$ Then, we have
$$h_{M+1}=g_M+h_M\Rightarrow h_{M+1}-h_M=g_M$$
This can be telescoped to get
$$h_{M+1}=h_1+\sum_{i=1}^Mg_i=2\pi+\sum_{i=1}^Mg_i$$
Plugging in the expression for $h_{M+1}$ and then telescoping again, we get
$$I_M=2\pi M+\sum_{j=1}^{M-1}\sum_{i=1}^jg_i$$
Thus $$\int_0^{2\pi}\frac{\sin^2(M\pi\cos\theta)}{\sin^2(\pi\cos\theta)}\ \mathrm d\theta=2M\pi+4\pi\sum_{j=1}^{M-1}\sum_{i=1}^jJ_0(2\pi i)$$
We can exchange the sums to get
\begin{align*}\int_0^{2\pi}\frac{\sin^2(M\pi\cos\theta)}{\sin^2(\pi\cos\theta)}\ \mathrm d\theta&=2M\pi +\sum_{i=1}^{M-1}\sum_{j=i}^{M-1}J_0(2\pi i)\\&=2M\pi+\sum_{i=1}^{M-1}(M-i)J_0(2\pi i)\end{align*}
As a check, it matches with the answer for $M=4$ given by Claude Leibovici.
