Are Complex Substitutions Legal in Integration?
Solution 1:
Let's consider the legality of doing an actual u-substitution, such as $z = \sqrt{i} x$. Not only must the integrand be rewritten, so must the limits of integration.
In the original definite integral you have $x$ going from $0$ to $\infty$. Of course this then gives a path of integration for $z$, but it's not sufficient to have just limits $0$ to $\infty$ in the complex plane to specify that path. So this would be a gray area where the limitations of your notation could let you down!
In the complex plane there are many paths from $0$ to $\infty$, even many straight such paths.
Solution 2:
A correct way to do this might go as follows. Consider the contour integral
$$ \oint_\Gamma e^{iz^2}\ dz $$
where $\Gamma$ is the positively oriented triangle with vertices $0, R, R+Ri$ for large $R$.
Since the integrand is analytic, Cauchy's Theorem says the result is $0$. This can be written as $J_1 + J_2 + J_3=0$, where $J_1, J_2, J_3$ are the integrals over the segments
$[0, R]$, $[R, R+Ri]$, and $[R+Ri,0]$ respectively.
Show that as $R \to +\infty$, $J_2 \to 0$ and $J_3 \to -(1+i) \dfrac{\sqrt{2 \pi}}{4}$.
Thus $J_1 \to (1+i) \dfrac{\sqrt{2 \pi}}{4}$, which says that
$$ \int_0^\infty \cos(t^2)\ dt = \int_0^\infty \sin(t^2)\ dt = \dfrac{\sqrt{2 \pi}}{4}$$