# Calculate $\int_{0}^{2\pi} \frac{\cos((2n+1)t)}{\cos(t)}dt$

Calculate the following integral for $n \in \mathbb{Z}$ with the residue theorem $$\int_{0}^{2\pi} \frac{\cos((2n+1)t)}{\cos(t)}dt$$

So far I have tried two approaches. Firsty, for $n\geq 0$: \begin{align*}\int_{0}^{2\pi} \frac{\cos((2n+1)t)}{\cos(t)}dt &= \int_{C(0,1)^{+}} \frac{z^{2n+1}+z^{-(2n+1)}}{z+z^{-1}}\cdot \frac{1}{iz}dz \\ & = -i \int_{C(0,1)^{+}} \frac{z^{2n+1}+z^{-(2n+1)}}{z^2+1}dz \\ & = -i \int_{C(0,1)^{+}} \frac{z^{2(2n+1)}+1}{z^{2n+1}(z^2+1)}dz \\ & = -i \cdot 2\pi i \cdot Res_{z=0}\left(\frac{z^{2(2n+1)}+1}{z^{2n+1}(z^2+1)}\right) \\ & = \left.\frac{2\pi}{(2n)!} \left[ \frac{z^{2(2n+1)}+1}{z^2+1} \right]^{(2n)} \right\rvert_{z=0} \end{align*}

For the first equality I used the reversed parametrization $z(t) = e^{it}$, with $0 \leq t \leq 2\pi$. The last equality follows from $Res_{z=a} \left( \frac{f(z)}{(z-a)^{n+1}}\right) = \frac{f^{(n)}(a)}{n!}$. However, I'm not sure how to calculate that derivative.

Seconldy, I tried to integrate the function $f(z) = \frac{e^{i(2n+1)t}}{cos(t)}$. Using a similar technique this yields:

\begin{align*} \int_{0}^{2\pi} \frac{e^{i(2n+1)t)}}{\cos(t)}dt &= \int_{C(0,1)^{+}} \frac{z^{2n+1}}{(z+z^{-1})/2}\cdot \frac{1}{iz}dz \\ & = -2i\int_{C(0,1)^+}\frac{z^{2n+1}}{z^2+1}dz \end{align*}

However, for $n \geq 1$, the singularities lie on my contour over which I integrate. How do I fix this? Can I just ignore that?

Is this the right approach, or should I try differently? Thanks in advance.

• To calculate the derivative you just expand it by Taylor. – Ma Ming May 2 '14 at 0:33
• Interestingly, the integral can be computed using Chebyshev polynomials and Wallis integrals, and up to a coefficient $2\pi(-1)^n$, the integral boils down to the sum $$\sum_{m=0}^n(-1)^m\frac{2n+1}{2m+1}{2m\choose m}{n+m\choose n-m}=1$$ – Jean-Claude Arbaut Apr 23 '19 at 22:45
• @Jean-ClaudeArbaut: ...Which confirms my own result. – Alex M. Apr 24 '19 at 7:29
• Probably not in the spirit of the exercise, change $t=\pi/2-u$ in the integral, notice that $$(-1)^n\frac{\sin (2n+1)u}{\sin u}=(-1)^n\sum_{k=-n}^n\cos 2ku$$ and integrate each of the terms using the residue method on the unit circle... – Paul Enta Apr 25 '19 at 6:11

Notice that

$$z^{2(2n+1)} + 1 = (z^2)^{2n+1} + 1^{2n+1} = (z^2 + 1) \sum _{k=0} ^{2n} (z^2)^k (-1)^{2n-k} \ ,$$

and the terms with $$k < n$$ are killed by the derivative of order $$2n$$, while the ones with $$k > n$$ survive it but are killed by the evaluation at $$0$$, leaving $$z^{2n}$$ (corresponding to $$k=n$$) as the sole survivor, so your derivative becomes

$$\frac {2\pi} {(2n)!} \left[ \frac {z^{2(2n+1)}+1} {z^2+1} \right]^{(2n)} (0) = \frac {2\pi} {(2n)!} \left[ \sum _{k=0} ^{2n} (z^2)^k (-1)^{2n-k} \right]^{(2n)} (0) = \frac {2\pi} {(2n)!} \left[ z^{2n} (-1)^n \right]^{(2n)} (0) = 2\pi (-1)^n \ .$$

• My answer is similar in spirit to another one by Daniel Fischer, posted on May 2 2014 and then deleted by its author. I did not use it as a source of inspiration, because my own answer seems so natural and straightforward to me, that it was the first thing that I thought of. – Alex M. Apr 24 '19 at 8:43
• Thank you for your answer anyway! This was helpful for me. How can you see deleted answers to questions? – Václav Mordvinov Apr 24 '19 at 9:15
• @VáclavMordvinov: All users with $\ge 10000$ reputation obtain this privilege. – Alex M. Apr 24 '19 at 9:43
• @AlexM. is there an argument which explains why we can ignore the singularities $z=\pm i$ which lie on the contour $C(0,1)^+$? – rae306 Apr 24 '19 at 17:45
• @rae306: "you can't ignore that. With the poles on the contour, the integral does not exist in the Lebesgue or Riemann sense, only as a principal value integral (since the poles are simple). You need to modify the contour to avoid the poles, usually by replacing a small arc centered at a pole by an arc of a circle whose centre is the pole in question, and take the limit as the replaced arcs shrink to the pole. The result is that you have to take half the residue in the respective poles into account. Informally, a simple pole on the contour lies half on each side of the contour." – Alex M. Apr 24 '19 at 17:50