I want to compute $$\int_{-\infty}^{\infty} \frac{1+\cos(x)}{(x -\pi)^2}dx$$
My approach is $$\int_{-\infty}^{\infty} \frac{1+\cos(x)}{(x -\pi)^2}dx=\int_{-\infty}^{\infty} \frac{1}{(x -\pi)^2}dx+\int_{-\infty}^{\infty} \frac{\cos(x)}{(x -\pi)^2}dx.$$
However, the first term on the RHS does not exist since there is a singularity $\pi$.
How to overcome this problem?
Now follow the hint, I get $$\int_{-\infty}^{\infty} \frac{\sin x}{x}dx$$
BTW, if I want to use residue calculus to do this problem, how to do it? I am confused the pole at origin. Thanks!