TITLE: Calculating the integral $\int_{-\infty}^{\infty} e^{-x^2}\sin^{2}(2016x)\,dx$
QUESTION [7 upvotes]: 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.

REPLY [5 votes]: 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).$$