Path integration in the complex plane Problem: Show that $$\int_\gamma e^{iz-z^2}dz$$ has the same value on every straight line path $\gamma$ parallel to the real axis. 
I got stuck in the middle of the calculation when I write :
$$\int_A^Be^{[i(x+iy)-(x+iy)^2]}dx$$ where $A$ and $B$ are the starting and ending points of $\gamma$. 
 A: For $R>0$, and $b\ne 0$, denote by $\Delta(b,R)$ the rectangular region whose boundary consists of the segments $[-R,R], [R, R+ib], [R+ib,-R+ib]$, and $[-R+ib,-R]$. Since the function 
$$
f:\mathbb{C}\to \mathbb{C},\quad f(z)=e^{iz-z^2}
$$
is holomorphic, by Cauchy's Integral formula we have
$$\tag{1}
\int_{\Delta(b,R)}f(z)\,dz=0.
$$
But
$$
\int_{\Delta(b,R)}f(z)\,dz=\int_{-R}^Rf(x)\,dx+i\int_0^bf(R+iy)\,dy-\int_{-R}^Rf(x+ib)\,dx-i\int_0^bf(-R+iy)\,dy,
$$
so, thanks to (1), we have:
\begin{eqnarray}
\int_{-R}^Rf(x+ib)\,dx&=&\int_{-R}^Rf(x)\,dx+i\int_0^bf(R+iy)\,dy-i\int_0^bf(-R+iy)\,dy\\
&=&\int_{-R}^Rf(x)\,dx+i\int_0^b\left[f(R+iy)-f(-R+iy)\right]\,dy\\
&=&\int_{-R}^Rf(x)\,dx+i\int_0^b\left[\exp(iR-y-R^2+y^2-2iRy)-\exp(-iR-y-R^2+y^2+2iRy)\right]\,dy\\
&=&\int_{-R}^Rf(x)\,dx+ie^{-R^2}\int_0^be^{y^2-y}\left[\exp(iR-2iRy)-\exp(-iR+2iRy)\right]\,dy\\
&=&\int_{-R}^Rf(x)\,dx+2e^{-R^2}\int_0^be^{y^2-y}\sin(2Ry-R)\,dy\\
\end{eqnarray}
Since
$$
\lim_{R\to\infty}\left|2e^{-R^2}\int_0^be^{y^2-y}\sin(2Ry-R)\,dy\right|\le \lim_{R\to\infty}2e^{-R^2}\int_0^be^{y^2-y}\,dy=0,
$$
it follows that
\begin{eqnarray}
\int_\gamma f(z)\,dz&=&\lim_{R\to\infty}\int_{-R}^Rf(x+ib)\,dx=\lim_{R\to\infty}\left[\int_{-R}^Rf(x)\,dx+2e^{-R^2}\int_0^be^{y^2-y}\sin(2Ry-R)\,dy\right]\\
&=&\int_{\mathbb{R}}f(x)\,dx
\end{eqnarray}
