Calculate trigonometric integral $ \int_{-\infty}^{\infty}{\sin(x^2)}\,dx$ Recently, I came across the following integral:
$$
\int_{-\infty}^{\infty}{\sin(x^2)}\,dx=\int_{-\infty}^{\infty}{\cos(x^2)}\,dx=\sqrt{\frac{\pi}{2}}
$$
What are the different ways to calculate such an integral?
 A: In this answer is given a real method for showing this.
Using contour integration we can show that
$$
\begin{align}
\int_{-\infty}^\infty\left[\cos(x^2)+i\sin(x^2)\right]\,\mathrm{d}x
&=\int_{-\infty}^\infty e^{ix^2}\,\mathrm{d}x\\
&=\frac{1+i}{\sqrt2}\int_{-\infty}^\infty e^{-x^2}\,\mathrm{d}x\\
&=(1+i)\sqrt{\frac\pi2}
\end{align}
$$
To show the equality of these integrals, integrate $e^{iz^2}$ along the contour
$$
[-R,R]\cup Re^{i\pi[0,1/4]}\cup[R,-R]e^{i\pi/4}\cup-Re^{i\pi[1/4,0]}
$$
which must be $0$ since $e^{iz^2}$ has no singularities. Note that the integral along the two curved contours vanishes as $R\to\infty$. Each is bounded by
$$
\begin{align}
&\left|\,\int_0^{\pi/4}e^{iR^2(\cos(t)+i\sin(t))^2}R(-\sin(t)+i\cos(t))\,\mathrm{d}t\,\right|\\
&\le\int_0^{\pi/4}e^{-R^2\sin(2t)}R\,\mathrm{d}t\\
&\le\int_0^\infty e^{-R^24t/\pi}R\,\mathrm{d}t\\
&=\frac\pi{4R}
\end{align}
$$
Thus, the integral along $[-\infty,\infty]$ equals the integral along $[-\infty,\infty]e^{i\pi/4}$.
A: We can show that
$$\int_{-\infty}^{\infty} dx \: e^{-i x^2} = \sqrt{\frac{\pi}{i}} = \sqrt{\pi} e^{-i \frac{\pi}{4}}  $$
actually works rigorously...er, relatively speaking.  A way to do this is to consider the integral
$$\oint_{C_R} dz \: e^{-z^2} $$
where $C_R$ consists of the interval $[0,R]$ along the $\Re{z}$ axis, a circular arc of radius $R$ centered at the origin, with endpoints at $(R,0)$ and $(R,R)/\sqrt{2}$, and the line segment from $(R,R)/\sqrt{2}$ to the origin.  (That is, substitute $z = e^{i \pi/4} t$ into the integral.)  Note that there are no poles inside of $C_R$, for any value of $R$.  Then take the limit as $R \rightarrow \infty$ and note that the integral along the circular arc vanishes. Apply Cauchy's Integral Theorem, and the desired result is shown.
Note that this analysis applies to the Fourier transform of such a function as well, as all the transform piece does is shift the center of the quadratic in the exponential.  The piece that is the transform is factored outside of the integral and doesn't change this analysis.
To be explicit, we can write
$$\begin{align} \oint_{C_R} dz \: e^{-z^2} &= 0 \\ &= \int_0^R dx \: e^{-x^2} + i R \int_0^{\pi/4} d \phi e^{i \phi} e^{-R^2 \exp{(i 2 \phi)}} + e^{i \pi/4} \int_R^0 dt \: e^{-i t^2} \end{align}  $$
The 2nd integral vanishes as $R \rightarrow \infty$ because the exponential term in the exponent does not change sign within the integration region.  We may then conclude that
$$\int_0^{\infty} dx \: e^{-x^2} = \sqrt{i} \int_0^{\infty} dt e^{-i t^2}$$
or
$$\int_{-\infty}^{\infty} dt \: e^{-i t^2} = \sqrt{\frac{1}{i}} \int_{-\infty}^{\infty} dx \: e^{-x^2} = \sqrt{\frac{\pi}{i}} = \sqrt{\pi} \, e^{-i \pi/4}$$
Your result follows from comparing imaginary parts.
A: Step 1 is to substitue $u=x^2$ giving 
$$
I = \int_{-\infty}^\infty \sin(x^2) dx = 2 \int_0^\infty \sin(x^2) dx = 
2 \int_0^\infty  \sin u \frac{du}{2\sqrt{u}}= \int_0^\infty   \frac{\sin u}{\sqrt{u}} du
$$
The next step is to recognize this related to Fresnel's sine integral 
$$
S(x) = \frac{1}{\sqrt{2\pi}}\int_0^x   \frac{\sin t}{\sqrt{t}} dt
$$
The third step is to notice that an asymptotic form for $S(x)$ is
$$
S(x) = \frac{1}{2} - \frac{1}{\sqrt{2\pi}x}\cos^2 x + O\left( \frac{1}{x^2} \right)
$$
(I suppose that anybody who does not know this from early childhood should go back to reading Gradshteyn and Ryzhik each night until it puts you to sleep. ROTFL)
Taken to infinity, this gives $S(x) \rightarrow \frac{1}{2}$ so 
$$ I = \sqrt{2\pi} \frac{1}{2} = \sqrt{\frac{\pi}{2}}$$
