This is done using the product rule: dy/dx=udv/dx +vdu/dxset y=uv therefore u=x^2 v=cos(x)differentiate these with respect to x du/dx= 2x as you multiply by the power and then subtract the power by 1dv/dx= -sin(x) these are one the derivatives that have to be learnt for the examplug these values into the product rule to get the following:dy/dx= (x^2)(-sin(x)) + (cos(x))(2x)rewritten to dy/dx= 2xcos(x) - x^2sin(x)can be further simplified by factorising and taking out the x to get the final answer: dy/dx = x(2cos(x) - xsin(x))