Say

is a real polynomial with

with no real zeros.
Say we want to find,

.
Here are the steps:
1)Find the zeros (which are complex) of

.
2)Disregard (throw away) the zeros that lie in the lower half plane (so for example, ignore

).
3)Compute the multiplicity of each zero.
4)If

is a zero of

with multiplicity

compute:
![\frac{1}{(k-1)!}\cdot \frac{d^{k-1}[(x-a)^{k-1}/f(x)]}{dx^k} \frac{1}{(k-1)!}\cdot \frac{d^{k-1}[(x-a)^{k-1}/f(x)]}{dx^k}](http://www.mathhelpforum.com/math-help/latex2/img/7b17a2d3625d982b820011e427110e07-1.gif)
evaluated at

.
5)Sum up all the values in step #4.
6)Multiply the total sum from #5 by

.
7)The value of the integral is equal to the value in #6.
Here is an example.
Say you want to find,

where

.
Now do the steps.
1)The zeros of

are

.
2)We disregard

because it is a lower half of plane.
3)The multiplicity of

is

. Thus

and

4)Compute
![\frac{1}{(1-1)!}\cdot \frac{d^0[(x-i)/(x^2+1)]}{dx^0} \frac{1}{(1-1)!}\cdot \frac{d^0[(x-i)/(x^2+1)]}{dx^0}](http://www.mathhelpforum.com/math-help/latex2/img/81a7e71ad3094128f2c5edf10ffb27a4-1.gif)
thus

5)There is only one value so the total sum is just

6)Multiply by

to get

.
7)The value of the integral is

.
A real timesaver
Suppose

has zeros of multiplicity

. Then doing the ugly step in #4 is really easy because you are computing the

-th derivative (which is just doing the derivative 0 times, i.e. not doing anything). Let

be its complex zeros. Since
![f(x)\in \mathbb{R}[x] f(x)\in \mathbb{R}[x]](http://www.mathhelpforum.com/math-help/latex2/img/5fc3255106fe0e17329eaa61a064cf40-1.gif)
it means the complex values occur in complex conjugates pairs. Thus, half of these zeros are in the upper plane and half of these zeros are in the lower plane...
SORRY, I have to stop now. I will try to complete this post.
Have fun!