TITLE: An integral using residue calculus
QUESTION [7 upvotes]: This integral is surprisingly difficult to evaluate, and I have looked in several references and none contain a single integral of this type. Any help would be greatly appreciated.
Evaluate $\displaystyle \int_0^\infty \frac{\sin(z)}{1 + z^2}dz$.

REPLY [8 votes]: Edit:  Since the definition of the exponential integral incorporates Cauchy principle values, I did not previously write which integrals were in fact principle values.  This has now been  changed.

We can evaluate it as a sum of exponential integrals by integrating along the quarter circle contour:
Consider $$\int_0^\infty \frac{e^{iz}}{1+z^2}dz.$$  The residue at $x=i$ is $\frac{\pi}{e}$ which in particular tells us the value of the related integral $$\int_0^\infty \frac{\cos(x)}{1+x^2}dx=\frac{\pi}{2e}.$$  However, we care about the imaginary part, not the real part.  Lets integrate on the contour which is the quarter circle of radius $R$ in the right half plane which avoids the point $z=i$ by going around a half circle of radius $\epsilon$.  Then, in the limit as $\epsilon\rightarrow 0$ and $R\rightarrow \infty$ we have that $$\int_0^\infty \frac{e^{iz}}{1+z^2}dz=i\left(p.v.\int_0^\infty \frac{e^{-z}}{1-z^2}dz\right)+\frac{2\pi}{e}.$$  The portion on the circle of radius $R$ goes to zero by Jordans lemma, and the $\frac{\pi}{2e}$ comes from the fractional residue theorem. 
Looking at the imaginary parts of both sides we conclude
$$\int_0^\infty \frac{\sin(z)}{1+z^2}dx=\int_0^\infty \frac{e^{-z}}{1-z^2}dz$$
Split this up using partial fractions to get $$\frac{1}{2}\left(\int_{0}^{\infty}\frac{e^{-u}}{u+1}du-p.v.\int_{0}^{\infty}\frac{e^{-u}}{u-1}du\right).$$  Lets turn each of these into an exponential integral by shifting the lower limit of integration to $0$.  We then have $$\frac{1}{2}\left(e\int_{1}^{\infty}\frac{e^{-t}}{t}dt-e^{-1}\left(p.v.\int_{-1}^{\infty}\frac{e^{-t}}{t}dt\right)\right).$$  This last line is then equal to $$\frac{e^{-1}Ei(1)-eEi(-1)}{2}$$ by definition, and we have evaluated the integral in terms of known functions.
It is highly unlikely that you can write this in a more satisfying way without in turn implying relations about exponential integrals.  Also, the term $-eEi(-1)$ is a constant called Gompertz Constant.
Hope that helps,