Derivative is to be found out by using the first principle. What I did was that after applying the first principle, I applied the trigonometric identity $$ \cos A-\cos B = -2\sin(( A+B)/2) \sin((A-B)/2), $$ then divided and multiplied the whole by $(A+B)/2$ and $(A-B)/2$. Since $\sin x/x$ is $1$, I got the answer as $x^3 + x$. But the correct answer was $-2x\sin(x^2 + 1)$. So please tell what mistake I made.
$2nd$ picture's first step is not being cut in that step ">