if $f(x)=\int^{x+1}_x\sin(t^2)\mathrm dt$ I need to show that $2xf(x)=\cos(x^2)-\cos(x+1)^2+r(x)$ with $|r(x)|\le\frac cx$
So far I have
$\displaystyle\int^{x+1}_x\sin(t^2)dt=-\frac1{2t}\cos(t^2)\Bigg|^{x+1}_x-\int^{x+1}_x\frac1 {2t^2}\cos(t^2)\le \frac1 {2t}\cos(t^2)\Bigg|^{x+1}_x+\int ^{x+1}_x\frac1 {2t^2}\cos(t^2)\le\frac1 {2(x+1)}+\frac1 {2x}-\frac1 {2(x+1)}+\frac1 {2x}$
so we get $\displaystyle\frac1 x$
Then
$\displaystyle 2x\cdot\frac1 x=\cos(x^2)-\cos(x+1)^2+r(x)$ with $\displaystyle|r(x)|\le \frac c x$, $\dfrac2 {\cos(x^2)-\cos(x+1)^2}=r(x)$ and after that I am stuck, how can I prove that $\cos(x^2)-\cos(x+1)^2$ is equal to $x$?
Thank you for the help!
For every $x \in \mathbb{R}$, set $r(x) = 2xf(x) + \cos((x+1)^2) - \cos(x^2)$. Then
$$r(x) = \int_x^{x+1} [2x\sin(t^2) - 2t\sin(t^2)]~dt.$$ If $x>0$, \begin{eqnarray*} r(x) &=& \int_x^{x+1} \frac{x-t}{t} \times 2t\sin(t^2)~dt \\ &=& \Big[ -\frac{x-t}{t} \times \cos(t^2) ~\Big]_{t=x}^{t=x+1} - \int_x^{x+1} \frac{x-t}{t} \times \cos(t^2)~dt\\ &=&\frac{1}{x+1}\cos((x+1)^2) - \int_x^{x+1} \frac{x-t}{t} \times \cos(t^2)~dt \end{eqnarray*} Thus \begin{eqnarray*} |r(x)| & \le & \frac{1}{x+1}|\cos((x+1)^2)| + \int_x^{x+1} \frac{x-t}{t} \times |\cos(t^2)|~dt \\ &\le & \frac{1}{x} + \int_x^{x+1} \frac{1}{x}~dt \\ &=& \frac{2}{x}. \end{eqnarray*}