Answer
$-2x \sin (x^2+1)\sin (x^2-1)+2x \cos (x^2-1)\cos (x^2+1)$
Work Step by Step
We have $f(x)=\sin (x^2+1)\cos (x^2-1)$
We differentiate both sides with respect to $x$.
$f'(x)= \dfrac{d}{dx}[\sin (x^2+1)\cos (x^2-1)]$
or, $f'(x)=\sin (x^2+1) \dfrac{d}{dx}[\cos (x^2-1)]+\cos (x^2-1)\dfrac{d}{dx}[\sin (x^2-1)]\\=\sin (x^2+1)[-\sin (x^2-1)]\times 2x +\cos (x^2-1)[\cos (x^2+1)] \times 2x\\=-2x \sin (x^2+1)\sin (x^2-1)+2x \cos (x^2-1)\cos (x^2+1)$