Real Integrals #
In real life, we often want to evaluate real integrals, which is to say we want to integrate a real-valued, single-valued function along the real axis. Numerically, this is pretty straightforward to do using a Riemann sum, although it can become difficult if the function goes to zero very slowly.
We can turn a real integral into a complex contour integral by appropriately choosing a contour in the complex plane such that one segment of the contour corresponds directly with the real integral, and the remaining segment can be evaluated (usually as 0) leaving us with a closed contour integral.
Suppose we want to evaluate
\[\int _{-\infty} ^\infty f(x) \dd x\]We can turn this into a contour integral over the upper half plane (or lower half plane) and taking the limit as \( R \rightarrow \infty \):

where \( C_R \) is a large semicircle and the contour encloses all singularities of \( f(z) \). Along \( C_R \),
\[z = R e^{i \theta} \qquad 0 \leq \theta < \pi\] \[\int _{C_R} f(z) \dd z = \int _0 ^\pi f(R e^{i \theta}) R i e^{i \theta} \dd \theta\]If we can show that \( |z f(z)| \rightarrow 0 \) as \( |z| \rightarrow \infty \), then the \( C_R \) contribution goes to zero. We can use Cauchy’s residue theorem to evaluate the closed contour integral:
\[\int _{-\infty} ^\infty f(x) \dd x = 2 \pi i \sum \text{Residues in upper half plane}\]We could also choose the lower half-plane, as long as we remember to keep the minus sign as \( \theta \) would be going clockwise there.
Example
\[\int _0 ^\infty \frac{1}{1 + x^N} \dd x = \frac{\pi / N}{\sin ( \pi / N)}\]For any positive integer \( N \). First, we want to extend this to cover the whole real axis so that we can close the contour. Since the integrand is even,
\[\int _0 ^\infty \frac{1}{1 + x^N} \dd x = \frac{1}{2} \int _{-\infty} ^\infty \frac{1}{1 + x^N} \dd x\]Then, we need to check that the contribution from the \( C_R \) contour will be zero
\[\lim_{z \rightarrow \infty} \left| z \frac{1}{1 + z^N} \right| = \lim_{z \rightarrow \infty} |z| \left| \frac{1}{1 + z^N} \right|\]We can bring out the reverse triangle inequality here:
\[|z^N + 1 | \geq |z^N| - |1|\]\[\left| z \frac{1}{1 + z^N} \right| \leq \frac{|z|}{|z|^N - 1} = \frac{1}{|z|^{N-1} - \frac{1}{|z|}}\] \[\lim_{z \rightarrow \infty} \frac{1}{|z|^{N-1} - \frac{1}{|z|}} = 0\]
Okay, at this point we can proceed to find the residues:
\[I = \int _{-\infty} ^\infty f(x) \dd x + \int_{C_R} f(z) \dd z = \oint _{\text{UHP}} f(z) \dd z\]At this point we can quote the residue theorem to say
\[I = 2 \pi i \sum \text{Res}[z_i] \quad \text{ for pole }z_i \text{ in upper half plane}\]The simple poles of our \( f(z) \) occur where \( 1 + z^N = 0 \)
\[z^N = -1 = e^{i (\pi + 2 \pi k)}\] \[z = e^{i \frac{\pi + 2 \pi k}{N}} \quad k = 0, 1, \ldots, \frac{N}{2} - 1\]
\[I = 2 \pi i \sum_{k=0} ^{N/2 - 1} \text{Res} \left[ \frac{1}{1 + z^N}, z_k \right]\]We can use the differentiation trick above to find the residues of the simple poles:
\[\text{Res}[z_k] = \left.\frac{1}{ \dv{}{z} (1 + z^N)} \right|_{z_k} = \frac{1}{N z_k ^{N-1}}\] \[I = \frac{\pi i}{N} \sum_{k=0} ^{N/2 - 1} \frac{1}{z_k ^{N-1}} \\ = \frac{\pi i}{N} e^{- \pi i (N-1)/N} \sum_{k=0} ^{N/2 - 1} e^{+ 2 k \pi i / N} \\ = \frac{\pi}{N} \left[ -i e^{i \pi / N} \right] \frac{1 - e^{\frac{2 \pi i}{N} (N/2)}}{1 - e^{2 \pi i / N}}\\ = \frac{\pi}{N} \frac{1}{\sin(\pi / N)}\]Example: Improper integral of an odd rational function
Evaluate
\[I = \int_{0} ^\infty \frac{\dd x}{x^3 + a^3} \qquad a > 0\]Because we have an integral on \( 0, \infty \), we can’t immediately close the contour using \( C_R \) as shown above. We also can’t expand the integral to the whole real axis because \( f(x) \) is not an even function.
However, there is a useful symmetry we can apply here: \( (x e^{2 \pi i / 3})^3 = x^3 \). This suggests using the following contour, where \( C_R \) is the sector \( R e^{i \theta} : 0 \leq \theta \leq 2 \pi / 3 \):

We therefore have:
\[\oint_C \frac{\dd z}{z^3 + a^3} = \left( \int _{C_L} + \int_{C_x} + \int _{C_R} \right) \frac{\dd z}{z^3 + z^3} \\ = 2 \pi i \sum_j \text{Res} \left( \frac{1}{z^3 + z^3}; z_j \right)\]The only pole inside \( C \) satisfies \( z^3 = - a^3 = a^3 e^{i \pi} \) and is given by \( z_1 = ae^{i \pi / 3} \).
The residue is obtained from
\[\text{Res} \left( \frac{1}{z^3 + z^3} ; z_1 \right) = \left( \frac{1}{3 z^3} \right)_{z_1} = \frac{1}{3 a^2 e^{2 \pi i / 3}} = \frac{1}{3 a^2} e^{- 2 \pi i / 3}\]The integral on \( C_L \) is evaluated by making the substitution \( z = e^{2 \pi i / 3} r \) (where the orientation is taken into account)
\[\int _{C_L } \frac{ \dd z}{z^3 + a^3} = \int_{r = R} ^0 \frac{e^{2 \pi i / 3}}{r^3 + a^3} \dd r = - e ^{2 \pi i / 3} I\]Thus taking into account the contributions from \( C_x \) (\( 0 \leq z = x \leq R \) ) and from \( C_L \), we have
\[I (1 - e^{2 \pi i / 3}) = \lim_{R \rightarrow \infty} \int_0 ^R \frac{ \dd r}{r^3 + a^3} (1 - e^{2 \pi i / 3}) = \frac{2 \pi i}{3a^2} e^{- 2 \pi i / 3}\]Thus
\[I = \frac{2 \pi i}{3 a^2} \frac{3^{-2 \pi i / 3}}{1 - e^{2 \pi i / 3}} = \frac{\pi}{3 a^2} \left( \frac{2i}{e^{-i \pi / 3} - e^{i \pi / 3}} \right)e^{-i \pi} \\ = \frac{\pi}{3 a^2 \sin(\pi / 3)} = \frac{2 \pi}{3 \sqrt{3} a^2}\]Trigonometric Integrals over a Period #
For another example, consider an integral of some trigonometric function over a full period:
\[I = \int_0 ^{2 \pi} U(\sin \theta, \cos \theta) \dd \theta\]where \( U \) is some annoying-to-integrate function like \( \sin ^2 \theta / (a + \cos \theta) \). We can turn it into a closed contour integral over the unit circle where
\[z = e ^{i \theta} \qquad 0 \leq \theta < 2 \pi\] \[\dd z = i e^{i \theta} \dd \theta = i z \dd \theta \rightarrow \dd \theta = \frac{\dd z}{i z}\]
\[I = \int_0 ^{2 \pi} U(\sin \theta, \cos \theta) \dd \theta = \oint_{R = 1} \frac{U}{iz} \dd z \\ = 2 \pi i \sum \text{Res}\left[ \frac{U}{iz} \text{ inside unit circle} \right]\]From there, we can re-parameterize \( U \) using
\[\cos \theta = \frac{1}{2} (e ^{i \theta} + e^{-i \theta}) = \frac{1}{2} (z + \frac{1}{z} )\] \[\sin \theta = \frac{1}{2i} (e^{i \theta} - e^{-i \theta}) = \frac{1}{2i} (z - \frac{1}{z})\]
For example, if we have
\[U = \frac{1}{2 + \sin \theta}\]then the integral becomes
\[I = \int_0 ^{2 \pi} \frac{\dd \theta}{2 + \sin \theta} \\ = \oint _C \frac{ \dd z / iz}{2 + \frac{1}{2i} (z - \frac{1}{z})} \\ = \oint_C \frac{2 \dd z}{z^2 + 4iz - 1}\]The simple poles of the integrand are where \( z^2 + 4iz - 1 = 0 \), and these are found at
\[z_1 = (-2 + \sqrt{3})i\\ z_2 = (-2 - \sqrt{3})i\]Of those, only \( z_1 \) is found within the unit circle, so
\[I = 2 \pi i \text{Res}[z_1]\]To find the residue, re-express the integrand using the roots:
\[\frac{2 }{z^2 + 4iz - 1} = \frac{2}{(z - z_1)(z - z_2)}\]and then multiply by \( (z - z_1) \):
\[\text{Res}[z_1] = \lim_{z \rightarrow z_1} \frac{(z - z_1) 2}{(z - z_1)(z - z_2)} \\ = \frac{2}{z_1 - z_2} = \frac{1}{i\sqrt{3}}\] \[I = 2 \pi i \left( \frac{1}{i\sqrt{3}} \right) = \frac{2 \pi}{\sqrt{3}}\]
It is sometimes convenient, when analyzing the behavior of a function near infinity, to make the change of variables \( z = 1/t \). Using \( dz = - \frac{1}{t^2} dt \) and noting that the clockwise (positive direction) of \( C_R: z = R e^{i \theta} \) transforms to a clockwise rotation (negative direction) in \( t \): \( t = 1/z = (1/R)e^{-i \theta} = \epsilon e^{-i \theta} \) we have
\[\text{Res}(f(z); \infty) = \frac{1}{2 \pi i} \oint_{C_{\infty}} f(z) \dd z = \frac{1}{2 \pi i} \oint_{C_{\epsilon}} \left( \frac{1}{t^2} \right) f \left( \frac{1}{t} \right) \dd t\]where \( C_{\epsilon} \) is the limit as \( \epsilon \rightarrow 0 \) of a small circle around the origin in the \( t \) plane. So the residue at \( \infty \) is given by
\[\text{Res}(f(z); \infty) = \text{Res} \left[ \frac{1}{t^2} f(\frac{1}{t}); 0\right]\]that is, the right-hand side is the coefficient of \( t^{-1} \) in the expansion of \( f(1/t)/t^2 \) near \( t = 0 \); the left-hand side is the coefficient of \( z^{-1} \) in the expansion of \( f(z) \) at \( z = \infty \) . Sometimes we write
\[\text{Res}(f(z); \infty) = \lim_{z \rightarrow \infty}(z f(z)) \quad \text{when} \quad f(\infty) = 0\]The concept of residue at infinity is quite useful when we integrate rational functions. Rational functions have only isolated singular points in the extended plane and are analytic elsewhere. Let \( z_1, z_2, \ldots, z_N \) denote the finite singularities. Then, for every rational function,
\[\sum_{j=1}^N \text{Res}(f(z); z_j) = \text{Res}(f(z); \infty)\][]
Theorem
Let \( f(z) = N(z) / D(z) \) be a rational function such that the degree of \( D(z) \) exceeds the degree of \( N(z) \) by at least two. Then
\[\lim_{R \rightarrow \infty} \int_{C_R} f(z) \dd z = 0\]We write
\[f(z) = \frac{a_n z^n + a_{n-1} z^{n-1} + \ldots + a_1 z + a_0}{b_m z^m + b_{m-1} z^{m-1} + \ldots + b_1 z + b_0}\]Then, by repeated application of the triangle inequality,
\[\left| \int_{C_R} f(z) \dd z \right| \leq \int _0 ^\pi (R \dd \theta) \frac{ |a_n| |z|^n + |a_{n-1} | |z| ^{n-1} + \ldots + |a_1| |z| + |a_0|}{|b_m||z|^m - |b_{m-1}| |z| ^{m-1} - \ldots - |b_1| |z| - |b_0|} \\ = \frac{\pi R(|a_n| R^n + \ldots + |a_0|)}{|b_m| R^m - |b_{m-1}| R^{m-1} - \ldots - |b_0|} \rightarrow _{R \rightarrow \infty} 0\]since \( m \geq n + 2 \)
Some integrals that are closely related to the one described above are of the form
\[I_1 = \int _{-\infty} ^{\infty} f(x) \cos (kx) \dd x\] \[I_2 = \int _{-\infty} ^{\infty} f(x) \sin (kx) \dd x\] \[I_{3 \pm} = \int_{-\infty} ^{\infty} f(x) e^{\pm ikx} \dd x \qquad (k > 0)\]
where \( f(x) \) is a rational function satisfying the conditions of the theorem above. These integrals are evaluated by a method similar to the ones described earlier. When evaluating integrals such as \( I_1 \) or \( I_2 \), we first replace them by integrals of the form \( I_3 \). We evaluate, say \( I_{3+} \) by using the contour \( C_R \) above. Again, we need to evaluate the integral along the upper semicircle. Because \( e^{ikz} = e^{ikx} e^{-ky} \), we have \( |e^{ikz}| \leq 1 \) (where \( y > 0 \) ) and
\[\left| \int_{C_R} f(z) e^{ikz} \dd z \right| \leq \int _{0} ^\pi |f(z)| | \dd z| \rightarrow _{R \rightarrow \infty} 0\]from the results of the theorem. Thus using
\[I_{3+} = \int_{-\infty} ^{\infty} f(x) e^{ikx} \dd x \\ = \int_{-\infty}^{\infty}f(x) \cos kx \dd x + i \int_{-\infty}^{\infty}f(x) \sin kx \dd x\]By taking the real and imaginary parts, we can compute \( I_1 \) and \( I_2 \)
\[I_{3+} = I_1 + i I_2 = 2 \pi i \sum_{j=1}^N \text{Res} (f(z) e^{ikz}; z_j)\]Example
Evaluate
\[I = \int_{-\infty} ^\infty \frac{\cos kx}{(x + b)^2 + a^2} \dd x \qquad k > 0, a > 0, b \in \Reals\]We consider
\[I_+ = \int_{-\infty} ^\infty \frac{e^{ikx}}{(x + b)^2 + a^2} \dd x\]and use the contour \( C_R \) shown above to find
\[I_+ = 2 \pi i \text{Res} \left( \frac{e^{ikz}}{(z + b)^2 + a^2}; z_0 = ia - b \right) \\ = 2 \pi i \left( \frac{e^{ikz}}{2 (z+b)} \right) _{z_0 = ia -b } = \frac{\pi}{a} e^{-ka} e^{-ibk}\]From
\[I_+ = \int_{-\infty} ^\infty \frac{\cos kx}{(x + b)^2 + a^2} \dd x + i \int_{-\infty} ^{\infty} \frac{\sin kx}{(x + b)^2 + a^2} \dd x\]we have
\[I = \frac{\pi}{a} e^{-ka} \cos bk\]and
\[J = \int_{-\infty} ^\infty \frac{\sin kx}{(x + b)^2 + a^2} \dd x = \frac{-\pi}{a} e^{-ka} \sin bk\]If \( b = 0 \) the latter formula reduces to \( J = 0 \), which also follows directly from the fact that the integrand is odd. The reader can verify that
\[\left| \int_{C_R} \frac{e^{ikz}}{(z + b)^2 + a^2} \dd z \right| \leq \int_{C_R} \frac{|\dd z|}{|z|^2 - 2 |b| |z| - a^2 - b^2} \\ = \frac{\pi R}{R^2 - 2bR - (a^2 + b^2)} \rightarrow _{R \rightarrow \infty} 0\]In applications we frequently wish to evaluate integrals like \( I_{3\pm} \) involving \( f(x) \) for which all that is known is \( f(x) \rightarrow 0 \) as \( |x| \rightarrow \infty \). From calculus we know that in these cases the integral still converges, conditionally, but our estimates leading to
\[I_{3+} = I_1 + i I_2 = 2 \pi i \sum_{j=1}^N \text{Res} (f(z) e^{ikz}; z_j)\]must be made more carefully. We say that \( f(z) \rightarrow 0 \) uniformly as \( R \rightarrow \infty \) in \( C_R \) if \( |f(z)| \leq K_R \), where \( K_R \) depends only on \( R \) (not on \( \text{arg}(z) \) ) and \( K_R \rightarrow 0 \) as \( R \rightarrow \infty \). We have the following lemma, called Jordan’s Lemma
Jordan’s Lemma #
\[\]Jordan’s Lemma
Suppose that on the circular arc \( C_R \) shown above, we have \( f(z) \rightarrow 0 \) uniforly as \( R \rightarrow \infty \). Then
\[\lim_{R \rightarrow \infty} \int_{C_R} e^{ikz} f(z) \dd z = 0 \qquad (k > 0)\]With \( |f(z)| \leq K_R \) where \( K_R \) is independent of \( \theta \) and \( K_R \rightarrow 0 \) as \( R \rightarrow \infty \),
\[I = \left| \int_{C_R} e^{ikz} f(z) \dd z \right| \leq \int_{0} ^\pi e^{-ky} K_R R \dd \theta\]using \( y = R \sin \theta \) and \( \sin(\pi - \theta) = \sin \theta \)
\[\int_0 ^\pi e^{-ky} \dd \theta = \int_{0}^\pi e^{-kR \sin \theta} \dd \theta = 2 \int_0 ^{\pi / 2} e^{-k R \sin \theta} \dd \theta\]But in the region \( 0 \leq \theta \leq \pi / 2 \) we also have the estimate \( \sin \theta \geq 2 \theta / \pi \)
Thus
\[I \leq 2 K_R R \int_0 ^{\pi / 2} e ^{-2 k R \theta / \pi} \dd \theta = \frac{2 K_R R \pi}{2kR} (1 - e^{-kR})\]and \( I \rightarrow 0 \) as \( R \rightarrow \infty \) because \( K_R \rightarrow 0 \)
We note that if \( k < 0 \), a similar result holds for the contour in the lower half plane. Moreover, by simply rotating the contour, Jordan’s lemma applies to the cases \( k = il, l \neq 0 \). Consequently, the result \( I_{3+} = I_1 + i I_2 = 2 \pi i \sum_{j=1}^N \text{Res} (f(z) e^{ikz}; z_j) \) follows whenever Jordan’s lemma applies.
Let’s see this in action in an example:
Example
Evaluate
\[I = 2 \int_{-\infty}^{\infty}\frac{x \sin \alpha x \cos \beta x}{x^2 + \gamma^2} \dd x \qquad \gamma > 0, \beta \in \Reals\]The trigonometric formula
\[\sin \alpha x \cos \beta x = \frac{1}{2} \left[ \sin(\alpha - \beta)x + \sin(\alpha + \beta)x \right]\]motivates the introduction of the integrals
\[J = \int_{-\infty}^{\infty}\frac{x e^{i (\alpha - \beta)x}}{x^2 + \gamma ^2} \dd x + \int_{-\infty}^{\infty}\frac{x e^{i (\alpha + \beta)x}}{x^2 + \gamma ^2} \dd x + = J_1 + J_2\]Jordan’s lemma applies because the function \( f(z) = z / (z^2 + \gamma ^2) \rightarrow 0 \) uniformly as \( z \rightarrow \infty \), and we note that
\[|f| \leq \frac{R}{R^2 - \gamma^2} \equiv K_R\]We note that the denominator is only one degree higher than the numerator. If \( \alpha - \beta > 0 \) then we close our contour in the upper half plane and the only residue is \( z = i \gamma (\gamma > 0) \), hence
\[J_1 = i \pi e^{-(\alpha - \beta)\gamma}\]On the other hand, if \( \alpha - \beta < 0 \) we close in the lower half plane and find
\[J_1 = - i \pi e^{(\alpha - \beta) \gamma}\]Combining the results
\[J_1 = i \pi \text{sgn}(\alpha - \beta)e^{-|\alpha - \beta | \gamma}\]Similarly, for \( I_2 \) we find
\[J_2 = i \pi \text{sgn}(\alpha + \beta) e^{- |\alpha + \beta| \gamma}\]Thus
\[J = i \pi \left[ \text{sgn}(\alpha - \beta) e^{- |\alpha - \beta| \gamma} + \text{sgn} (\alpha + \beta) e^{- |\alpha + \beta | \gamma} \right]\]and, by taking the imaginary part,
\[I = i \pi \left[ \text{sgn}(\alpha - \beta) e^{- |\alpha - \beta| \gamma} + \text{sgn} (\alpha + \beta) e^{- |\alpha + \beta | \gamma} \right]\]If we take \( \text{sgn}(0) = 0 \) then the case \( \alpha = \beta \) is incorporated in the result.
For another example using Jordan’s lemma:
Example
\[I = \int _0 ^\infty \frac{x \sin (mx)}{a^2 + x^2} \dd x \qquad a > 0, m > 0\]Let’s turn this into the form of \( I_{3+} \) above
\[= \frac{1}{2} \int_{-\infty}^{\infty} \frac{x \sin (mx)}{a^2 + x^2} \dd x = \frac{1}{2} \text{Im} \int_{-\infty}^{\infty}\frac{z e^{imz} \dd z}{a^2 + z^2}\]Here our \( f(z) \) that we want to converge uniformly is
\[f(z) = \frac{z}{a^2 + z^2}\] \[|f(z) | \leq \left| \frac{R}{a^2 - R^2} \right| \rightarrow 0\]Note that this is a weaker convergence than \( |z f(z)| \cancel{\rightarrow} 0 \), so we can’t just disregard the \( C_R \) contour. But we can use Jordan’s lemma:
\[I = \frac{1}{2} \text{Im} \oint _{UHP} \frac{z}{a^2 + z^2} e^{imz} \dd z \\ = \frac{1}{2} \text{Im} \left[ 2 \pi i \text{Res} \left( \frac{z e^{imz}}{a^2 + z^2} ; z = ia \right) \right] \\ = \frac{1}{2} \text{Im} \left[ 2 \pi i \frac{ ai e^{-ma}}{2ai} \right] = \frac{\pi}{2} e^{-ma}\]Improper Integrals #
If \( f(z) \) has a simple pole at \( z = z_0 \), \( \int_C f(z) \dd z \) is an improper integral if \( C \) passes through \( z_0 \). The principal value of an improper integral is the limit
\[P \int_a ^b f(z) \dd z = \lim_{\epsilon \rightarrow 0} \left[ \int_a ^{z_0 - \epsilon} f(z) \dd z + \int_{z_0 + \epsilon} ^b f(z) \dd z \right]\]Such a limit does not exist if \( f(z) \) has a singularity more severe than a single pole on the path of integration.
