principal value of improper integrals How can I find the principal value of the following? 
$$PV\int_{-\infty}^\infty \frac{e^{ix}}{x(x^2+x+1)} dx$$ 
I'm able to evaluate integrals which have trig identities in them or just polynomials but I can't quite get my head around how to do them with exponentials. Any help would be wonderful please! 
 A: $$\begin{eqnarray*}PV\int_{-\infty}^{+\infty}\frac{e^{ix}}{x(1+x+x^2)}\,dx = PV \int_{0}^{+\infty}\left(\frac{2i(1+x^2)}{1+x^2+x^4}\cdot\frac{\sin x}{x}-\frac{2}{1+x^2+x^4}\cos(x)\right)\end{eqnarray*}$$
and both integrals giving the real and imaginary part can be computed by using the Laplace transform. We have:
$$ \int_{0}^{+\infty}\frac{2\cos x}{1+x^2+x^4}\,dx = \frac{\pi}{3}e^{-\frac{\sqrt{3}}{2}}\left(3\sin\frac{1}{2}+\sqrt{3}\cos\frac{1}{2}\right)$$
and:
$$ \int_{0}^{+\infty}\frac{1+x^2}{1+x^2+x^4}\cdot\frac{\sin x}{x}\,dx = \frac{\pi}{6}\left(3+2\sqrt{3}\,e^{-\frac{\sqrt{3}}{2}}\sin\frac{1}{2}\right).$$
A: You can use the residue theorem.  Consider the complex contour integral 
$$\oint_C dz \frac{e^{i z}}{z \,(1+z+z^2)} $$
where $C$ is a semicircle of radius $R$ in the upper half plane with a small semicircular detour about the origin into the upper half plane of radius $\epsilon$.  Then the contour integral is equal to 
$$PV \int_{-R}^{R} dx \frac{e^{i x}}{x \,(1+x+x^2)} +i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{e^{i \epsilon e^{i \phi}}}{\epsilon e^{i \phi} (1+\epsilon e^{i \phi}+\epsilon^2 e^{i 2 \phi})} \\ + i R \int_0^{\pi} d\theta \, e^{i \theta} \, \frac{e^{i R e^{i \theta}}}{R e^{i \theta} (1+R e^{i \theta}+R^2 e^{i 2 \theta})}$$
As $R \to \infty$, the third integral vanishes as $1/R^3$.  As $\epsilon \to 0$, the second integral becomes $-i \pi$.  By the residue theorem, the contour integral is equal to $i 2 \pi$ times the residue of any poles inside $C$.  The poles of the integrand are at
$$z^2+z+1=0 \implies z_{\pm}=\frac{-1 \pm i\sqrt{3}}{2}$$
Only $z_+$ is inside $C$, with residue
$$\frac{e^{-i/2} e^{-\sqrt{3}/2}}{e^{i 2 \pi/3} (i \sqrt{3})} $$
Thus,
$$PV \int_{-\infty}^{\infty} dx \frac{e^{i x}}{x \,(1+x+x^2)} = \frac{2 \pi}{\sqrt{3}} e^{-\sqrt{3}/2} e^{-i (2 \pi/3 +1/2)} + i \pi$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
With $\ds{p \equiv {-1 + \root{3}\ic \over 2}}$:
\begin{align}
&\bbox[5px,#ffd]{\mrm{P.V.}\int_{-\infty}^{\infty}
{\expo{\ic x} \over x\pars{x^{2} + x + 1}}\,\dd x}
\\[5mm] = &\
\int_{-\infty}^{\infty}
{\expo{\ic x} \over x^{2} + x + 1}
\bracks{{1 \over x + \ic 0^{+}} + \ic\pi\delta\pars{x}}\,\dd x
\\[5mm] = &\
\int_{-\infty}^{\infty}
{\expo{\ic x} \over
\pars{x + \ic 0^{+}}\pars{x - p}\pars{x - \overline{p}}}\,\dd x +
\ic\pi
\\[5mm] = &\
\ic\pi +
2\pi\ic\,{\expo{\ic p} \over p\pars{p - \overline{p}}} =
\ic\pi +
2\pi\ic\,{\expo{-\ic/2 - \root{3}/2} \over
\bracks{\pars{-1 + \root{3}\ic}/2}\pars{\ic\root{3}}}
\\[5mm] = &\
\ic\pi +
2\pi\,{\root{3} \over 3}
\expo{-\ic/2 - \root{3}/2}\,\,\,{-1 - \root{3}\ic \over 2}
\\[5mm] = &\
\bbx{\pars{\ic - {\root{3} + 3\ic \over 3}\,\expo{-\ic/2 - \root{3}/2}}\pi} \approx -1.3030 + 2.3477\,\ic \\ &
\end{align}
