Answer
The Derivative is:
$y'=-x^2\sin x$
Work Step by Step
$y=x^2\cos x- 2x\sin x -2\cos x$
Applying Derivative rules:
$y'=f'(x)+g'(x)$ and $h'(x)=v'(x)\cdot u(x)+v(x)\cdot u'(x)$
$y'=((2)x^{2-1}(\cos x)+x^2(-\sin x))-2(x^{1-1}(\sin x)+x(\cos x))-2(-\sin x)$
$y'=x\cos x-x^2\sin x-2\sin x-x\cos x+2\sin x$
$y'=-x^2\sin x$