How do I find an integral of the form $\int$ cos(nx)

I came across this problem

$$I_n = \int_0^{2\pi} \frac {\cos(nx)}{1-\cos(x)}dx$$

I've seen methods to solve integrals of the form $\int\cos^n(x)$ etc., but not of this form. What is the basic transformation to be done to start solving it?

• This integral doesn't exist
– user326188
Commented Mar 27, 2016 at 5:22
• This integral diverges as mentioned in the Caveat to this answer.
– robjohn
Commented Mar 27, 2016 at 5:31
• Possible duplicate of Prove this integral problem
– robjohn
Commented Mar 27, 2016 at 5:32

Concerning the definite integral $$I_n = \int_0^{2\pi} \frac {\cos(nx)}{1-\cos(x)}dx$$ there is major issue at the bounds.
To show it, consider Taylor series around $x=0$ $$\frac {\cos(nx)}{1-\cos(x)}=\frac{2}{x^2}+\left(\frac{1}{6}-n^2\right)+\frac{1}{120} \left(10 n^4-10 n^2+1\right) x^2+O\left(x^4\right)$$
To integrate $cos(nx)$, you can use Euler's formula ($e^{ix} = \cos(x) + i \sin(x))$.
$\cos(nx) = \Re(e^{inx})$, so $\int \cos(nx) = \Re(\int e^{inx})$, where $\Re(z)$ denotes the real part of the complex number $z$. We can treat i like an ordinary constant.