Expressing $\int dx\, \cos(ax^2 + 2bx + c)$ in terms of Fresnel integrals I have difficulties with this integral, which is is related to Fresnel integrals ($a>0$):
$$ \int dx\, \cos(ax^2 + 2bx + c) = \\ =\sqrt{\frac{\pi}{2a}} \left[ \cos(\frac{ac-b^2}{a}) \mathscr{C} \left( \frac{\sqrt{2} (ax + b)}{\sqrt{a\pi}} \right) -  \sin(\frac{ac-b^2}{a}) \mathscr{S}\left( \frac{\sqrt{2} (ax + b)}{\sqrt{a\pi}} \right) \right] +C $$ 
with $$ \mathscr{C}(x) = \int_0^x dt \cos(\pi t^2 /2), $$
$$ \mathscr{S}(x) = \int_0^x dt \sin(\pi t^2 /2). $$
How do you show this integral?

Start completing the square $$ax^2+2bx+c=a\left(x+\frac b{a}\right)^2-\left(\frac{b^2}{a}-c\right)$$ So, $\cos(ax^2+2bx+c)$ write $$\cos \left(a\left(x+\frac b{a}\right)^2\right)\cos\left(\frac{b^2}{a}-c\right)+\sin \left(a\left(x+\frac b{a}\right)^2\right)\sin\left(\frac{b^2}{a}-c\right)$$ Now, you have to change variable to go to Fresnel since and cosine integrals. Set $$\sqrt a\left(x+\frac b{a}\right)=\sqrt{\frac \pi 2}t \implies x={\sqrt{\frac{\pi }{2a}} }t-\frac{b}{a}\implies dx=\sqrt{\frac{\pi }{2a}}\,dt $$ which make $$\int \cos \left(a\left(x+\frac b{a}\right)^2\right)\,dx=\sqrt{\frac{\pi }{2a}}\int \cos\left(\frac \pi 2 t^2\right)\,dt=\sqrt{\frac{\pi }{2a}}C(t)=\sqrt{\frac{\pi }{2a}}C\left(\frac{\sqrt 2(ax+b)}{\sqrt{\pi a}}\right)$$ $$\int \sin \left(a\left(x+\frac b{a}\right)^2\right)\,dx=\sqrt{\frac{\pi }{2a}}\int \sin\left(\frac \pi 2 t^2\right)\,dt=\sqrt{\frac{\pi }{2a}}S(t)=\sqrt{\frac{\pi }{2a}}S\left(\frac{\sqrt 2(ax+b)}{\sqrt{\pi a}}\right)$$ and hence the formula.
