Improper definite integration with complex bounds I am looking to prove the functional equation for theta function. Source: https://www.youtube.com/watch?v=-GQFljOVZ7I&list=PL32446FDD4DA932C9&index=12
Time about 8.00. We are to integrate:
$$\int_{-\infty+\frac{ik}{x}}^{+\infty+\frac{ik}{x}}e^{-\pi xz^2}dz$$
The argument is to change the bounds to $-\infty$ and $+\infty$ using something called Estimation Lemma or "ML-Inequality". I have absolutely no knowledge of complex analysis and integrals with complex variables. 
I've read in the comments, that one could say that $\infty+k = \infty $ for any finite number $k$, equivallently for $-\infty$ but as there is $i$, this argument seems invalid to me.
Would anyone give me some deeper explanation of what we have actually done?
 A: In the video referenced in the OP, the narrator uses Cauchy's Integral Theorem to write
$$\int_{-R+ik/x}^{R+ik/x} e^{-\pi x z^2}\,dz=\int_{-R+ik/x}^{-R} e^{-\pi x z^2}\,dz+\int_{-R}^{R} e^{-\pi x z^2}\,dz+\int_{R}^{R+ik/x} e^{-\pi x z^2}\,dz\tag1$$
We can easily show that both the first and third integrals on the right-hand side of $(1)$ approach $0$ as $R\to \infty$.  To do so, we assume without loss of generality that $k/x>0$ and develop bounds for the first integral on the right-hand side of $(1)$.  Proceeding we find
$$\begin{align}
\left|\int_{-R+ik/x}^{-R} e^{-\pi x z^2}\,dz\right|&\overbrace{=}^{z=-R+it} \left|\int_{k/x}^{0} e^{-\pi x (R-it)^2}\,i\,dt\right|\\\\
&\le \int_{0}^{k/x} \left| e^{-\pi x (R-it)^2}\,i\right|\,dt\\\\
&=\int_{0}^{k/x} \left| e^{-\pi x (R^2-t^2)}e^{i2\pi xRt}\,i\right|\,dt\\\\
&=\int_{0}^{k/x} e^{-\pi x (R^2-t^2)}\,dt\\\\
&\le \frac kx\,e^{-\pi x (R^2-(k/x)^2)}\tag2 
\end{align}$$
As $R\to \infty$, the right-hand side of $(2)$ approaches $0$.  
In an analogous development, we find that the third integral on the right-hand side of $(2)$ vanishes as $R\to \infty$ also.
Hence, we have
$$\lim_{R\to \infty}\int_{-R+ik/x}^{R+ik/x} e^{-\pi x z^2}\,dz=\lim_{R\to\infty}\int_{-R}^{R} e^{-\pi x z^2}\,dz=\frac{1}{\sqrt x}$$
And we are done!
A: This is not an answer. 
I am just showing that the naïve substitution $u=z-ik/x$ produces the correct answer to this integral with arbitrary real limits $a$ and $b$. Symmetry between the two limits is not leading to error cancellation in this case.
$$I=\int_{a+ik/x}^{b+ik/x} e^{-\pi x z^2}\,dz=\frac{\text{erf}\left(\frac{\sqrt{\pi } (b x+\text{ik})}{\sqrt{x}}\right)-\text{erf}\left(\frac{\sqrt{\pi } (a x+\text{ik})}{\sqrt{x}}\right)}{2 \sqrt{x}}$$
Using the substitution $u=z-ik/x$ gives
$$I=\int_{a}^{b} e^{-\pi x (u+ik/x)^2}\,du=\frac{\text{erf}\left(\frac{\sqrt{\pi } (b x+\text{ik})}{\sqrt{x}}\right)-\text{erf}\left(\frac{\sqrt{\pi } (a x+\text{ik})}{\sqrt{x}}\right)}{2 \sqrt{x}}$$
where erf is the error function
I am just curious as to why in this case this naïve substitution works for all real values of the limits $a$ and $b$.
