# Evaluating the integral $\int_{0}^{+\infty}\sin x\sin(x^2)dx$

It can be seen in here that the integral $$\int_{0}^{+\infty}\sin x\sin(x^2)dx$$ is convergent. I tried using Wolfram alpha and able to see the answer. It involves the use of the Fresnel Cosine integral and the Fresnel Sine integral. It was repeatedly asked by Aditya Agarwal on how evaluate the said integral. I understand that nobody attempted to evaluate since the OP only wanted to verify convergence. Just curious-- how can we evaluate this integral? I followed the answers given in here and they gave $$\lim_{B\to \infty}\int_0^B\sin x\sin(x^2)dx=\frac{1}{2}\int_{0}^1\cos(x^2-x)dx.$$ So, the RHS integral gives the value of the given integral. I used Wolram alpha and obtained the same answer. I got clueless on how to evaluate this integral. Any attempt to evalute it is very much appreciated.

Write $x^2-x=(x-1/2)^2-1/4$. Then $$\cos(x^2-x)=\cos\left[(x-1/2)^2-1/4\right]=\cos((x-1/2)^2)\cos(1/4)+\sin((x-1/2)^2)\sin(1/4)\ ,$$ using the trigonometric addition formula for $\cos(\alpha-\beta)$.
Then, change variables $x-1/2=t$ to get for your RHS integral $$\frac{1}{2}\int_{0}^1\cos(x^2-x)dx=\frac{1}{2}\left[\cos(1/4)\int_{-1/2}^{1/2}\cos(t^2)dt+\sin(1/4)\int_{-1/2}^{1/2}\sin(t^2)dt\right]\ .$$
Take now for example $\int_{-1/2}^{1/2}\cos(t^2)dt$. You can write it as $$\int_{-1/2}^{1/2}\cos(t^2)dt=2\int_{0}^{1/2}\cos(t^2)dt=2 C(1/2)\ ,$$ where $C(x)=\int_0^x\cos(t^2)dt$ is the Cosine Fresnel integral (and analogously for the sin one). [Note that Wikipedia and Mathematica use different conventions on how to define Fresnel integral, I used here the Wikipedia convention].