TITLE: Some way to integrate $\sin(x^2)$?
QUESTION [16 upvotes]: Because the straight forward approach involves Fresnel integrals I thought about a different approach of taking the imaginary part of 
$\int_{-\infty}^{\infty}\exp{(ix^2)} \, dx $ but have no idea how to continue.
Knowing that $\int_{-\infty}^{\infty}\exp{(-x^2)} \, dx = \sqrt \pi$ one can feel that this value has to be somehow "divided" over the entire complex plane, so that every quadrant gets some part of $\sqrt \pi$. This would give the desired result of $\sqrt \frac{\pi}{2} - i \sqrt \frac{\pi}{2} $
Is there a way this could be proved or justified?

REPLY [27 votes]: I think robjohn's answer is excellent, but I also think it would be helpful to provide the details explaining why the integral along the arc vanishes as $R \to \infty$.  
For the path along the arc we may choose $\gamma(t) = R e^{i\frac{\pi}{4}t}$ for $0 \leq t \leq 1$.  We will show $$\lim_{R \to \infty} \bigg| \int_\gamma e^{-z^2} dz \bigg| = 0.$$ For fixed $R$, we have $$\bigg| \int_\gamma e^{-z^2} dz \bigg| \leq \int_\gamma \bigg| e^{-z^2} \bigg| d|z| = \int_0^1 \bigg| e^{-[\gamma(t)]^2} \bigg| \big| \gamma^\prime(t) \big| dt = R \frac{\pi}{4} \int_0^1 \bigg| e^{-R^2 e^{i \frac{\pi}{2} t}} \bigg| dt. $$  Decomposing the exponential in the numerator, this becomes $$R \frac{\pi}{4} \int_0^1 e^{-R^2 \cos(\frac{\pi}{2}t)} dt \leq R \frac{\pi}{4} \int_0^1 e^{-R^2(1-t)} dt = R \frac{\pi}{4} \int_0^1 e^{-R^2 u} du = \frac{\pi}{4} \frac{1}{R} (1 - e^{-R^2}). $$  Hence, $$\lim_{R \to \infty} \bigg| \int_\gamma e^{-z^2} dz \bigg| \leq 0, $$ as desired.