# Calculating the integral $\int_{-\infty}^{\infty} e^{-x^2}\sin^{2}(2016x)\,dx$

I want to calculate the improper integral $$\int_{-\infty}^{\infty} e^{-x^2}\sin^{2}(2016x)\,dx$$ but I don't know how to change the variable.

• As a first start, I'd replace $2016$ by $n$ and set out to compute it for all $n$. There is something definitely generic about $2016$. – Clement C. Jun 11 '16 at 20:36

$$\int\limits_{-\infty }^{+\infty }{{{e}^{-{{x}^{2}}}}{{\sin }^{2}}\beta x\,\,dx=2\int\limits_{0}^{+\infty }{{{e}^{-{{x}^{2}}}}{{\sin }^{2}}\beta x\,\,dx=}}\,\underbrace{\int\limits_{0}^{+\infty }{{{e}^{-{{x}^{2}}}}\,\,dx\,}}_{\frac{\sqrt{\pi }}{2}}-\int\limits_{0}^{+\infty }{{{e}^{-{{x}^{2}}}}\cos 2\beta x\,\,dx}$$ let $$I(\beta )=\int\limits_{0}^{+\infty }{{{e}^{-{{x}^{2}}}}\cos 2\beta x\,\,dx}$$ then

$$I'(\beta )=-2\int\limits_{0}^{+\infty }{x{{e}^{-{{x}^{2}}}}\sin 2\beta x\,\,dx}=\underbrace{\left. {{e}^{-{{x}^{2}}}}\sin 2\beta x \right|_{0}^{+\infty }}_{0}-\underbrace{2\beta \int\limits_{0}^{+\infty }{{{e}^{-{{x}^{2}}}}\cos 2\beta x\,\,dx}}_{2\beta I(\beta )}$$ we have $$I(\beta )=c\,{{e}^{-{{\beta }^{2}}}}$$ we know $I(0)=\frac{\sqrt\pi}{2}$, therefore $I(\beta)=\frac{\sqrt\pi}{2}\,{{e}^{-{{\beta }^{2}}}}$

$$\int\limits_{-\infty }^{+\infty }{{{e}^{-{{x}^{2}}}}{{\sin }^{2}}\beta x\,\,dx=}\frac{\sqrt\pi}{2}-\frac{\sqrt\pi}{2}\,{{e}^{-{{\beta }^{2}}}}$$ Now let $\beta=2016$

• Fine solution, but that huge typesetting is quite disturbing, could you improve formatting? – Jack D'Aurizio Jun 11 '16 at 20:48
• Is it ok.......? – Behrouz Maleki Jun 11 '16 at 20:50
• Much better, thanks and (+1). – Jack D'Aurizio Jun 11 '16 at 20:51

A real-analytic solution. Let $$I(\xi)=\int_{-\infty}^{+\infty} e^{-x^2}\cos(\xi x)\,dx.\tag{1}$$ By differentiation under the integral sign and integration by parts we have: $$I'(\xi) = -\frac{\xi}{2}\,I(\xi),\tag{2}$$ from which it follows that: $$I(\xi) = I(0)\, e^{-\xi^2/4} = \sqrt{\pi}\,e^{-\xi^2/4}.\tag{3}$$ We also have:

$$\begin{eqnarray*} J(n)=\int_{-\infty}^{+\infty}e^{-x^2}\sin^2(nx)\,dx &=& \frac{1}{2}\int_{-\infty}^{+\infty}e^{-x^2}\left(1-\cos(2nx)\right)\,dx\\[0.2cm] &=& \frac{\sqrt{\pi}-I(2n)}{2}\\[0.2cm]&=&\color{red}{\frac{\sqrt{\pi}}{2}\left(1-e^{-n^2}\right)}.\tag{4}\end{eqnarray*}$$

We have $$\int_{-\infty}^{\infty}e^{-x^{2}}\sin^{2}\left(ax\right)dx=-\frac{1}{4}\int_{-\infty}^{\infty}e^{-x^{2}-2aix}dx$$ $$-\frac{1}{4}\int_{-\infty}^{\infty}e^{-x^{2}+2aix}dx+\frac{1}{2}\int_{-\infty}^{\infty}e^{-x^{2}}dx.$$ Now note that $$-\frac{1}{4}\int_{-\infty}^{\infty}e^{-x^{2}-2aix}dx=-\frac{1}{4}e^{-a^{2}}\int_{-\infty}^{\infty}e^{-\left(x+ai\right)^{2}}dx=-\frac{1}{4}e^{-a^{2}}\sqrt{\pi}$$ (for the last identity see here). For the other integrals holds a similar argument, so $$\int_{-\infty}^{\infty}e^{-x^{2}}\sin^{2}\left(ax\right)dx=\frac{\sqrt{\pi}}{2}e^{-a^{2}}\left(e^{a^{2}}-1\right).$$

Break up $\sin^22016x$ into $1,e^{2016ix},e^{-2016ix}$.
You know the integral of $e^{-x^2}1$.
Integrate one of $e^{-x^2+2016ix},e^{-x^2-2016ix}$ over the upper half-plane, and the other over the lower half-plane.

• I should have had 4032 in there :( – Empy2 Jun 11 '16 at 20:42