# Evaluate $\int_0^{\infty}\frac{\cos(3x)}{x^2+12} \ dx$ using resiude theory.

I'm presenting my solution and I'd like to have it undergo some constructive scrutiny here. Is my solution mathematically correct and easy to follow?

Any room for improvement and making it more effective/shorter?

Note that I don't want an alternate fancy solution using weird theory I've never run into, but I want this one to be improved upon.

## Part 1 - Find the value using residue.

Denote the integral as $$I$$, since the integrand is an even function, we can write

$$I'=2I=\int_{-\infty}^{\infty}\frac{\cos(3x)}{x^2+12} \ dx.\tag1$$

Let's integrate over semi-disk with radius $$R$$ on the upper half plane, where $$\gamma$$ is the semi-circle curve going counter clockwise from $$0$$ to $$\pi$$ and the complete contour $$C$$ is $$\gamma \cup [-R,R].$$ Let

$$f(z)=\frac{e^{3iz}}{z^2+12}\tag2$$

Using Eulers formula, we have that our sought integral is

$$I = \frac{I'}{2}=\Re\left(\frac{1}{2}\oint_Cf(z) \ dz\right)=\underbrace{\Re\left(\frac{1}{2}\oint_\gamma f(z) \ dz\right)}_{=I_1}+\underbrace{\Re\left(\frac{1}{2}\int_{-R}^Rf(z) \ dz\right)}_{I}. \tag3$$

We need to find $$I$$ as $$R\rightarrow\infty$$ and show that $$I_1\rightarrow 0$$ as $$R\rightarrow \infty$$

Let's start with finding the value of $$I$$ using residue theorem. We have that the poles are given by $$z^2+12=0 \Leftrightarrow z_1 = 2i\sqrt{3}$$ and $$z_2 = -2i\sqrt{3}$$ but only $$z_1$$ is inside of $$C$$, thus the residue is given by

$$\text{Res}_{z_1}(f(z))=\frac{e^{3iz_1}}{2z_1}=\frac{e^{-6\sqrt{3}}}{4i\sqrt{3}},\tag4$$

the value of our integral is then

$$I=\frac{1}{2}\Re\left(2\pi i \text{Res}_{z_1}(f(z))\right) = \Re\left(2\pi i \frac{e^{-6\sqrt{3}}}{4i\sqrt{3}}\right) = \boxed{\frac{\pi}{4\sqrt{3}e^{6\sqrt{3}}}.}\tag 5$$

## Part 2 - Show that $$I_1\rightarrow0$$ as $$R\rightarrow \infty$$

Showing that the real part of $$\oint_\gamma f(z) \ dz$$ tends to zero is the same as showing that the entire integral, including the imaginary part tends to zero, so we can get rid of the $$\Re.$$ We want to find some bounds for the integral and then let $$R\rightarrow \infty.$$ Using $$z = Re^{3it} \implies dz = 3Rie^{3it} \ dt$$ We have that

$$\oint_\gamma \frac{e^{3iz}}{z^2+12} \ dz = \int_0^\pi \frac{e^{3iRe^{3it}}}{R^2e^{6it}+12} \cdot 3Rie^{3it}\ dt = 3Ri\int_0^\pi\frac{e^{3iRe^{3it}}\cdot e^{3it}}{R^2e^{6it}+12} \ dt \tag6$$

The triangle inequality for integrals gives

$$\left|3Ri\int_0^\pi\frac{e^{3iRe^{3it}}\cdot e^{3it}}{R^2e^{6it}+12} \ dt\right|\le 3R\int_0^\pi\frac{|e^{3iRe^{3it}}|\cdot |e^{3it}|}{|R^2e^{6it}+12|} \ dt = 3R\int_0^\pi\frac{|e^{3iRe^{3it}}|}{|R^2e^{6it}+12|} \ dt. \tag 7$$

Before we can move on we have to do some sidework. For large $$R$$ we have that

$$|R^2e^{6it}-(-12)|\ge ||R^2e^{6it}|-|-12|| = R^2-12. \tag8$$

For the numerator we have that

$$|e^{3iRe^{3it}}| = |e^{3Ri(\cos(3t)+i\sin(3t))}|=|e^{3Ri\cos(3t)}|\cdot |e^{-3R\sin(3t)}|\le 1. \tag 9$$

since the factor containing cosine has modulus equal to $$1$$ and the second factor is always less than or equal to $$1$$ for $$R\in[0,\infty)$$. Finally, proceeding with $$(7)$$ we have that

$$3R\int_0^\pi\frac{|e^{3iRe^{3it}}|}{|R^2e^{6it}+12|} \ dt \leq 3\int_0^{\pi}\frac{R}{R^2-1} \ dt \rightarrow 0, \quad R\rightarrow \infty, \tag{10}$$

since the denominator contains the dominating term.

Be careful. It's not true that $$|e^{-3R\sin(3t)}|\leq 1$$ for all $$R\in[0,\infty]$$ and $$t\in[0,\pi]$$. Namely, at $$t=\pi/2$$, we have $$\sin(3\pi/2)=-1$$. This would make $$e^{-3R(-1)}=e^{3R}$$ which grows exponentially as $$R\rightarrow\infty$$.
Also, you can't always pass the limit inside an integral without checking other conditions first (usually related to uniform convergence). I was taught to use an estimation, $$$$\bigg|\int_\Gamma f(z) dz\bigg| \leq M\cdot l(\Gamma)$$$$ where $$M = \max\limits_{z\in\Gamma} |f(z)|$$ and $$l(\Gamma)$$ is the length of the contour. This, or Jordan's lemma.