# Applications of Residues: Evaluation of Improper Integrals 2

In this lecture, we study improper integrals of the form $\int_{-\infty}^\infty f(x)\sin axdx$ or $\int_{-\infty}^\infty f(x)\cos axdx$, where $a$ denotes a positive constant. These integrals appear in Fourier analysis. Assume that $f(x)=\frac{p(x)}{q(x)}$, where $p(x)$ and $q(x)$ are polynomials with real coefficients and no factors in common. Also, $q(z)$ has no real zeros. We discuss how to evaluate improper integrals of the above type through the following example.

Example. Evaluate $\int_{-\infty}^\infty\frac{\cos 3x}{(x^2+1)^2}dx$.

Solution. Let $f(z)=\frac{1}{(z^2+1)^2}$. Then $f(z)e^{3iz}$ is analytic everywhere on and above the real axis except at $z=i$. Let $C_R$ be the upper semi-circle centered at the origin with radius $R>1$. Then by Cauchy’s Residue Theorem,
$$\int_{-R}^R\frac{e^{i3x}}{(x^2+1)^2}dx=2\pi i B_1-\int_{C_R}f(z)e^{i3z}dz,$$
where $B_1=\mathrm{Res}_{z=i}[f(z)e^{i3z}]$. $f(z)e^{i3z}$ can be written as
$$f(z)e^{i3z}=\frac{\phi(z)}{(z-i)^2},$$
where $\phi(z)=\frac{e^{i3z}}{(z+i)^2}$. Since $z=i$ is a pole of order $2$ of $f(z)$,
$$B_1=\phi’(i)=\frac{1}{ie^3}.$$
On $C_R$, $|z|=R$ and so by triangle inequality we obtain
$$|(z+i)^2|\geq (R^2-1)^2$$
and thereby
$$|f(z)|\leq\frac{1}{(R^2-1)^2}.$$
$|e^{i3z}|=e^{-3y}\leq 1$ for all $y\geq 0$. Hence, we find that
$$\left|\mathrm{Re}\int_{C_R}f(z)e^{i3z}dz\right|\leq\left|\int_{C_R}f(z)e^{i3z}dz\right|\leq\frac{\pi R}{(R^2-1)^2}\to 0$$
as $R\to\infty$. Therefore,
$$\int_{-\infty}^\infty\frac{e^{i3x}}{(x^2+1)^2}dx=\frac{2\pi}{e^3}.$$

# Applications of Residues: Evaluation of Improper Integrals

Recall the definition of improper integrals in calculus:
\begin{align*}
\int_0^\infty f(x)dx&=\lim_{R\to\infty}\int_0^R f(x)dx,\\
\int_{-\infty}^\infty f(x)dx&=\lim_{R_1\to\infty}\int_{-R_1}^0 f(x)dx+\lim_{R_2\to\infty}\int_0^{R_2}f(x)dx.
\end{align*}
The Cauchy Principal Value (P.V.) is given by
$$\mathrm{P.V.}\int_{-\infty}^\infty f(x)dx=\lim_{R\to\infty}\int_{-R}^R f(x)dx.$$
The Cauchy principal value of an improper integral is not necessarily the same as the improper integral. For example,
$$\mathrm{P.V}\int_{-\infty}^\infty xdx=\lim_{R\to\infty}\int_{-R}^R xdx=0,$$
while
$$\int_{-\infty}^\infty xdx=\lim_{R_1\to\infty}\int_{-R_1}^0xdx+\lim_{R_2\to\infty}\int_0^{R_2}xdx=-\infty+\infty$$
is undefined. In general, if $\int_{-\infty}^\infty f(x)dx<\infty$ then $\mathrm{R.V.}\int_{-\infty}^\infty f(x)dx<\infty$, but the converse need not be true. Suppose that $f(x)$ is an even function. Then
\begin{align*}
\int_0^R f(x)dx&=\frac{1}{2}\int_{-R}^R f(x)dx,\\
\int_{-R_1}^0 f(x)dx&=\int_0^{R_1}f(x) dx.
\end{align*}
So,
$$\mathrm{P.V.}\int_{-\infty}^\infty f(x)dx=\int_{-\infty}^\infty f(x)dx=2\int_0^\infty f(x)dx.$$

Let us consider an even function $f(x)$ of the form $f(x)=\frac{p(x)}{q(x)}$, where $p(x)$, $q(x)$ are polynomials with real coefficients no factors in common. Furthermore, we assume that $q(z)$ has no real zeros but has at least one zero above the real axis. Let us consider a positively oriented upper semicircle $C_R$ whose radius $R$ is large enough to contain all the zeros above the real axis as shown in the figure below.

$C_R$ together with the interval $[-R,R]$ form a positively oriented simple closed contour. Then by Cauchy’s Residue Theorem we have
$$\int_{-R}^R f(x)dx+\int_{C_R} f(z)dz=2\pi i\sum_{k=1}^n\mathrm{Res}_{z=z_k}f(z),$$
i.e.
$$\int_{-R}^R f(x)dx=2\pi i\sum_{k=1}^n\mathrm{Res}_{z=z_k}f(z)-\int_{C_R} f(z)dz.$$
If $\lim_{R\to\infty}\int_{C_R} f(z)dz=0$ then
$$\mathrm{P.V.}\int_{-\infty}^\infty f(x)dx=2\pi i\sum_{k=1}^n\mathrm{Res}_{z=z_k}f(z).$$
If in addition $f(x)$ is even,
$$\int_{-\infty}^\infty f(x)dx=2\pi i\sum_{k=1}^n\mathrm{Res}_{z=z_k}f(z)$$
or
$$\int_0^\infty f(x)dx=\pi i\sum_{k=1}^n\mathrm{Res}_{z=z_k}f(z).$$

Example. Let us consider the improper integral
$$\int_0^\infty\frac{x^2}{x^6+1}dx.$$
Let $f(z)=\frac{z^2}{z^6+1}$ has isolated singularities at the zeros of $z^6+1$, and is analytic everywhere else. $z^6=-1$ has solutions (the sixth roots of $-1$)
$$c_k=\exp\left[i\left(\frac{\pi}{6}+\frac{2k\pi}{6}\right)\right],\ k=0,1,\cdots,5.$$
The first three roots
$$c_0=e^{i\frac{\pi}{6}},\ c_1=i,\ c_2=e^{i\frac{5\pi}{6}}$$
lie in the upper half plane. Let us consider a positively oriented upper semicircle $C_R$ whose radius $R$ is greater than $1$.

Then
$$\int_{-R}^Rf(x)dx=2\pi(B_0+B_1+B_2)-\int_{C_R}f(z)dz,$$
where $B_k$ is the residue of $f(z)$ at $c_k$, $k=0,1,2$. $B_k$ can be found as we studied here
$$B_k=\mathrm{Res}_{z=c_k}\frac{z^2}{z^6+1}=\frac{c_k^2}{6c_k^5}=\frac{1}{6c_k^3},\ k=0,1,2.$$
Thus, we obtain
$$2\pi(B_0+B_1+B_2)=2\pi\left(\frac{1}{6i}-\frac{1}{6i}+\frac{1}{6i}\right)=\frac{\pi}{3}$$
and hence,
$$\int_{-R}^R f(x)dx=\frac{\pi}{3}-\int_{C_R}f(z)dz.$$
On $C_R$, $|z|=R$ so
$$|z^6+1|\geq ||z|^6-1|=|R^6-1|=R^6-1$$
and thereby we obtain
$$|f(z)|\leq\frac{R^2}{R^6-1}.$$
Since the length of $C_R$ is $\pi R$,
$$\left|\int_{C_R} f(z)dz\right|\leq\frac{R^2}{R^6-1}\cdot\pi R\to 0$$
as $R\to\infty$. Hence,
$$\mathrm{P.V.}\int_{-\infty}^\infty\frac{x^2}{x^6+1}dx=\lim_{R\to\infty}\frac{x^2}{x^6+1}dx=\frac{\pi}{3}.$$
Since the integrand is even,
$$\int_{-\infty}^\infty\frac{x^2}{x^6+1}dx=\frac{\pi}{3}$$
and
$$\int_0^\infty\frac{x^2}{x^6+1}dx=\frac{\pi}{6}.$$