Real Integrals
There are a few cases where we can use complex contour integrals to simplify finding real valued integrals.
Full Period Trigonometric Integrals
If we have an integral of the form
with a rational function of and we can do some magic with a closed contour integral around the unit circle.
We can let we get
Additionally,
and because our integral ranges from to the variable ranges counterclockwise once around the unit circle, so our integral becomes
We then can proceed with a normal contour integral, using residue methods to deal with any singularities enclosed by the contour.
We can use this technique to prove the following theorem
Improper Integrals
This method applies for integrals of the form
where is a @rational-function. It can also be used with integrals of the form
where is both rational and @even.
As an example, let's look at
We can solve this real integral by looking at the complex contour integral
with being the upper half-circle closed along the -axis:

Here, is the entire contour, and the part labeled is the upper half-circle.
The key concept is that if we rewrite (a) as
then the semi-circle grows to enclose the entire upper half-plane. If the value of the complex contour integral along goes to as goes to infinity, then the contour integral is equivalent to the integral along the real axis, and we can use residue methods to compute it, accounting for any singularities in the upper half-plane.
In order for to approach as a sufficient condition is that the denominator of has a power of at least two degrees higher than the numerator, which applies in our case.
Now, has 4 zeros, but only two of them, and occur in our semi-circle (i.e. they are in the upper half plane).
Using the Residue Theorem, we have then that
Putting this all together, we have, in general, with the conditions specified,
Improper Integrals with Simple Poles on the Real Axis
Let's say we have an integral
whose integrand becomes infinite at a point in the interval of integration.
Then, (a) means, by definition
However, it may be the case that neither limit exists when both and approach independently, but that the limit
does exist.
This limit is called the Cauchy principal value of the integral and is written as
This principal value can exist, although the integral itself is undefined. We can use this for the following theorem in the case there are simple poles on the real axis and we have an integral from to
Putting this all together, we get, for an integral that has poles off of the real axis and simple poles on the real axis, we get
where the first sum covers all the poles in the upper half-plane and the second over all the poles on the real axis (which must be simple.
For example, given the situation illustrated below:

we have
