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?
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?
Let $I$ be the desired integral. Then, by the product-to-sum trigonometric identity, \begin{align*} 2I&=\int_{0}^{+\infty} \cos (x-x^2)\,dx+\int_{0}^{+\infty} \cos (x^2+x)\,dx\\ &=\int_{0}^{+\infty} \cos ((x-1/2)^2-1/4)\,dx+\int_{0}^{+\infty} \cos ((x+1/2)^2-1/4)\,dx\\ &=\cos(1/4)\int_{0}^{+\infty} \cos ((x-1/2)^2)\,dx+\sin(1/4)\int_{0}^{+\infty} \sin((x-1/2)^2)\,dx\\ &\quad+\cos(1/4)\int_{0}^{+\infty} \cos ((x+1/2)^2)\,dx+\sin(1/4)\int_{0}^{+\infty} \sin ((x+1/2)^2)\,dx\\ &=\cos(1/4)\int_{-1/2}^{+\infty} \cos (x^2)\,dx+\sin(1/4)\int_{-1/2}^{+\infty} \sin(x^2)\,dx\\ &\quad+\cos(1/4)\int_{1/2}^{+\infty} \cos (x^2)\,dx+\sin(1/4)\int_{1/2}^{+\infty} \sin (x^2)\,dx. \end{align*} By the Fresnel integrals, $$\int_{0}^{+\infty} \cos (x^2)\,dx=\int_{0}^{+\infty} \sin (x^2)\,dx=\sqrt{\pi/8},$$ we obtain \begin{align*} \int_{-1/2}^{+\infty} \cos (x^2)\,dx+\int_{1/2}^{+\infty} \cos (x^2)\,dx&=\int_{-1/2}^{0} \cos (x^2)\,dx +\sqrt{\pi/8}\\ &\quad+\sqrt{\pi/8}-\int_{0}^{1/2} \cos (x^2)\,dx=2\sqrt{\pi/8} \end{align*} and \begin{align*} \int_{-1/2}^{+\infty} \sin (x^2)\,dx+\int_{1/2}^{+\infty} \sin (x^2)\,dx&=\int_{-1/2}^{0} \sin(x^2)\,dx +\sqrt{\pi/8}\\ &\quad+\sqrt{\pi/8}-\int_{0}^{1/2} \sin(x^2)\,dx=2\sqrt{\pi/8} \end{align*} Hence $$I=\sqrt{\pi/8}\left(\cos(1/4)+\sin(1/4)\right)= \frac{\sqrt{\pi}}{2}\cos\left(\frac{\pi-1}{4}\right).$$
$$
\begin{align}
\int_0^\infty\cos\left(x^2\right)\cos(x)\,\mathrm{d}x
&=\frac12\int_{-\infty}^\infty\cos\left(x^2\right)\cos(x)\,\mathrm{d}x\tag1\\
&=\frac14\int_{-\infty}^\infty\left[\cos\left(x^2-x\right)+\cos\left(x^2+x\right)\right]\mathrm{d}x\tag2\\
&=\frac12\int_{-\infty}^\infty\cos\left(x^2-\frac14\right)\,\mathrm{d}x\tag3\\
&=\frac12\cos\left(\frac14\right)\int_{-\infty}^\infty\cos\left(x^2\right)\,\mathrm{d}x+\frac12\sin\left(\frac14\right)\int_{-\infty}^\infty\sin\left(x^2\right)\,\mathrm{d}x\tag4\\
&=\frac12\sqrt{\frac\pi2}\left[\sin\left(\frac14\right)+\cos\left(\frac14\right)\right]\tag5
\end{align}
$$
Explanation:
$(1)$: symmetry
$(2)$: use cosine of a sum
$(3)$: substitute $x\mapsto x+\frac12$ on the first and $x\mapsto x-\frac12$ on the second cosine
$(4)$: use cosine of a sum
$(5)$: use $(4)$ and $(5)$ from this answer
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)}.$$