The trick here is to rewrite cos^2x as (1+cos(2x))/2 -- which is a trig identity.

So we have

int(1-cos^2x) dx = int(1 - (1+cos(2x))/2) dx

= int(1) dx - (1/2)int(1+cos(2x)) dx

= x - (1/2)(x + (1/2)sin(2x)) + C

= x - x/2 -(1/4)sin(2x) + C

= x/2 - (1/2)sin(x)cos(x) + C

= (1/2)(x - sin(x)cos(x)) + C

The second to last step was also a trig identity. sin(2x)=2sin(x)cos(x). So (1/4)sin(2x) = (1/4)(2sin(x)cos(x))=(1/2)sin(x)cos(x)

Then I factored the (1/2) to make the answer look a bit neater.