You would first of all establish which differentiation rule is required, for this question it would be useful to use the product rule splitting xcos(x) into x multiplied by cos(x). We can label u = x and v = cos(x). Then differentiate u with respect to x to obtain, du/dx = 1. and differentiate v with respect to x to obtain dv/dx = -sin(x). Now using the product rule: dy/dx = v(du/dx) + u(dv/dx), we can plug in our previously calculated values u,v,(du/dx),(dv/dx) to obtain the answer: dy/dx = cos(x)(1) + x(-sin(x)) = cos(x) -xsin(x).