Firstly, xcos(x) is a product of two functions of x. Therefore we can use the product rule to work out the derivative of the whole function. Differentiating each part makes it easier to visualize the formula. Splitting xcos(x) into u and v:u = xv = cos(x)du/dx = 1dv/dx = -sin(x) Now to apply the product rule - udv/dx + vdu/dx = cos(x) - x*sin(x)