# Evaluating $\int_0^\infty\frac{\cos(ax)}{x^2+1}dx$ without complex analysis or Fourier Transform?

I've been trying to see if there are any real methods of evaluating $$I(a)=\int_0^\infty\frac{\cos(ax)}{x^2+1}dx$$ without invoking the Fourier Transform. I thought about differentiating $$I(a)$$ but it did not lead me anywhere. Are there any ways to evaluate this integral without using complex analysis or Fourier Transform?

• This is (the real part of) a Fourier transform. – Hans Engler May 9 '19 at 21:01
• @HansEngler I want to evaluate it without resorting to the inverse fourier transform. – aleden May 9 '19 at 21:04
• @ThomasAndrews Wouldn't $I''(a)$ be divergent though? – aleden May 9 '19 at 21:08
• Oh, yes, I got it wrong. – Thomas Andrews May 9 '19 at 21:15

Let us write $$J(a)=\int_{-\infty}^\infty\frac{\cos{(ax)}}{x^2+1}\mathrm{d}x=2I(a)$$ Then we have \begin{align} J'(a) &=\int_{-\infty}^\infty\frac{\partial}{\partial a}\left(\frac{\cos{(ax)}}{x^2+1}\right)\mathrm{d}x\\ &=\int_{-\infty}^\infty\frac{-x\sin{(ax)}}{x^2+1}\mathrm{d}x\\ &=-\int_{-\infty}^\infty\frac{x^2\sin{(ax)}}{x(x^2+1)}\mathrm{d}x\\ &=-\int_{-\infty}^\infty\frac{(x^2+1-1)\sin{(ax)}}{x(x^2+1)}\mathrm{d}x\\ &=-\int_{-\infty}^\infty\frac{\sin{(ax)}}{x}-\frac{\sin{(ax)}}{x(x^2+1)}\mathrm{d}x\\ &=-\int_{-\infty}^\infty\frac{\sin{(ax)}}{x}+\int_{-\infty}^\infty\frac{\sin{(ax)}}{x(x^2+1)}\mathrm{d}x\\ &=-\pi+\int_{-\infty}^\infty\frac{\sin{(ax)}}{x(x^2+1)}\mathrm{d}x \,\,\text{ for }a\gt0\\ \end{align} Continuing gives $$J''(a)=\int_{-\infty}^\infty\frac{\partial}{\partial a}\left(\frac{\sin{(ax)}}{x(x^2+1)}\right)\mathrm{d}x=J(a)$$ $$\therefore J''(a)-J(a)=0$$ Which allows $$J(a)$$ to be found by solving the above ODE; $$J(a)=Ae^a+Be^{-a}$$ $$J'(a)=Ae^a-Be^{-a}$$ Then using the initial conditions $$J(0)=\pi$$ and $$J'(0)=-\pi$$ gives $$A+B=\pi$$ $$A-B=-\pi$$ $$\implies A=0,B=\pi$$ Hence $$J(a)=\pi e^{-a}\,\,\text{ for }a\gt0$$ As the function $$J(a)$$ is even we have that $$J(a)=J(-a)$$ and hence $$J(a)=\pi e^{-|a|} \,\,\text{ for all }a\in\mathbb{R}$$ because the value where $$a=0$$ is also consistent with the above formula. Thus the function required $$I(a)=\frac12J(a)$$ is given by $$I(a)=\int_0^\infty\frac{\cos{(ax)}}{x^2+1}\mathrm{d}x=\frac12 \pi e^{-|a|}$$
• Shouldn't there be a factor of $\text{sign}(a)$ at the end of the first chain of equations? And then when you take the second derivative, you do indeed get a $\delta$ function. – John Barber May 9 '19 at 21:17
• @JohnBarber I wrote the condition $a\gt0$ for that reason. – Peter Foreman May 9 '19 at 21:18
• It is true for $a\gt0$ (as I wrote) by making the substitution $u=ax$ and then the fact that $$\int_{-\infty}^\infty \frac{\sin{(x)}}{x}\mathrm{d}x=\pi$$ – Peter Foreman May 9 '19 at 21:22
Writing $$\frac{\cos (a x)}{x^2+1}=\frac{\cos (a x)}{(x+i)(x-i)}=\frac i 2\left(\frac{\cos (a x)}{x+i}-\frac{\cos (a x)}{x-i}\right)$$ and using twice $$\int \frac{\cos (a x)}{x+b}\,dx=\cos (a b)\, \text{Ci}(a (b+x))+\sin (a b)\, \text{Si}(a (b+x))$$ $$\int_0^\infty \frac{\cos (a x)}{x+b}\,dx=\frac{1}{2} (\pi -2 \text{Si}(b |a|)) \sin (b |a|)-\cos (a b) \text{Ci}(b |a|)$$ we should end with $$\int_0^\infty \frac{\cos (a x)}{x^2+1}\,dx=\frac{\pi}{2} (\cosh (|a|)-\sinh (|a|))=\frac{\pi}{2} e^{-|a|}$$