Strange Limit in Proof of the Fresnel Integral 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?
 A: A proof through real methods. We have
$$ \int_{0}^{+\infty}\sin(x^2)\,dx \stackrel{x\mapsto\sqrt{x}}{=} \int_{0}^{+\infty}\frac{\sin(x)}{2\sqrt{x}}\,dx $$
and since $\mathcal{L}(\sin x)(s) = \frac{1}{s^2+1}$ and $\mathcal{L}^{-1}\left(\frac{1}{2\sqrt{x}}\right)(s)=\frac{1}{2\sqrt{\pi s}}$, due to a fundamental property of the Laplace transform
$$ \int_{0}^{+\infty}\sin(x^2)\,dx = \int_{0}^{+\infty}\frac{ds}{2\sqrt{\pi s}(s^2+1)}\stackrel{s\mapsto s^2}{=}\frac{1}{\sqrt{\pi}}\int_{0}^{+\infty}\frac{ds}{s^4+1}\stackrel{s\mapsto 1/s}{=}\frac{1}{2\sqrt{\pi}}\int_{-\infty}^{+\infty}\frac{ds}{\left(s-\frac{1}{s}\right)^2+2} $$
By invoking Glasser's master theorem / the Cauchy-Schlomilch substitution we get
$$ \int_{0}^{+\infty}\sin(x^2)\,dx = \frac{1}{2\sqrt{\pi}}\int_{-\infty}^{+\infty}\frac{dt}{t^2+2} = \sqrt{\frac{\pi}{8}} $$
and the Fresnel cosine integral can be managed in a similar way.
A: If you're open to other proofs I have one that uses the Feynman trick .
As you said , we can show that ; $\int_{-\infty}^{+\infty}e^{-ix^2} = \int_{-\infty}^{+\infty}\cos(x^2)\,dx - i\int_{-\infty}^{+\infty}\sin(x^2)\,dx  $
$I = 2\int_0^{\infty}e^{-ix^2}\,dx$
To evaluate Fresnel integrals using Leibniz integral rule,we  need to introduce a new parameter .
Thus we define ,$I(t) =\bigg(\int_{0}^{t}e^{-ix^2}\,dx\bigg)^2$
therefore, $I = 2\sqrt{I(t=\infty)}$
$\frac{d}{dt}(I(t)) = \frac{d}{dt}\bigg(\bigg(\int_{0}^{t}e^{-ix^2}\bigg)^2\bigg) =2\cdot \bigg(\int_{0}^{t}e^{-ix^2}\,dx\bigg)\cdot \bigg(\int_0^t\partial_t(e^{-ix^2})\,dx+e^{-it^2}\cdot\frac{dt}{dt} - e^{i\cdot0}\cdot\frac{d(0)}{dt}\bigg)$
$I'(t) = 2\cdot \int_{0}^{t}e^{-ix^2}\,dx\cdot e^{-it^2} $
$I'(t) = 2\int e^{-i(x^2+t^2)}\,dx$
$I'(t) =2\int e^{-it^2(\frac{x^2}{t^2}+1)}\,dx $
let $ u =\frac xt \implies du = \frac 1t dx \implies t\,du = dx$
$I'(t) = 2\int_0^1 e^{-it^2(1+u^2)}\,tdu$
This next step is a bit counter intuitive but i hope you follow me,
Observe that, $2t e^{-it^2(1+u^2)} = \partial_t\bigg[\dfrac{e^{-it^2(1+u^2)}}{-i(1+u^2)}\bigg] =\partial_t\bigg[\dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\bigg]$
$I'(t) = 2\large\int_0^1\small \partial_t\dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\,du $
$I'(t) = \frac{d}{dt}\large\int_0^1\small \dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\,du$ 
Now, 
$\int I'(t) = I(t) = \large\int\frac{d}{dt}\bigg(\large\int_0^1\small \dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\,du\bigg)dt  = \int_0^1 \dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\,du+C$
Therefore ,
$\large{\int_0^1}\small\dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\,du+C = \bigg(\int_{0}^{t}e^{-ix^2}\,dx\bigg)^2$
Now to find $C$, we let $t = 0 $,
$I(t=0) = \bigg(\int_{0}^{0}e^{-ix^2}\,dx\bigg)^2 = 0 =\large{\int_0^1}\small\dfrac{ie^{-i0(1+u^2)}}{1+u^2}\,du+C $
$\implies 0 = \int_0^1\frac{i}{1+u^2}\,du +C$
$\implies C = -i\arctan(u)\bigg|_0^1$
Therefore $C= -i\frac\pi4$
Now we have $I(t)=  \int_0^1 \dfrac{ie^{-it^2(1+u^2)}}{1+u^2}\,du-i\frac\pi4$
Substituting back , $ u =\frac xt $
 ,gives us
$I(t) = \int_0^1\frac1t\frac{ie^{-it^2(1+(\frac xt)^2)}}{1+(\frac xt)^2}\,dx -i\frac\pi4$
now,
$I = 2\sqrt{I(t=\infty)}$
$I = 2\sqrt{\lim_{t\to\infty} \int_0^1\frac1t\frac{ie^{-it^2(1+(\frac xt)^2)}}{1+(\frac xt)^2}\,dx -i\frac\pi4}$
$I = 2\sqrt{-i\cdot\frac\pi4}$
$I = \sqrt\pi\cdot\sqrt {-i}$
$I = \sqrt\pi(\frac{\sqrt2}{2}-i\frac{\sqrt2}{2})$
$I =\frac{\sqrt{2\pi}}{2}- i \frac{\sqrt{2\pi}}{2} =2\int_0^\infty\cos(x^2)\,dx-2i\int_0^\infty \sin(x^2)\,dx $.
comparing the real and imaginary coefficients gives us the fresnel integrals.
A: 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.
