so I'm trying to evaluate the integral in the title,
$$\int_{-\infty}^{\infty}\frac{1}{x^2}dx$$
by using complex plane integration. I've chosen my contour to be a infinte half circle with it's diameter on the real axis. (integration is preformed ccw).
when R tends to infinity, the arch part of the contour yields zero, and so we are left with the part along the real axis, which is the one I'm trying to evalute.
there are no other poles in my contour, only a second order pole at $z=0$ lying on it. the residue of this pole is $0$ so the integral sums up to be zero (by using Cauchy principal value.)
However my function is always positive and greater than $0$, so this doesn't make sense.
Any help would be appreciated
Usually you'd need this kind of contour if you happen to have poles on the real axis. We take the small radius $r\to 0$ and the large radius $R\to\infty$. The value on the bigger half circle should decay fast enough so the value of the integral would depend on the limit of the smaller half circle.
You can see this example of a similar calculation.