Right so using the product rule for 3 expression, I wound up with
$\left(\cos x\right)\left(\sin x\right) – x\sin ^2 x + x\cos ^2 x$.
My main issue is cleaning this up to get the derivative to equal
$\frac{1}{2}\sin 2x + x\cos 2x$.
I am not quite sure where the change from x to 2x came from. I know it's probably some old trig rules that I have forgotten. So if anyone could help with the simplification that would be great! Thanks!
Best Answer
Arguably easiest way would be to use the $\sin 2x = 2 \sin x \cos x$ identity before taking derivatives:
$$ (x\,\sin x\,\cos x)' = \frac{1}{2}(x\,\sin 2x)' = \frac{1}{2}\big((x)'\,\sin 2x + x\,(\sin 2x)'\big)= \frac{1}{2}\,\sin 2x + x\,\cos 2x $$