Validity of an Approximation I am considering the approximation of the following integral:
$$\int_{-W/2}^{W/2}\exp[-p( x + iq)^2 ] dx \approx \int_{-\infty}^{\infty}\exp[-p( x + iq)^2 ] dx = \sqrt{\frac{\pi}{p}}$$
For large enough W.....
I was hoping someone could help me figure out around how large W should be in relation to p and q - I'm really struggling to deduce whether p or q is more important etc... any ideas are more than welcome.
 A: By using Cauchy's theorem, we may re-express the integral as
$$\int_{-W/2}^{W/2} dx \, e^{-p (x+i q)^2} = \int_{-W/2}^{W/2} dx \, e^{-p x^2} + 2 e^{-p W^2/4} \int_0^q dy \, e^{p y^2} \sin{(p W y)} $$
The first integral on the RHS behaves as, for large $W$,
$$\sqrt{\frac{\pi}{p}} \operatorname{erf}{\left ( \frac12 W \sqrt{p} \right )} = \sqrt{\frac{\pi}{p}} \left [1-\frac{2}{\sqrt{\pi}} e^{-p^2 W^2/4} \left (\frac1{p W} + O \left (\frac1{W^3} \right ) \right ) \right ]$$
We may derive an asymptotic approximation to the second integral by integrating by parts:
$$\int_0^q dy \, e^{p y^2} \sin{(p W y)} = \left ( 1+ e^{p q^2} \cos{(p q W)}\right ) \frac1{p W} + \frac{2 q}{p} e^{p q^2} \sin{(p q W)} \frac1{W^2} +   O \left (\frac1{W^3} \right )$$
You can put these two pieces together to determine how big an error there is for various values of $p$, $q$, and $W$.
A: A hint for the case $p=1,q=0,$ which can be adapted to the general case. Let $f(x)=\exp (-x^2).$ We have $f'(x)=-2 x f(x).$ We have $$\int_{-\infty}^{\infty}f(x)\;dx=\sqrt {\pi}.$$  For $W\geq 1/\sqrt 2$ let $$E(W)= \int_W^{\infty}f(x)\;dx.$$ Using integration by parts, we have $$E(W)=\int_W^{\infty}(-f'(x)/2 x)\;dx=\int_W^{\infty}(-1/2 x)\; df(x)=$$ $$=f(W)/2 W-\int_W^{\infty}(f(x)/2 x^2)\;dx$$ which lies between $f(W)/2 W$ and $f(W)/2 W-E(W)/2 W^2.$ So for $W\geq 1/\sqrt 2$ we have $$E(W)<f(W)/2 W<E(W)(1+1/2 W^2).$$ We can obtain greater precision for large $W$ by putting $f(x)=f''(x)/(4 x^2-2)$ in the integral form for $E(W)$ and integrating by parts twice. 
This method can be extended, as $f^{(n)}(x)=p_n(x)f(x)$ where $f^{(n)}$ is the $n$th derivative of $f$, and $p_n$ is a polynomial.
