Evaluate $\int_0^{2\pi} \frac{\cos x}{2x^2 + 1} \,\mathrm{d}x$ using complex analysis

100 Views Asked by At

I've been having trouble to solve the following integral using complex analysis, so if someone could give a tip how to get it done?

$$\int_0^{2\pi} \frac{\cos x}{2x^2 + 1} \,\mathrm{d}x$$

Attempt: I replaced $\cos x$ with $(e^{ix}+e^{-ix})/2$, and then I introduced a new complex variable $z = e^{i x}$. From this relationship I replaced $x$ by taking the natural log of both sides, and then I got a complex integral along a closed curve $| z | = 1$ and that is it.