Using integration by parts: split xcos(x) into x multiplied by cos(x). Differentiating x gives 1 and integrating cos(x) gives sin(x). The integral of xcos(x) can therefore be rewritten as xsin(x) - integral of 1*sin(x) using the formula for integration by parts. The integral of sin(x) is -cos(x), so the integral of xcos(x) becomes xsin(x) -(-cos(x)) which simplifies to xsin(x)+cos(x)+C where C is an arbitrary constant of integration.