Convergence and value of improper integral I have to prove that integral
$I = \int_{0}^{+\infty}\sin(t^2)dt$ is convergent. Could you tell me if it's ok?
Let $t^2=u$ then $dt=\frac{du}{2\sqrt{u}}$
Now $$I = \int_{0}^{+\infty}\frac{\sin(u)du}{2\sqrt{u}}$$
Which is equal to $$\int_{0}^{1}\frac{\sin(u)du}{2\sqrt{u}} + \int_{1}^{+\infty}\frac{\sin(u)du}{2\sqrt{u}}$$
First of these is convergent because of the limit
$$\lim_{u\to 0}\frac{sin(u)}{2\sqrt{u}} = 0$$
Second is convergent from Dirichlet test.
Is it correct?
Also how to find the value of this integral ($\sqrt{\frac{\pi}{8}}$) ?
 A: To evaluate the integral, we analyze the closed-contour integral $I$ given by
$$I=\oint_C e^{iz^2}\,dz$$
where $C$ is comprised of (i) the line segment from $0$ to $R$, (ii) the circular arc from $R$ to $R(1+i)/\sqrt{2}$, and the line segment from $R(1+i)/\sqrt{2}$ to $0$.  
Since $e^{iz^2}$ is analytic in and on $C$, Cauchy's Integral Theorem guarantees that $I=0$.  Then, we have
$$\int_0^R e^{ix^2}\,dx+\int_0^{\pi/4}e^{iR^2e^{i2\phi}}iRe^{i\phi}\,d\phi-\frac{1+i}{\sqrt{2}}\int_0^R e^{-x^2}\,dx=0 \tag 1$$
Letting $R\to \infty$, the second integral on the left-hand side of $(1)$ approaches zero.  Therefore, we find that 
$$\begin{align}
\int_0^\infty e^{ix^2}\,dx&=\frac{1+i}{\sqrt{2}}\int_0^\infty e^{-x^2}\,dx\\\\&=\frac{1+i}{\sqrt{2}}\frac{\sqrt{\pi}}{2} \tag 2
\end{align}$$
Finally, equating real and imaginary parts of $(2)$, we obtain
$$\int_0^\infty \sin(x^2)\,dx=\sqrt{\frac{\pi}{8}}$$
and
$$\int_0^\infty \cos(x^2)\,dx=\sqrt{\frac{\pi}{8}}$$
A: Putting $\sqrt{u}=t$ and $\dfrac{du}{2\sqrt{u}}=dt$, 
$$I = \int_{0}^{+\infty}\frac{\sin(u)du}{2\sqrt{u}}\\=\int_0^{+\infty} \sin(t^2) dt\\=\int_0^{+\infty}\Im(e^{it^2})dt\\=\Im\left(\int_0^{+\infty}e^{it^2}dt\right)$$
Putting $it^2=-z$ and $t=\sqrt{-\frac1iz}=\sqrt{i}\sqrt{z}$, $$dt = \sqrt{i}\frac{1}{2\sqrt{z}}dz$$
Hence, 
\begin{align*}
I &=\Im\left(\int_0^{+\infty}e^{-z}\sqrt{i}\frac{1}{2\sqrt{z}}dz\right)\\
&=\Im\left(\frac{\sqrt{i}}{2}\int_0^{+\infty} z^{-\frac12}e^{-z} dz\right)\\
&=\Im\left(\frac{\sqrt{i}}{2} \Gamma\left(\frac12\right)\right)\\
&=\Im\left(\sqrt{i}\frac{\sqrt{\pi}}{2}\right)\\
&=\Im\left(\frac{1}{2\sqrt{2}}(1+i)\sqrt{\pi}\right) \tag{!!}\\
&=\fbox{$\sqrt{\frac{\pi}{8}}$}
\end{align*}
Now I'm concerned about step $(!!)$ because I don't see why I should take that root of $i$ and not the other one. However since it yields the right answer, I think there must be some reason. Could anyone help me out?
