# Integral of rational function - which contour to use?

Evaluate : $$\int_{-\infty}^{+\infty} \frac {x}{(x^2+2x+2)(x^2+4)}$$

I found that the integrand can be extended to a function on a complex plane has simple poles at $\pm 2i$ and $-1\pm i$. Now I want to compute the integral by contour integration but I am unable to assume any contour here.

Do excuse me , if my approach is wrong.

• What does the "4" in your title mean? Dec 27, 2017 at 16:17
• Use a protractor shape $[-R,R]$ union the top of the circle with center at the origin and radius $R$. For $R$ large the path encloses the poles in the upper half-plane. As $R\to\infty$ the integral along the curved part of the path tends to zero (use that the degree of the denominator is larger than that of the numerator by at least $2$).
– user515219
Dec 27, 2017 at 16:18
• @ G Tony Jacobs, because there are some questions with similar titles.. Dec 27, 2017 at 16:21
• You might consider a more descriptive title, such as "Integral of rational function on real line - which contour to use?" or something more search-engine friendly like that. Dec 27, 2017 at 16:48

Hint: Use upper half plane as contour and fraction decomposition $$\dfrac{z}{(z^2+2z+2)(z^2+4)}=\dfrac{1}{10}\frac{z-2}{z^2+2z+2}-\dfrac{1}{10}\frac{z-4}{z^2+4}$$ then $$\dfrac{1}{10}\int_C\frac{z-2}{z^2+2z+2}-\frac{z-4}{z^2+4}dz=\dfrac{2\pi i}{10}\left(\operatorname*{Res}_{z=i-1}\frac{z-2}{z^2+2z+2}-\operatorname*{Res}_{z=2i}\frac{z-4}{z^2+4}\right)=\dfrac{2\pi i}{10}\left(\frac{i-3}{2i}-\frac{2i-4}{4i}\right)=\color{blue}{-\dfrac{\pi}{10}}$$
Hint: $$\frac {x}{(x^2+2x+2)(x^2+4)}=\frac{1}{10}\frac{x-2}{x^2+2x+2}- \frac{1}{10}\frac{x-4}{x^2+4}$$
$$\frac{x}{(x^2+2x+2)(x^2+4)}=\frac{1}{10}\left[\frac{4-x}{x^2+4}+\frac{x-2}{x^2+2x+2}\right]$$ and now you don't have to pick any contour, since $$\int_{\mathbb{R}}\frac{4\,dx}{x^2+4}=2\pi,\qquad \int_{\mathbb{R}}\frac{3\,dx}{(x+1)^2+1}=\int_{\mathbb{R}}\frac{3\,dx}{x^2+1}=3\pi$$ and $$\lim_{M\to +\infty}\int_{-M}^{M}\left[\frac{x+1}{(x+1)^2+1}-\frac{x}{x^2+4}\right]=0$$ ensure the following identity: $$\int_{-\infty}^{+\infty}\frac{x\,dx}{(x^2+2x+2)(x^2+4)} = \frac{2\pi-3\pi}{10} = \color{red}{-\frac{\pi}{10}}.$$