TITLE: Strange Limit in Proof of the Fresnel Integral
QUESTION [5 upvotes]: I was playing around with the Fresnel integrals and I've come up with a proof for the fact $$\int_0^\infty \cos x^2 dx= \int_0^\infty \sin x^2 dx= \sqrt{\frac{\pi}{8}}$$
The proof goes as follows
Use the fact that $$\int_{-\infty}^{\infty} e^{-u^2} du = \sqrt{\pi} $$
Letting $ u = \sqrt{-i} \cdot x, du = \sqrt{-i}*dx $
$$\sqrt{-i} \cdot \int_{-\infty}^{\infty} e^{ix^2} du = \sqrt{\pi}$$
$$\int_{-\infty}^{\infty} e^{ix^2} dx = \int_{-\infty}^{\infty} \cos{x^2} + i \cdot \int_{-\infty}^{\infty} \sin{x^2}dx = \sqrt{\frac{-\pi}{i}}=(1+i)\sqrt{\frac{\pi}{2}}$$
Equating real and imaginary parts (we can do this because we can assume that the two integrals have real values), we get 
$$\int_{-\infty}^\infty \cos x^2 dx= \int_{-\infty}^\infty \sin x^2 dx= \sqrt{\frac{\pi}{2}}$$
Then, using the fact that $\cos{x^2}$ and $\sin{x^2}$ are even functions, we get the fact above.
My question stems from the substitution made. After the substitution is made, the bounds of the integral change from $\pm\infty$ to $\pm(1+i)\infty$
Is this integral valid? Is it possible to have a complex number in the bounds of the integral?

REPLY [2 votes]: I'll admit, I'm not exactly sure about your question on whether we should be worried about the complex limits in your integral. On one hand, you shouldn't that much because $i$ is treated as a constant in integration. But on the other hand, you have to be careful when managing with square roots, as Jack has said.
Another way to integrate this is again with the Gaussian integral. But this time, we use the well-known identity$$\int\limits_0^{\infty}dx\,\frac 1{1+x^n}=\frac {\pi}n\csc\left(\frac {\pi}n\right)$$The proof for this is relatively straightforward. Hopefully, you recall the easily verifiable identity$$\int\limits_0^{\infty}dx\, e^{-ax}=\frac 1a$$which holds for $\operatorname{Re}(a)>0$. Substitute that into the integrand to get$$\begin{align*}\int\limits_0^{\infty}dy\,\int\limits_0^{\infty}dx\, e^{-(1+x^n)y} & =\int\limits_0^{\infty}dy\,\int\limits_0^{\infty}dx\, e^{-y}e^{-yx^n}\\ & =\frac 1n\int\limits_0^{\infty}dy\,y^{-\frac 1n}e^{-y}\int\limits_0^{\infty}dx\, x^{\frac 1n-1}e^{-x}\\ & =\frac 1n\Gamma\left(1-\frac 1n\right)\Gamma\left(\frac 1n\right)\end{align*}$$The result follows immediately after using Euler's reflection formula on the gamma functions. Now we can proceed with the problem. Using the general formula for the Gaussian integral$$\frac 1{\sqrt{\pi}}\int\limits_{\mathbb{R}}dx\, e^{-ax^2}=\frac 1{\sqrt{a}}$$It can be shown that$$\begin{align*}\int\limits_0^{\infty}dx\,\sin x^2 & =\frac 12\int\limits_0^{\infty}dx\,\frac {\sin x}{\sqrt{x}}\\ & =\frac 1{\sqrt{\pi}}\int\limits_0^{\infty}dt\,\int\limits_0^{\infty}dx\,\sin xe^{-xt^2}\\ & =\frac 1{\sqrt{\pi}}\int\limits_0^{\infty}dt\,\frac 1{1+t^4}\end{align*}$$Using the identity we derived earlier, it's obvious to see that$$\int\limits_0^{\infty}dx\,\frac {\sin x}{\sqrt{x}}=\sqrt{\frac {\pi}2}$$And your identity can be proven pretty quickly from there.