To differentiate xcos(2x), you first have to use the product rule, because this function is two functions (x and cos(2x) multiplied togetherNow you have x*(cos(2x))'+cos(2x)To differentiate cos(2x) you have to use the chain rule, in this case its -2sin(2x)Therefore xcos(2x)'=cos(2x)-2xsin(2x)To integrate xcos(2x) we must use integration by partsTo recall= Integral(u(x)v'(x)dx)=u(x)v(x)-integral(u'(x)v(x)dx)so we choose u=x u'=1 and v'=cos(2x) v=0.5sin(2x)so the integral is now written as 0.5xsin(2x)-integral(0.5sin(2x))dx=0.5xsin(2x)-0.25cos(2x)+C