I would like to compute an integral of the form ($a,b \neq 0$)
$$\int_{-\infty}^{\infty} e^{-(ax+ib)^2} dx = \frac{1}{a} \int_{-\infty+ib}^{\infty+ib} e^{-z^2} dz$$
where we made the substitution $z = ax+ib$. I know that the last integral is a gaussian integral and that it should equal $\sqrt{\pi}$, but I'm not sure how to compute it by hand. I tried to solve it in the complex plane via contour integration but I seem to go in a circle and do not arrive at $\sqrt{\pi}$.
Could somebody help out?
Consider the integral of $e^{-z^2}$ around a rectangular contour with corners at $-R, R, R+ib, -R+ib$. As $R \to +\infty$ the integrals over the vertical pieces go to $0$, while the integral over $(-R, R)$ goes to $\sqrt{\pi}$.