This question is to be done by integration by parts because it has "two types" of integrals. To perform integration by parts, we need to first split the function into its two parts, producing x and sin(x). Following the equation of integration by parts, we need to differentiate one half of the function and integrate the other half. When choosing, always differentiate the side that will not have an x term in the answer. sin(x) differentiates into cos(x), so that's not what we want. X on the other hand differentiates into one. Therefore, we want to differentiate x and integrate sin(x).
Following the rule of integration by parts, we have: x*-cos(x)-integral(1*sin(x)) =-xcos(x)-integral(sin(x)) =-xcos(x)-(-cos(x)) =-xcos(x)+cos(x)