3

I am interested in the integral

$$ I_n = \int_{0}^{\pi} \left(\frac{\cos{((2n+1)x)}}{\cos{x}}\right)^2 dx $$

where $n\ge 0$ is an integer. First few values are $I_0 = \pi$, $I_1 = 3\pi$, $I_2 = 5\pi$, $I_3 = 7\pi$ (which might suggest the pattern $I_n = (2n+1)\pi$). The fraction can be simplified by expanding $\cos{((2n+1)x)}$, but the integral comes out as a summation and the expression doesn't look nice. Any other suggestions to get a nice closed form?

pie
  • 8,483
Sam
  • 3,763
  • You can use Euler's formula $cos(x)=(e^{ix}+e^{-ix})/2$ and then use that $$a^{2n+1}+b^{2n+1}=(a+b)\sum\limits_{k=0}^{2n} (-1)^k a^{2n-2k}b^{2k}$$ and then simplify the fraction and integrate it – pie Feb 02 '25 at 10:17
  • If you enjoy the Gaussian hypergeometric function, there is an antiderivative. – Claude Leibovici Feb 02 '25 at 10:18
  • Reference ; https://math.stackexchange.com/questions/780913/how-to-evaluate-frac12-pi-int-pi-pi-dfrac-sin-n-theta-sin-th?noredirect=1 – Amrut Ayan Feb 02 '25 at 11:12

3 Answers3

7

The linear dependence on $n$ suggests investigating $I_n - I_{n+1}$. Using difference of squares and sum to product identities gives $$ \cos^2[(2n+1)x] - \cos^2[(2n-1)x] = -2\sin(4nx)\cos x\sin x $$ That gets rid of one factor of $\cos x$ in the denominator. To get rid of another, we can instead look at the difference $(I_n-I_{n-1})-(I_{n-1}-I_{n-2})$, which will give \begin{multline} \cos^2[(2n+1)x] - 2\cos^2[(2n-1)x]+ \cos^2[(2n-3)x] \\= -2\left(\sin(4nx)-\sin[4(n-1)x]\right)\sin x\cos x = -8\cos[2(2n-1)x]\sin^2x\cos^2x \end{multline} So we have \begin{multline}(I_n-I_{n-1})-(I_{n-1}-I_{n-2}) = -8\int_0^\pi \cos[2(2n-1)x]\sin^2x dx \\= -2\int_0^{2\pi}\cos[(2n-1)x][1 - \cos x]dx \\ = \int_0^{2\pi}\left(2\cos[(2n-1)x] -\cos[2nx] - \cos[2(n-1)x]\right)dx = 0, \end{multline} where the last integral vanishes because it is a full period integral over each term. Thus we must have $I_n = an + b$ for some $a$ and $b$, and you seem to have found their values yourself.

eyeballfrog
  • 23,253
4

Substitute $x\to \frac12(\pi+x)$ \begin{align} \int_{0}^{\pi} &\left(\frac{\cos{(2n+1)x}}{\cos{x}}\right)^2 dx =\frac12\int_{-\pi}^{\pi} \bigg(\frac{\sin{\frac{(2n+1)x}2}}{\sin{\frac x2}}\bigg)^2 dx \\ &=\int_{0}^{\pi} \frac{1-\cos{(2n+1)x}}{1-\cos{x}}dx = (2n+1)\pi \end{align} which is special case of $\int_{0}^{\pi}{\frac{\cos mx -\cos ma}{\cos x-\cos a}}dx = \frac{\pi \sin ma }{\sin a}$ for $a\to 0$.

Quanto
  • 120,125
3

$$\cos(x)=\frac{e^{ix}+e^{-ix}}{2}$$

$$\cos((2n+1)x)=\frac{e^{(2n+1)ix}+e^{-(2n+1)ix}}{2}$$

Recall that $a^{2n+1}+ b^{2n+1}= (a+b )\left(\sum\limits_{k=0}^{2n}a^{2n-k}b^{k}\right)$

$$\cos((2n+1)x)=\frac{e^{(2n+1)ix}+e^{-(2n+1)ix}}{2}=\frac{(e^{ix}+e^{-ix})\sum\limits_{k=0}^{2n}e^{ix(2n-2k)}}{2}$$ $$=\cos(x) \left(1+ 2\sum_{k=0}^n (-1)^k\cos(2k)\right)$$

$$I:=\int_0^\pi\left( \frac{\cos((2n+1)x)}{\cos(x)}\right)^2dx=\int_0^\pi\left(1+ 2\sum_{k=0}^n (-1)^k\cos(2kx)\right)^2dx$$

$$=\int_0^\pi 1+ 4 \sum_{k=0}^n (-1)^k\cos(2kx) +4\sum_{k=0}^n\sum_{m=0}^{n} (-1)^{k+m}\cos(2kx)\cos(2mx)dx$$

$$= \pi + 4\int_0^\pi\sum_{k=0}^n (-1)^k\cos(2kx) dx+4\int_0^\pi\sum_{k=0}^n\sum_{m=0}^{n} (-1)^{k+m}\cos(2kx)\cos(2mx)dx$$


$$J_1:=\int_0^\pi\sum_{k=0}^n (-1)^k\cos(2kx)dx= \sum_{k=0}^n \int_0^\pi (-1)^k\cos(2kx)dx = \sum_{k=0}^n\frac{\sin(2k\pi)}{2k}=0$$

$$J_2:=\int_0^\pi\sum_{k=0}^n\sum_{m=0}^{n} (-1)^{k+m}\cos(2kx)\cos(2mx)dx= \sum_{k=0}^n\sum_{m=0}^{n} \int_0^\pi(-1)^{k+m}\cos(2kx)\cos(2mx)dx$$

$$=\sum_{0\le k,m \le n, \ | m\ne k }\left(\int_0^\pi(-1)^{k+m}\cos(2kx)\cos(2mx)dx \right)+ \sum_{j=0}^n\int_0^\pi \cos(2jx)^2 dx $$

$$=\frac 1 4 \sum_{0\le k,m \le n \ | m\ne k } \left( \frac{\sin(2\pi (k-m))}{k-m}+ \frac{\sin(2\pi (k+m))}{k+m}\right)+\sum_{j=0}^n \frac{4\pi j+\sin(4\pi j)}{8 j}$$

$$=\frac{\pi n}{4}$$

$\left( \frac{\sin(2\pi (k-m))}{k-m}+ \frac{\sin(2\pi (k+m))}{k+m}\right) =0$ for all $k\ne m$ and that is because $sin(2N\pi)=0 \ \forall N \in \mathbb{N}$ and this is also the reason why $J_1=0$.

$$I= \pi + 4J_1+4J_2= \pi + 2\pi n = \pi (2n+1) $$

pie
  • 8,483
  • 1
    Thank you. Aah, so the double summations I was getting were possible to simplify :O. – Sam Feb 02 '25 at 19:38