# How to integrate $\int\limits_0^\infty e^{-a x^2}\cos(b x) dx$ where $a>0$

How to integrate

$$\int\limits_0^\infty e^{-a x^2}\cos(b x) dx$$

where $a>0$

The real problem is this integral

$$\lim\limits_{\alpha\rightarrow 2}\int\limits_0^\infty e^{-a x^\alpha}\cos(b x) dx$$

I tried integration by parts and then the change of variable $z=x^2$ but it does not work.

• The standard way of doing this is using contour integration and cauchy's integral theorem. – user159517 Feb 7 '16 at 18:07

Using Euler's identity, we get:

$$\int\limits_0^\infty e^{-a x^2}\cos(b x) dx=Re \left( \int\limits_0^\infty e^{-a x^2} e^{ibx} dx \right)$$

$$\int\limits_0^\infty e^{-a x^2} e^{ibx} dx = \int\limits_0^\infty e^{-a x^2+ibx} dx$$

Let's forget about imaginary unit and take $ib=\beta$ for simplicity:

$$-ax^2+\beta x=-a (x^2-\frac{\beta}{a}x+\frac{\beta^2}{4a^2})+\frac{\beta^2}{4a}=-a(x-\frac{\beta}{2a})^2+\frac{\beta^2}{4a}$$

$$\int\limits_0^\infty e^{-a x^2+\beta x} dx=e^{\frac{\beta^2}{4a}} \int\limits_0^\infty e^{-a(x-\frac{\beta}{2a})^2} dx$$

I believe you will not have trouble with the rest.

Hints:

$dx=d(x-\frac{\beta}{2a})$

$\beta^2=-b^2$.

• One should be careful about the change of variables, since $\beta/(2a)$ is not real. – Robert Israel Feb 7 '16 at 18:52
• @RobertIsrael, how can I improve my answer to account for this? I know this gets the correct value of the integral anyway, but I don't want to confuse the OP with my sloppy math – Yuriy S Feb 7 '16 at 19:11
• In the complex approach, you estimate the integral from $R$ to $R-\beta/(2a)$. – Robert Israel Feb 7 '16 at 19:21
• @Yuriy S : you need the analytic continuation argument : that if it works for $\beta \in [a;b]$ and that the defined function is analytic in $\beta$ and always bounded (so it is an entire function), then it has to work also for any $\beta \in \mathbb{C}$ (another exactly equivalent way that @ vnd did is expanding $e^{i\beta x}= \sum_{k=0}^\infty \frac{(i\beta x)^k}{k!}$ in your integrand) – reuns Feb 7 '16 at 21:40

I will consider the integral without the limit process. $$I(a,b)=\int\limits_0^\infty e^{-a x^2}\cos(b x) dx=\sum_{n=0}^{\infty}\frac{(-1)^n.b^{2n}}{(2n)!}\int_0^{\infty}x^{2n}e^{-ax^2}dx$$ by expanding the cosine. The integrals in the above sum are the familiar Gaussian Integrals defined by $$I_m=\int_0^{\infty}x^me^{-ax^2}dx$$ for non negative integral m. One may note that $I_0=\frac{1}{2}\sqrt{\frac{\pi}{a}}$ and that $I_{2n}=(-1)^n\frac{d^n}{da^n}I_0$. It follows that $$I(a,b)=\frac{\sqrt\pi}{2}\sum_{n=0}^{\infty}\frac{b^{2n}}{(2n)!}\frac{d^n}{da^n}a^{-\frac{1}{2}}.$$ It is not difficult to see that $$\frac{d^n}{da^n}a^{-\frac{1}{2}}=\frac{-1^n}{\sqrt a}\frac{1.2...(2n-1)}{2^n}\frac{1}{a^n}.$$ Substituting the above in the expression for $I(a,b)$ one has $$I(a,b)=\sqrt{\frac{\pi}{4a}}\sum_{n=0}^{\infty}\frac{1}{n!}\left(-\frac{b^2}{4a}\right)^n$$ $$\implies I(a,b)=\sqrt{\frac{\pi}{4a}} e^{-\frac{b^2}{4a}} .$$