TITLE: Where have I gone wrong? Contour integration $\int_{-a}^a {u\over 1+u+u^2} du$ as $a\to \infty$
QUESTION [5 upvotes]: I would like to integrate $\int_{-a}^a {u\over 1+u+u^2} du$ as $a\to \infty$.
So I thought I might use the residue theorem. In the complex plane, the singularities occur at $z=e^{\pm i2\pi\over 3}$. So if we close the contour in the upper half plane we enclose $z=e^{i2\pi\over 3}$. This is a covert simple pole, so res$\left({z\over 1+z+z^2};e^{i2\pi\over 3}\right)={z\over 2z+1}|_{z=e^{i2\pi\over 3}}={1\over 2}+{i\over 2\sqrt3}$. So by the residue theorem, the integral is $2\pi i \left({1\over 2}+{i\over 2\sqrt3}\right)=\pi(i-{1\over\sqrt 3})$. 
But this cannot be the answer since it contains $i$. Where have I gone wrong? Thanks.

REPLY [3 votes]: You can use the usual integration:
$$\eqalign{
  & \int\limits_{ - a}^a {\frac{u}{{{u^2} + u + 1}}du}  = \frac{1}{2}\int\limits_{ - a}^a {\frac{{2u}}{{{u^2} + u + 1}}du}   \cr 
  &  = \frac{1}{2}\left\{ {\int\limits_{ - a}^a {\frac{{2u + 1}}{{{u^2} + u + 1}}du}  - \int\limits_{ - a}^a {\frac{{du}}{{{u^2} + u + 1}}} } \right\}  \cr 
  &  = \frac{1}{2}\left\{ {\int\limits_{ - a}^a {\frac{{2u + 1}}{{{u^2} + u + 1}}du}  - \int\limits_{ - a}^a {\frac{{du}}{{{{\left( {u + \frac{1}{2}} \right)}^2} + \frac{3}{4}}}} } \right\}  \cr 
  &  = \frac{1}{2}\left\{ {\log \left| {{u^2} + u + 1} \right| - \frac{2}{{\sqrt 3 }}\arctan \left( {\frac{2}{{\sqrt 3 }}\left( {x + \frac{1}{2}} \right)} \right)} \right\}_{ - a}^a  \cr 
  &  = \frac{1}{2}\log \left| {\frac{{{a^2} + a + 1}}{{{a^2} - a + 1}}} \right| - \frac{1}{{\sqrt 3 }}\arctan \left( {\frac{2}{{\sqrt 3 }}\left( {a + \frac{1}{2}} \right)} \right) + \frac{1}{{\sqrt 3 }}\arctan \left( {\frac{2}{{\sqrt 3 }}\left( { - a + \frac{1}{2}} \right)} \right) \cr} $$
This gives as a result $-\dfrac{\pi}{\sqrt 3}$