Since this is a sum of terms, we can differentiate each term separately:

The derivative of -xcosx uses the product rule: (uv)' = uv' + u'v

-x(cosx)' + (-x)'cosx = xsinx - cosx

The derivative of sinx is straightforward: (sinx)' = cosx

The derivative of C is the derivative of a constant: (C)' = 0

So

(-xcosx + sinx + C)' = xsinx - cosx + cosx + 0 = xsinx