# A little rusty on my contour integration..

$\displaystyle\int_{0}^{\infty}\frac{x^2}{(x^2+1)^2(x^2+2x+2)}dx$

via finding the poles of the integrand and then construncting a contour to take advantage of cauchy's residue theorem. I have already computed the residues, but I keep coming up with something like $\frac{5 \pi}{3}$. However it is now to my realization that the integral is not symmetric about 0, so we have to find a different approach...

Thanks! EDIT: this isn't homework, I've been doing some integration problems on my own to brush up on it.

• So, what contour did you construct? – Marek Oct 3 '13 at 6:20
• I had chosen just a a contour around the upper unit circle, but I didn't even think about branch cuts... – DaveNine Oct 3 '13 at 9:11
• David: your integrand has no branch cuts per se. The technique below involves introducing a log for the explicit purpose of exploiting its branch cut. In this way, we get the original integral back without resorting to symmetry of the integrand, which in this case we did not have. – Ron Gordon Oct 3 '13 at 9:49
• Ah, I see. So I guess the obvious question is is there a way without exploiting the branch cut? – DaveNine Oct 4 '13 at 0:55

This may be done by considering the integral

$$\oint_C dz \frac{z^2 \log{z}}{(z^2+1)^2 (z^2+2 z+2)}$$

where $C$ is a keyhole contour of large radius $R$ and small radius $\epsilon$ about the positive real axis, as pictured below.

If you work out the integrals along each part of the contour $C$, we get that this contour integral is equal to

$$\int_{\epsilon}^R dx \frac{x^2 \log{x}}{(x^2+1)^2 (x^2+2 x+2)} + i R \int_0^{2 \pi} d\theta \, e^{i \theta} \frac{R^2 e^{i 2 \theta} \left (\log{R} + i \theta \right)}{(R^2 e^{i 2 \theta}+1)^2 (R^2 e^{i 2 \theta} + 2 R e^{i \theta} + 2) } \\ + \int_R^{\epsilon} dx \frac{x^2 (\log{x}+i 2 \pi) }{(x^2+1)^2 (x^2+2 x+2)}+ i \epsilon \int_{2 \pi}^0 d\phi\, e^{i \phi} \frac{\epsilon^2 e^{i 2 \phi} \left (\log{\epsilon} + i \phi \right)}{(\epsilon^2 e^{i 2 \phi}+1)^2 (\epsilon^2 e^{i 2 \phi}+ 2 \epsilon e^{i \phi}+2)}$$

We take the limit as $R \to \infty$ and $\epsilon \to 0$; the second and fourth integrals vanish and the contour integral reduces to

$$-i 2 \pi \int_0^{\infty} dx \frac{x^2}{(x^2+1)^2 (x^2+2 x+2)}$$

By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the sum of the residues at the poles of the integrand of the contour integral. For this integrand, there are double poles at $z=\pm i$ and simple poles at $z=-1 \pm i$.

Now, before we compute the residues, it is imperative that we get the branch of the logarithm correct. In this case, we assumed that the branch is taken about the positive real axis, so that the arguments of the poles must run between $0$ and $2 \pi$. Thus, the poles are taken to be at (double poles) $z=e^{i \pi/2}$, $z=e^{i 3 \pi/2}$, (simple poles) $z=\sqrt{2} e^{i 3 \pi/4}$, $z=\sqrt{2} e^{i 5 \pi/4}$.

For the residue calculation, I will simply state the results without showing the differentiation and algebra, which I think the reader should be able to do on his/her own.

\begin{align}\operatorname*{Res}_{z=e^{i \pi/2}} \frac{z^2 \log{z}}{(z^2+1)^2 (z^2+2 z+2)} &= \left [\frac{d}{dz} \frac{z^2 \log{z}}{(z+i)^2 (z^2+2 z+2)} \right ]_{z=e^{i \pi/2}}\\ &= \left (-\frac{1}{10}-i \frac{1}{20} \right ) - \left (\frac{9}{200}+ i \frac{3}{50} \right ) \pi\end{align}

\begin{align}\operatorname*{Res}_{z=e^{i 3 \pi/2}} \frac{z^2 \log{z}}{(z^2+1)^2 (z^2+2 z+2)} &= \left [\frac{d}{dz} \frac{z^2 \log{z}}{(z-i)^2 (z^2+2 z+2)} \right ]_{z=e^{i 3 \pi/2}}\\ &= \left (-\frac{1}{10}+i \frac{1}{20} \right ) + \left (\frac{27}{200}- i \frac{9}{50} \right ) \pi\end{align}

\begin{align}\operatorname*{Res}_{z=\sqrt{2} e^{i 3 \pi/4}} \frac{z^2 \log{z}}{(z^2+1)^2 (z^2+2 z+2)} &= \left [ \frac{z^2 \log{z}}{(z^2+1)^2 (2 z+2)} \right ]_{z=\sqrt{2} e^{i 3 \pi/4}}\\ &= \left (\frac{3 \log{2}}{50}-i \frac{2 \log{2}}{25} \right ) + \left (\frac{3}{25}+ i \frac{9}{100} \right ) \pi\end{align}

\begin{align}\operatorname*{Res}_{z=\sqrt{2} e^{i 5 \pi/4}} \frac{z^2 \log{z}}{(z^2+1)^2 (z^2+2 z+2)} &= \left [ \frac{z^2 \log{z}}{(z^2+1)^2 (2 z+2)} \right ]_{z=\sqrt{2} e^{i 5 \pi/4}}\\ &= \left (\frac{3 \log{2}}{50}+i \frac{2 \log{2}}{25} \right ) + \left (-\frac{1}{5}+ i \frac{3}{20} \right ) \pi\end{align}

We form the sum of these residues; from the above analysis, we conclude that the integral we seek is the negative of this sum. Of course, the imaginary part of the sum of the residues vanishes, as you will verify. The final result is

$$\int_0^{\infty} dx \frac{x^2}{(x^2+1)^2 (x^2+2 x+2)} = \frac15 - \frac{3 \log{2}}{25} - \frac{\pi}{100} \approx 0.0854$$

This was verified in Mathematica.

• Do you think the picture can be made a little smaller? – Pedro Tamaroff Oct 3 '13 at 14:59
• The master strikes again! Nice expaination Ron. I never have really understood branch cuts that well. – Bennett Gardiner Oct 4 '13 at 0:17
• @DavidSacco: the intuition behind the log is its multivaluedness. Think of it this way: $$\log{(x e^{i 2 \pi})} = \log{x} + i 2 \pi$$ This is why we have the branch cut along the positive real axis, and we define all complex numbers $z$ such that $\arg{z} \in [0,2 \pi]$. – Ron Gordon Oct 4 '13 at 1:19
• Dear Ron - I was touched by your appreciation of Bennett's comment. I follow you often, and of course express my appreciation with upvotes. Yet, forgive me for being remiss and not explicitly saying what a fabulous contribution you make. First, your pedagogy is impeccable. And I also greatly benefit from what I would characterize as you staying power and energy to solve these problems. No short sprints. And, maybe most important, your generosity and patience in helping others. Very, very cool. Regards, – user12802 Oct 4 '13 at 22:02
• @Andrew: wow, thanks for the kind words! That's fantastic that you get something out of posts like this. Please chime in with any questions or insights you might have. – Ron Gordon Oct 4 '13 at 22:22