# How to calculate the principal part of improper integral?

How to calculate the principal part of this improper integral via contour integration?

$$P\int_{0}^{+\infty}\frac{dx}{x^2+x-2}$$

I have seen some examples where you integrate along a semicircle and then take the limit $R\to\infty$, where $R$ is the radius. But here the integrand is not a even function and in addition there are poles on the real line (that's why is divergent)... Any help is appreciated.

-
Does it have to be contour integration? – Fabian Feb 18 '12 at 13:10
Of course not! what matters is the final answer. But it should be possible via contour integration... – quark1245 Feb 18 '12 at 14:04
In my opinion, it's not the final answer that matters, it's the process of reasoning that leads to the final answer that matters. – David Mitra Feb 18 '12 at 14:33
I simply meant that a problem can be solved in different ways, following different lines of thought and you don't have to be single-minded about a particular way to tackle it if it doesn't work... anyway, I agree that in an exercise like this nobody cares if the final digit is wrong or not... – quark1245 Feb 18 '12 at 14:46

Let's factorize the denominator : $x^2+x-2=(x+2)(x-1)$

so that $\displaystyle \frac1{x^2+x-2}=\frac13\left(\frac1{x-1}-\frac1{x+2}\right)$

Let's try a direct proof without complex integration. $$P.V. \int_0^{\infty} \frac 1{x^2+x-2}=\frac13 P.V.\int_0^{\infty} \frac1{x-1}-\frac1{x+2} dx=$$ $$=\frac13 \lim_{\epsilon\to 0}\left[\int_0^{1-\epsilon} \frac1{x-1}-\frac1{x+2} dx+\int_{1+\epsilon}^{\infty} \frac1{x-1}-\frac1{x+2} dx\right]$$

$$=\frac13 \lim_{\epsilon\to 0}\left[ \left[\log(1-x)-\log(x+2)\right]_0^{1-\epsilon}+ \left[\log(x-1)-\log(x+2)\right]_{1+\epsilon}^{\infty}\right]$$ $$=\frac13 \lim_{\epsilon\to 0}\left[\log(\epsilon)-\log(3-\epsilon)+\log(2)-\log(\epsilon)+\log(3+\epsilon)\right]$$ (using $\lim_{R\to \infty}\log\left(\frac{R-1}{R+2}\right)=0$) $$=\frac{\log(2)}3$$

-
Thanks for your help! I believe it's all right but, in general, do you know about some special technique to handle contour integrals with poles on the real axis? – quark1245 Feb 18 '12 at 14:34
@quark1245: when simple poles are on the integration line we just have to divide the residue by $2$. – Raymond Manzoni Feb 18 '12 at 14:40
Can I ask you why? – quark1245 Feb 18 '12 at 14:49
@quark1245: This makes sense only when considering Principal values! Let's consider a disk centered around a simple pole then the integral around the disk is $2\pi i\mathrm{residu}\$. Now cut this disk in two equal parts with a line (crossing the pole of course!). The integral around the disk will be the sum of the two integrals around the half-disks (the line in the middle will be crossed in both directions). Each integral around the half disk will add a contribution $\pi i$ (the important thing is the angle at the pole $\pi\$ here, with other angles the contributions will be unequal!). – Raymond Manzoni Feb 18 '12 at 15:51
Ok, now I see.. thank you again – quark1245 Feb 18 '12 at 16:40