# Evaluation of the integral $\int_0^\infty \left(\frac{\pi^2}{4}-x^2\right)^{-2}\cdot\frac{\pi^2}{4}\cos^2 x\,dx$

What are the steps to evaluate the following definite integral? (Answer provided)

$$\int_0^\infty {{\pi^2\over 4}\cos^2x\over\left({\pi^2\over4}-x^2 \right)^2} dx={\pi\over 4}$$?

-

Contour integration is how I would approach this integral. \begin{align} \int_0^\infty {{\pi^2\over 4}\cos^2x\over\left({\pi^2\over4}-x^2 \right)^2}\;\mathrm{d}x &=\frac{1}{2}\int_{-\infty}^\infty {{\pi^2\over 4}\cos^2x\over\left({\pi^2\over4}-x^2 \right)^2} \;\mathrm{d}x\tag{1}\\ &=\frac{\pi^2}{2}\int_{-\infty}^\infty\frac{e^{2ix}+2+e^{-2ix}}{(\pi^2-4x^2)^2}\mathrm{d}x\tag{2}\\ &=\frac{\pi^2}{2}\int_{-\infty-i\epsilon}^{\infty-i\epsilon}\frac{e^{2ix}+2+e^{-2ix}}{(\pi^2-4x^2)^2}\mathrm{d}x\tag{3}\\ &=\frac{\pi^2}{2}\oint_{\gamma^+}\frac{e^{2ix}+1}{(\pi^2-4x^2)^2}\mathrm{d}x\\ &+\frac{\pi^2}{2}\oint_{\gamma^-}\frac{e^{-2ix}+1}{(\pi^2-4x^2)^2}\mathrm{d}x\tag{4}\\ &=\frac{\pi^2}{2}\oint_{\gamma^+}\frac{e^{2ix}+1}{(\pi^2-4x^2)^2}\mathrm{d}x\tag{5}\\ \end{align}

1. make the path a bit nicer. Since the integrand is even, let's duplicate the domain of integration and divide by two

2. expand $\cos^2(x)=\dfrac{e^{2ix}+2+e^{-2ix}}{4}$

3. move the path of integration. We cross no non-removable singularities and the connections near $+\infty$ and $-\infty$ vanish.

4. break up the integral into two contours: $\gamma^+$ which passes from $-\infty-i\epsilon$ to $+\infty-i\epsilon$ and then circles back counter-clockwise around the upper half-plane, and $\gamma^-$ which passes from $-\infty-i\epsilon$ to $+\infty-i\epsilon$ and then circles back clockwise around the lower half-plane.

5. $\gamma^-$ circles no singularities, so its integral is $0$.

Account for the residues of the singularities in $(5)$. $$\small\begin{array}{c} \text{singularity}&&\text{integrand}&&\text{first order}&&\text{residue}\\ x=\frac{\pi}{2}&:&\frac{1-e^{2i(x-\pi/2)}}{(-2(x-\pi/2)(2\pi+2(x-\pi/2)))^2}&\to&\frac{-2i(x-\pi/2)}{16\pi^2(x-\pi/2)^2}&\to&\frac{1}{4\pi}\\ x=-\frac{\pi}{2}&:&\frac{1-e^{2i(x+\pi/2)}}{(2(x+\pi/2)(2\pi-2(x+\pi/2)))^2}&\to&\frac{-2i(x+\pi/2)}{16\pi^2(x+\pi/2)^2}&\to&\frac{1}{4\pi} \end{array}$$ Thus, the sum of the residues is $\frac{1}{2\pi}$. Including the $\frac{\pi^2}{2}$ yields an integral of $\frac{\pi}{4}$.

-


\begin{align} \pp\int_{-\infty}^{\infty}{{\pi^{2} \over 4}\cos^{2}\pars{x} \over x^{2} - \mu} \,\dd x&= {\pi^{2} \over 8\root{\mu}}\,\pp\int_{-\infty}^{\infty} \bracks{{\cos^{2}\pars{x} \over x - \root{\mu}} - {\cos^{2}\pars{x} \over x + \root{\mu}}}\,\dd x \\[3mm]&= {\pi^{2} \over 8\root{\mu}}\,\pp\int_{-\infty}^{\infty} {\cos^{2}\pars{x + \root{\mu}} - \cos^{2}\pars{x - \root{\mu}} \over x}\,\dd x \\[3mm]&= {\pi^{2} \over 8\root{\mu}}\,\pp\int_{-\infty}^{\infty} {-4\cos\pars{x}\cos\pars{\root{\mu}}\sin\pars{x}\sin\pars{\root{\mu}} \over x}\,\dd x \\[3mm]&= -\,{\pi^{2}\sin\pars{2\root{\mu}} \over 8\root{\mu}}\,\pp\int_{-\infty}^{\infty} {\sin\pars{2x} \over x}\,\dd x = -\,{\pi^{3} \over 8}\,{\sin\pars{2\root{\mu}} \over \root{\mu}} \end{align}

\begin{align} \pp\int_{-\infty}^{\infty} {{\pi^{2} \over 4}\cos^{2}\pars{x} \over \pars{x^{2} - \mu}^{2}} \,\dd x&= -\,{\pi^{3} \over 8}\, \totald{}{\mu}\bracks{{\sin\pars{2\root{\mu}} \over \root{\mu}}} = -\,{\pi^{3} \over 8}\, \bracks{{\cos\pars{2\root{\mu}} \over \mu} - {\sin\pars{2\root{\mu}} \over 2\mu^{3/2}}} \end{align}

Set $\mu = \pi^{2}/4$: \begin{align} \int_{-\infty}^{\infty} {{\pi^{2} \over 4}\cos^{2}\pars{x} \over \pars{x^{2} - \pi^{2}/4}^{2}} \,\dd x&= -\,{\pi^{3} \over 8}\,\pars{-1 \over \pi^{2}/4} = {\pi \over 2} \end{align}

$$\color{#00f}{\large\int_{0}^{\infty}{{\pi^{2} \over 4}\cos^{2}\pars{x} \over \pars{{\pi^{2} \over 4} -x^{2}}^{2}}\,\dd x} = \half\int_{-\infty}^{\infty} {{\pi^{2} \over 4}\cos^{2}\pars{x} \over \pars{x^{2} - \pi^{2}/4}^{2}} \,\dd x = \color{#00f}{\large{\pi \over 4}}$$

-