# Stuck on this integration $\int_0 ^\infty \frac{1}{1+x^2} \cos(kx) dx =\frac{\pi}{2}e^{-k}$ [duplicate]

I'm not sure how to show this

$$\int_0 ^\infty \frac{1}{1+x^2} \cos(kx) \ \mathrm dx =\frac{\pi}{2}e^{-k}$$

I tried by parts but I'm not getting anywhere, I'd really appreciate the help

• Compute residues? – abnry Mar 25 '15 at 20:03
• The integral is yearning for parameter differentiation. – Gabriel Romon Mar 25 '15 at 20:12
• Heuristically, if you let $f(k):=\int_0 ^\infty \frac{1}{1+x^2} \cos(kx)$, differentiation under the integral sign yields $f''(k)=-\int_0 ^\infty \frac{x^2}{1+x^2} \cos(kx)$. Hence $f''(k)-f(x)\approx-\int_0^\infty cos(kx)\approx0$. This a nice ODE. – Gabriel Romon Mar 25 '15 at 20:21
• Other duplicates can also be found here. – Lucian Mar 25 '15 at 20:36

(N.B.: throughout, I assume $k>0$; since the integral is clearly an even function of $k$ for real $k$, this is sufficient.)

I would say you have four main options here:

1. Use the Fourier inversion theorem: we know that the Fourier transform of a function has a unique inverse. This carries over to the cosine transform as $$\int_0^{\infty} f(x) \cos{kx} \, dx = F(k) \iff \int_0^{\infty} F(k) \cos{kx} \, dk = \pi f(x)$$ The unique continuous function on the positive real axis with Fourier transform $1/(1+x^2)$ is $e^{-k}/2$, and the inversion theorem above gives the result. (You may call this a bit cheap, of course... I was lucky in knowing what transformed to $1/(1+x^2)$.)

2. Use differentiation under the integral sign: (this way is also going to be mildly illegal) Write $$I(k) = \int_0^{\infty} \frac{\cos{kx}}{1+x^2} \, dx.$$ Then $$I''(k) = \int_0^{\infty} \frac{-x^2\cos{kx}}{1+x^2} \, dx = I(k) + \int_0^{\infty} \cos{kx} \, dx$$ At this point you should panic and say that this integral is not defined. Correct, but formally it is $2\pi\delta(k)$. Since we are only dealing with positive $k$, I'm going to forget about it (which, again, is illegal; perhaps the more sensible way to do it is to insert a factor $e^{-\lambda x}$, get the last answer as $$\int_0^{\infty} e^{-\lambda x} \cos{kx} \, dx= \frac{\lambda}{\lambda^2+k^2},$$ and then set $\lambda=0$.) The solution to the differential equation $$I''(k)-I(k)=0$$ is $I(k)=A e^k + Be^{-k}$, but the Riemann-Lebesgue lemma (or doing some integration by parts on the original integral) tells us that $A=0$. Therefore we only have to find $B=I(0)$, which is also known as $$\int_0^{\infty} \frac{dx}{1+x^2} = \frac{\pi}{2},$$ which gives the answer.

3. Actually do the integral (I): okay, now we're getting serious. Notice that $$\int_0^{\infty} f(x) \cos{kx} \, dx = \frac{1}{2}\int_0^{\infty} f(x) e^{ikx} \, dx + \frac{1}{2}\int_0^{\infty} f(x) e^{-ikx} \, dx = \frac{1}{2}\int_{-\infty}^{\infty} (f(x)+f(-x))e^{ikx} \, dx,$$ so this gives in the case of our even function, $$I(k) = \int_{-\infty}^{\infty} \frac{e^{ikx}}{1+x^2} \, dx,$$ and we now do the integral using complex analysis, taking a closed semicircular contour in the upper half-plane, using Jordan's lemma to show the integral over the semicircle vanishes, and finding the residue at $x=i$.

4. Actually do the integral (II): fine, you say, but what about without complex analysis? Use the Schwinger parametrisation, $$\frac{1}{1+x^2} = \int_0^{\infty} e^{-\alpha(1+x^2)} \, d\alpha,$$ and interchange the order of integration. You then have to do $$\int_0^{\infty} e^{-\alpha x^2} \cos{kx} \, dx,$$ which can be done by differentiating with respect to $k$ and integrating by parts. Finally, do the $\alpha$ integral.

Let $I(k)$ denote the given integral. Take the Laplace transform: \begin{align*}\mathcal{L}\{I(k)\}&=\int_0^\infty\int_0^\infty \frac{\cos kx}{1+x^2}e^{-sk}\,dk\,dx\\\\ &=\int_0^\infty\frac{1}{1+x^2}\mathcal{L}\{\cos kx\}\,dx\\\\ &=\int_0^\infty\frac{s}{(1+x^2)(s^2+x^2)}\,dx\\\\ &=\int_0^\infty\left(\frac{s}{(s^2-1)(1+x^2)}-\frac{s}{(s^2-1)(s^2+x^2)}\right)\,dx\\\\ &=\frac{s}{s^2-1}\left(\frac{\pi}{2}-\frac{\pi}{2s}\right)\end{align*} Finding the inverse gives the desired result.

• Of course, that last step's a lot easier when you see that the bracket contains $\frac{s-1}{s}$, so the Laplace Transform is just $\frac{\pi}{2}\frac{1}{1+s}$. – Chappers Mar 26 '15 at 3:55

Just write the integral as

$$\frac{1}{2}\int_{-\infty}^{\infty} \frac{\cos kx}{1+x^2} = \frac{1}{4}\int_{-\infty}^{\infty} \frac{e^{ikx}}{1+x^2}dx + \frac{1}{4}\int_{-\infty}^{\infty} \frac{e^{-ikx}}{1+x^2}dx$$

and now check the Fourier transform and inverse Fourier transform of $\frac{1}{1+x^2}$