Do you mind expanding on the part along the diagonal in the first answer by Robjohn to this question proof? Particularly how to achieve (3).
I am trying use a parameterization for $z=xe^{i \pi/4}$ for x from $0$ to R and I am not getting the correct result.
$$\int_{diagonal}e^{-z^2}=\int_0^R e^{-(xe^{i \pi/4})^2}e^{i\pi/4}dx=\int_0^R e^{-x^2e^{i \pi/2}}e^{i\pi/4}dx$$