# Integrating using the residue theorem

How would I calculate the following integral? $$\int_{-\infty}^\infty \frac{1}{(x^2 + 1)(x^4+4)^2} dx$$ Part (a) says define Laurent's theorem for the Laurent series expansion and give the definition of a residue of a function at point $a$ which I've done, but I can't see how this would help in solving this question?

-
You need to complete the closed curve that is positively oriented. In this case, use $x=Re^{i\theta}$ for $\theta\in(-\pi,0)$ as $R\to\infty$ for the lower half-plane; the integral over this part of the path vanishes so you are left with the residues at $-i$ and $\frac{\pm1-i}{2}$. –  bgins Apr 16 '12 at 10:30
correction: complete the closed curve in the upper upper half plane, with residues at $i$ and $i\pm1$. –  bgins Apr 16 '12 at 12:52
Now wait for the OP to try it before giving more hints or solutions! –  GEdgar Apr 16 '12 at 12:57
@GEdgar: thanks, good advice. It's certainly doable with a little work (partial fraction and residue calculations). –  bgins Apr 16 '12 at 15:39
@bgins Ample time has passed; perhaps you could write a detailed solution now? –  Lord_Farin May 22 '13 at 21:18

## 1 Answer

First, note that $f(x)=1/p(x)$ for $p(x)=(x^2+1)(x^2+2x+2)^2(x^2-2x+2)^2$, so that $p$ has roots (and $f$ has poles) at $\pm i$ of order $1$ and at $\pm i\pm 1$ each of order $2$.

The key point to note is that the integral in question is part of a path that would include the upper half plane (UHP), by including for example the semicircular path $\Gamma_R=\{Re^{i\theta}|\theta\in\left[0,\pi\right]\}$ above $\left[-\infty,\infty\right]$ (on the real line) as $R\to\infty$. There are two aspects to the point. First, that the combined integral, $I=\lim_{R\to\infty}I_R$, over both paths is positively oriented (traverses a simple closed curve in the counterclockwise direction) so that residue theorem applies: $$\DeclareMathOperator{\Res}{Res}$$ $$I_R=\int_{\left[-R,R\right]\cup\Gamma_R}f(z)dz=2\pi{i}\sum_{a\in p^{-1}(0)\cap{\mbox{UHP}}}\Res(f;a) \qquad\mbox{ for }R>\sqrt2;$$

In other words, the "completed" integral is $2\pi i$ times the sum of the residues in the upper half plane, i.e. $a\in\{i,i\pm1\}$. The bad news is that we have to calculate and sum these residues, which is slightly complicated since $p$ has some non-linear quadratic factors (on the positive side, they're only quadratic). The good news, however, is the second key point: that the integral over the path we used to "complete" our path in fact vanishes, which we can see using the parametrization $z=Re^{i\theta}$ (so that $dz=Re^{i\theta}d\theta$):

$$I_\Gamma=\lim_{R\to\infty}I_{\Gamma_R}=\lim_{R\to\infty}\int_{\theta=0}^{\theta=2\pi}\frac{dz}{(z^2+1)(z^4+4)^2}=0\qquad\mbox{since}$$ $$|I_{\Gamma_R}|\le\int_{0}^{2\pi}\frac{|Re^{i\theta}|d\theta}{\left|(R^2e^{i2\theta}+1)(R^4e^{i4\theta}+4)^2\right|}$$ $$=R^{-9}\int_{0}^{2\pi}\frac{d\theta}{\left|(e^{i2\theta}+R^{-2})(e^{i4\theta}+4R^{-4})^2\right|}\to2\pi R^{-9}\to0$$

So all that's left is to compute the residues at $i$, $i+1$ and $i-1$. The first is straightforward:

$$\Res(f;i)=\lim_{x\to i}\frac1{(x+i)(x^4+4)^2}=\frac1{50i}=-\frac{i}{50}$$

For the next two, we need to remember that, if $f$ has a pole of order $n$ at $z=a$, then the residue there is

$$\Res(f;a)=\frac1{(n-1)!}\;\lim_{z\to a}\left(\frac{d}{dz}\right)^{n-1}\!(z-a)^n\,f(z).$$

Let the other poles in the upper half-plane be $a_k=i-(-1)^k$, i.e. $a_1=i+1$ and $a_2=i-1$. Then

$$\Res(f;a_1)=\lim_{z\to a_1}\frac{d}{dz}\!(z-a_1)^2\,f(z).$$

A nice way to evaluate this might be to use this version of the product rule: for $$p(x)=\prod_k p_k(x)^{m_k},\mbox{ we have }\frac{p'}{p}=\sum m_k\frac{p_k'}{p_k}.$$

Thus, noting that $(z-1)^2+1=z^2-2z+2=(z-a_1)(z-\overline{a_1})$ so that $z^4+4=(z^2+2z+2)(z-a_1)(z-\overline{a_1})$, we can continue:

$$\Res(f;a_1)=\lim_{z\to a_1}\frac{d}{dz}\!\left[(z^2+1)^{-1}(z^2+2z+2)^{-2}(z-\overline{a_1})^{-2}\right]$$ $$=\left.\frac{-2}{ (z^2+1)\left(z^2+2z+2\right)^2(z-\overline{a_1})^2 } \left( \frac{z}{z^2+1}+\frac{2(z+1)}{z^2+2z+2}+\frac1{z-\overline{a_1}} \right) \right|_{z=a_1}$$

and with a little perseverance, we should arrive at $$\Res(f;i\pm1)=\frac{11i\mp73}{6400}$$ so that the sum of residues is $\left(\frac{11}{3200}-\frac1{50}\right)i=-\frac{53i}{3200}$ and the original integral is $$\int_{-\infty}^{\infty}\frac{dz}{(z^2+1)(z^4+4)^2}=I=2 \pi i\left(\frac{-53i}{3200}\right)=\frac{53\pi}{1600}.$$

Some relevant sage code to double-check some key steps would be:

var('x'); f = 1/(x^2+1)/(x^4+4)^2; f

# Residues:
r0 = (1/((x+i)*(x^4+4)^2)).subs(x=i); r0
r1 = diff(1/((x^2+1)*(x+i-1)^2*(x^2+2*x+2)^2),x).subs(x=i+1); r1
r2 = diff(1/((x^2+1)*(x+i+1)^2*(x^2-2*x+2)^2),x).subs(x=i-1); r2

# Integral by residue theorem:
I1 = 2*pi*i*(r0+r1+r2); I1

# Integral by sage's symbolic integration:
I2 = integrate(f,x,-infinity,infinity); I2

# Detail of residue r1 calculation:
v1 = ((x^2+1)*((x+1)^2+1)^2*(x+i-1)^2).subs(x=i+1); v1
(-2/v1 * (x/(x^2+1) + 2*(x+1)/(x^2+2*x+2) + 1/(x+i-1))).subs(x=i+1)


Finally, note that the Laurent expansion of $f(z)$ about $z=a$ will include terms of negative as well as positive powers of $(z-a)$, and that the residue is just the coefficient of the $(z-a)^{-1}$ term, which we have (more or less) calculated above at each pole in the upper half plane.

-
I'm amused that you waited so long to answer this question. Good answer. –  mixedmath Nov 25 '14 at 4:00