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.
Please guide me.
 A: 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).$$
A: $$ \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$
A: 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*}$$

A: 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.
