<s>[INST] Residue of a function f 
$\int \dfrac{w^2}{(w^2+1)^2(w^2+2w+2)}=\dfrac{p \pi}{q}$, limits are from minus infinity to infinity. 

 [/INST] After more comments see
\begin{eqnarray}
residue(f,-1+ i) &=& \dfrac{3}{25}-\dfrac{4}{25}i\\
residue(f,-1- i) &=& \dfrac{3}{25}+\dfrac{4}{25}i\\
residue(f, i) &=& -\dfrac{3}{25}+\frac{9 i}{100}\\
residue(f, -i) &=& -\dfrac{3}{25}-\frac{9 i}{100}
\end{eqnarray}
for integral $\displaystyle\int_{-\infty}^\infty \dfrac{x^2}{(x^2+1)^2(x^2+2x+2)}dx$ which lies in upper half plane, only residues in $i$ and $-1+i$ are important that concludes 
$$2\pi i\left(\dfrac{3}{25}-\dfrac{4}{25}i-\dfrac{3}{25}+\frac{9 i}{100}\right)=2\pi i\left(-\frac{7 i}{100}\right)=\dfrac{7}{50}\pi$$
</s>