How to evaluate $\int_{0}^{+\infty} \cos(x^2)\cos(x)dx$ How do I evaluate $\int_{0}^{+\infty} \cos(x^2)\cos(x)dx$?
I don't know what to do. Should I use a contour integration?

By the cosine addition formulas and symmetry we have
$$ \int_{0}^{+\infty}\cos(x)\cos(x^2)\,dx = \int_{0}^{+\infty}\cos\left(x^2-\tfrac{1}{4}\right)\,dx = \frac{1}{2}\int_{0}^{+\infty}\frac{\cos\left(x-\tfrac{1}{4}\right)}{\sqrt{x}}\,dx $$
where the last integral is clearly converging by Dirichlet's test. Since the Laplace transform of $\cos\left(x-\frac{1}{4}\right)$ is $\frac{1}{1+s^2}\left[\sin\tfrac{1}{4}+s\cos\tfrac{1}{4}\right]$ and the inverse Laplace transform of $\frac{1}{\sqrt{x}}$ is $\frac{1}{\sqrt{\pi s}}$, the original integral equals
$$\frac{1}{2\sqrt{\pi}}\int_{0}^{+\infty}\frac{\sin\tfrac{1}{4}+s\cos\tfrac{1}{4}}{(1+s^2)\sqrt{s}}\,ds $$
which by the substitution $s\mapsto u^2$ only depends on the elementary integrals $\int_{0}^{+\infty}\frac{du}{1+u^4}=\frac{\pi}{2\sqrt{2}}$ and $\int_{0}^{+\infty}\frac{u^2\,du}{1+u^4}=\frac{\pi}{2\sqrt{2}} $. Summarizing:
$$ \int_{0}^{+\infty}\cos(x)\cos(x^2)\,dx = \color{blue}{\frac{\sqrt{\pi}}{2}\,\sin\left(\frac{\pi+1}{4}\right)}.$$
