Application of residue at infinity

complex-analysiscontour-integrationresidue-calculus

I am trying to figure out how to find a contour to solve for this integral
$$
\int_{-\infty}^{\infty}\frac{2x}{x^2+x+1}dx = -\frac{2\pi}{\sqrt{3}}
$$

using the residue theorem and the residue at infinity. Without using the idea of residue at infinity, which is equal to $-\frac{1}{2\pi i} \int_{C} f(z)dz$, I will just choose the upper semi-circle. My question is how to choose a contour whose interior includes all the singularities of the function $\frac{2z}{z^2+z+1}$ ($-\frac{1}{2}\pm \frac{\sqrt{3}}{2}i$) such that it also covers the whole real axis as we take appropriate radii to $0$ or $\infty$, etc. I am thinking of a contour will be some sort of keyhole, but couldn't figure out a simpler contour. It seems like using residue at infinity makes the question 10 times more complicated than necessary.

Best Answer

As noted in the comment by @Greg Martin, this integral must be interpreted as a Cauchy Principal value. https://en.wikipedia.org/wiki/Cauchy_principal_value

No need to include all the singularities. The curve $C$ consisting of the (counterclockwise) upper semicircle together with its diameter $[-R,R]$ works well. Let $\zeta_1, \zeta_2$ be the singularities of $f$. The residue of $$f(z)= \frac{2z}{z^2+z+1}$$ at $\zeta_1=-\frac{1}{2}+ \frac{\sqrt{3}}{2}i \;$ equals $$ \frac{2\zeta_1}{\zeta_1-\zeta_2}=\frac{-1+\sqrt{3}i}{\sqrt{3}i} \,.$$ Multiplying by $2\pi i$ gives $$ -\frac{2\pi}{\sqrt{3}}+2\pi i \,. \tag{1}$$ From this we must subtract the integral of $f$ along the counterclockwise upper semicircle, which is changed by $O(1/R)$ if we instead integrate $2/z$, because $$|z|=R \;\Rightarrow \; \Bigl|\frac{2z}{z^2+z+1}-\frac{2}{z}\Bigr|=O(R^{-2}) \,.$$ The counterclockwise integral of $2/z$ on the upper semicircle equals $$2\log(-R)-2\log(R)=2\log(-1)=2\log(e^{i\pi})=2\pi i \,, \tag{2}$$ where we used a branch of log that is well defined in the closed upper half plane. Subtracting (2) from (1) and letting $R \to \infty$ concludes the proof.

Related Question