<s>[INST] An integral involving Fresnel integrals $\int_0^\infty \left(\left(2\ S(x)-1\right)^2+\left(2\ C(x)-1\right)^2\right)^2 x\ \mathrm dx,$ I need to calculate the following integral:
$$\int_0^\infty \left(\left(2\ S(x)-1\right)^2+\left(2\ C(x)-1\right)^2\right)^2 x\ \mathrm dx,$$
where 
$$S(x)=\int_0^x\sin\frac{\pi z^2}{2}\mathrm dz,$$
$$C(x)=\int_0^x\cos\frac{\pi z^2}{2}\mathrm dz$$
are the Fresnel integrals. 
Numerical integration gives an approximate result $0.31311841522422385...$ that is close to $\frac{16\log2-8}{\pi^2}$, so it might be the answer.
 [/INST] Following on from Ron...
Make the substitutions: $x=\sqrt{y}$, $p=1/2+1/2\,\sqrt {1+4\,r}$, to get:
$\displaystyle \dfrac{64}{{\pi }^{2}}\,\int _{0}^{\infty }\!x \left( \int _{1}^{\infty }\!{\frac {\sin
 \left( 2\,\pi \,{x}^{2}p \left( p-1 \right)  \right) }{p}}{dp}
 \right) ^{2}{dx}$,
$\displaystyle=\dfrac{32}{{\pi }^{2}}\,\int _{0}^{\infty }\! \left( \int _{0
}^{\infty }\!{\frac {2\,\sin \left( 2\,\pi\, y\, r \right) }{\sqrt {1+4\,
r} \left( 1+\sqrt {1+4\,r} \right) }}{dr} \right) ^{2}{dy}
$,  see Appendix,

$\displaystyle=\dfrac{16}{{\pi }^{2}}\,\int _{-\infty}^{\infty }\! \left( \int _{0
}^{\infty }\!{\frac {2\,\sin \left( 2\,\pi \,y \,r \right) }{\sqrt {1+4\,
r} \left( 1+\sqrt {1+4\,r} \right) }}{dr} \right) ^{2}{dy}
$,
$\displaystyle=\dfrac{16}{{\pi }^{2}}\,\int _{-\infty}^{\infty }\! \left( \int _{-\infty
}^{\infty }\!{\frac {H(r)\,\sin \left( 2\,\pi \,\,y\,r \right) }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr} \right) ^{2}{dy}
$ :  $H \left( r \right) =\cases{1&$0\leq x$\cr -1&$x<0$\cr}$.
Note then that:
$\displaystyle\left(\int _{-\infty
}^{\infty }\!{\frac {H(r)\,\sin \left( 2\,\pi \,\,y\,r \right) }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr} \right) ^{2}=\displaystyle\left|-\dfrac{i}{2}\int _{-\infty
}^{\infty }\!{\frac {H(r)\,e^{ -i2\pi \,y\,r } }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr}+\dfrac{i}{2}\int _{-\infty
}^{\infty }\!{\frac {H(r)\,e^{ i2\pi\, y\,r } }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr} \right| ^{2}$
$=\displaystyle\left|\int _{\infty
}^{\infty }\!{\frac {\left(H(r)-H(-r)\right)\,e^{ i2\pi \,y\,r } }{2\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr} \right| ^{2}=\displaystyle\left|\int _{\infty
}^{\infty }\!{\frac {\,e^{ i2\pi \,y\,r } }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr} \right| ^{2}.$
We can now use Plancherel's theorem which states:
$\displaystyle \int _{-\infty }^{\infty }\!  \left| f \left( y \right) 
 \right|   ^{2}{dy}=\int _{-\infty }^{\infty }\!  
 \left| F \left( r \right)  \right|   ^{2}{dr}
$ : $ \displaystyle F \left( r \right) =\int _{-\infty }^{\infty }\!f \left( y \right) {
e^{-i2\pi r y}}{dy}
$,
and thus:
$\displaystyle\dfrac{16}{{\pi }^{2}}\,\int _{-\infty}^{\infty }\! \displaystyle\left|\int _{\infty
}^{\infty }\!{\frac {\,e^{ i2\pi \,y\,r } }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }}{dr} \right| ^{2}{dy}$
$=\displaystyle\dfrac{16}{{\pi }^{2}}\,\int _{-\infty}^{\infty }\! \displaystyle\left|{\frac {1 }{\sqrt {1+4\,
|r|} \left( 1+\sqrt {1+4\,|r|} \right) }} \right| ^{2}{dr}$, 
$=\dfrac{16}{{\pi }^{2}}\displaystyle\int _{0}^{\infty }\!{\frac {2}{ \left( 1+4\,r \right)  \left( 1+
\sqrt {1+4\,r} \right) ^{2}}}{dr}$.
Now if we undo the substitution made earlier by letting $r = p^2-p$:
$\dfrac{16}{{\pi }^{2}}\displaystyle\int _{0}^{\infty }\!{\frac {2}{ \left( 1+4\,r \right)  \left( 1+
\sqrt {1+4\,r} \right) ^{2}}}{dr}=\dfrac{16}{{\pi }^{2}}\int _{1}^{\infty }\!{
\frac {1}{2{p}^{2} \left( 2\,p-1 \right) }}{dp}$,
and then make one final substitution $p=\dfrac{1}{q+2}$ we get:
$\displaystyle\dfrac{16}{{\pi }^{2}}\int _{1}^{\infty }\!{
\frac {1}{2{p}^{2} \left( 2\,p-1 \right) }}{dp}=-\dfrac{16}{{\pi }^{2}}\int_{-2}^{-1}\dfrac{1}{2}+\dfrac{1}{q}{dq}=\dfrac{16\ln(2)-8}{\pi^2}$.
Appendix:
Note that the integral: $$\int _{0
}^{\infty }\!{\frac {2\,\sin \left( 2\,\pi \,y \,r \right) }{\sqrt {1+4\,
r} \left( 1+\sqrt {1+4\,r} \right) }}{dr} $$
converges by the Chartier-Dirichlet test because: $$f(r)={\frac {2\, }{\sqrt {1+4\,
r} \left( 1+\sqrt {1+4\,r} \right) }}$$ 
is monotonic and continuous on $ \mathbb R^+ $ and $f(r)\rightarrow0$ as $r\rightarrow \infty$, and because:
$$\left|\int_{0}^{b}\sin\left(2\pi\,y\,r\right){dr}\right|$$
is bounded as $b\rightarrow\infty$.
</s>