Improper integral $\int_0^\infty \cos(x^2)$ exists but $\cos(x^2)$ is not Lebesgue integrable 
Show that the improper integral $\int_0^\infty \cos(x^2)$ exists but $\cos(x^2)$ is not Lebesgue integrable.

I'm asked to prove the above statement. I know that the integral is a special one, but I've not yet found a proof of its existence. And as for proving that it is not Lebesgue integrable, I don't have any idea. All tips appreciated.
 A: Convergence of the improper integral. 
This is a standard result. A change of variable gives the equivalent integral $$\frac12\int_0^\infty\frac{\cos u}{\sqrt{u}}\ du.$$
See this post for the value of the improper integral: 
https://en.wikipedia.org/wiki/Fresnel_integral#Limits_as_x_approaches_infinity
See also the following questions:
  -  Definite integral of $\cos (x)/ \sqrt{x}$?
  -  A simple proof of the fact that $\int_0^{+\infty} \cos(x)/\sqrt{x} \text{d}x \neq 0$ 
Lebesgue integrability. 
Consider the integrals
$$
\int_0^\infty\left\vert\frac{\cos u}{\sqrt{u}}\right\vert\ du=\int_0^{\pi/2}\left\vert\frac{\cos(u)}{u}\right\vert\ du+
\int_{\pi/2}^\infty\left\vert\frac{\cos(u)}{u}\right\vert\ du. 
$$
For the second one, note that
$$
\int_{k\pi+\frac{\pi}{2}}^{(k+1)\pi+\frac{\pi}{2}}|\cos u|\ du = 2,
$$
which implies that
$$
\frac{2}{a_{k+1}}\leq
\int_{k\pi+\frac{\pi}{2}}^{(k+1)\pi+\frac{\pi}{2}}\left\vert\frac{\cos u}{\sqrt{u}}\right\vert\ du
\leq\frac{2}{a_k}
$$
where $a_k = \sqrt{k\pi+\frac{\pi}{2}}$. But
$$
\sum \frac{1}{a_k}=\infty.
$$
So one must have
$$
\int_{\pi/2}^\infty\left\vert\frac{\cos(u)}{u}\right\vert\ du=\infty.
$$
and thus
$$
\int_{0}^\infty\left\vert\frac{\cos(u)}{u}\right\vert\ du=\infty
$$
A: The convergence of $\int_{0}^{+\infty}\frac{\cos u}{\sqrt{u}}\,du$, as an improper Riemann integral, is ensured by Dirichlet's test, since $\cos u$ has a bounded primitive and $\frac{1}{\sqrt{u}}$ is decreasing towards zero. Vice-versa, the divergence of $\int_{0}^{+\infty}\frac{\left|\cos u\right|}{\sqrt{u}}\,du$ is ensured by Kronecker's lemma, since $\left|\cos u\right|$ is a non-negative function with mean value $\frac{2}{\pi}$. In particular $\int_{0}^{M}\frac{\left|\cos u\right|}{\sqrt{u}}\,du \sim \int_{0}^{M}\frac{2\,du}{\pi\sqrt{u}}=\frac{4}{\pi}\sqrt{M}$ as $M\to +\infty$.
