# Evaluating the definite integral $\int_{-c}^{c} e^{-ax^2}\cos^2(bx) \,\mathrm{d}x$

How can one evaluate the following integral?

$$\int_{-c}^{c} e^{-ax^2}\cos^2(bx) \,\mathrm{d}x$$

Wolfram Alpha gives this. Is there not a more compact form?

If $\int_{-c}^{c} e^{-ax^2} \, \mathrm{d}x=k$, then can we express the first integral in terms of $k$? Thanks.

-
Your k is essentially erf, and erfi is defined in terms of erf, so when WolframAlpha represents the answer in terms of erf and erfi, it is essentially representing it in terms of your k. –  tzs Oct 16 '11 at 14:13
@tzs: Thanks. I am not too familiar with erfs and erfis. What would the integral be then when written in $k$? –  greg Oct 16 '11 at 14:14
For a start, you would have $\text{Erf}[\sqrt{a} c] =k\sqrt{\frac{a}{\pi}}$ –  Henry Oct 16 '11 at 14:30
@Henry: Thanks. How do we deal with the erfi's? –  greg Oct 16 '11 at 14:33
$\text{erfi}(x) = -i \text{erf}(ix)$ –  Robert Israel Oct 16 '11 at 21:15

How can one integrate $\int_{-c}^{c} e^{-ax^2}\cos^2(bx) \,\mathrm{d}x$?
Write $$\cos^2(bx)=\frac12(1+\cos(2bx))=\frac12+\frac14 e^{2b i x}+\frac14 e^{-2b i x}\tag1$$ Then $$e^{-ax^2}\cos^2(bx) =\frac12e^{-ax^2}+ \frac14 e^{-ax^2+2b i x}+\frac14 e^{-ax^2-2b i x}\tag2$$ With appropriate substitutions, the matter reduces to integration of $\exp(-t^2)$, which yields the error function. Of course, this is what WA already did for you.
If $\int_{-c}^{c} e^{-ax^2} \, \mathrm{d}x=k$, then can we express the first integral in terms of $k$?
No, because the integral of a product is not the product of integrals... But it is true that $$\lim_{b\to\infty} \int_{-c}^{c} e^{-ax^2}\cos^2(bx) \,\mathrm{d}x =\frac{k}{2}\tag3$$ because the highly oscillatory terms $e^{\pm 2b i x}$ in (1) contribute little when $b$ is large. See the Riemann-Lebesgue lemma.