In addition to Gio's method, there is another way of doing this integral, using trig identities. (If you don't like trig or math in general, I wouldn't blame you for disregarding this answer - but sometimes the use of trig is unavoidable in problems).
The identity we will be using is: sin^2x=1/2(1-cos2x)sin2x=12(1−cos2x).
We can therefore rewrite the integral like so:
int1/2(1-cos2x)dx∫12(1−cos2x)dx
=1/2int1-cos2x=12∫1−cos2x
Using the sum rule we get:
1/2(int1dx-intcos2xdx)12(∫1dx−∫cos2xdx)
The first integral simply evaluates to xx. The second integral is a little more challenging. We know that the integral of cosxcosx is sinxsinx (because d/dxsinx=cosxddxsinx=cosx), but what about cos2xcos2x? We'll need to adjust for the chain rule by multiplying by 1/212, so as to balance the 2x2x:
d/dx1/2sin2x=2*1/2cos2x=cos2xddx12sin2x=2⋅12cos2x=cos2x
So intcos2xdx=1/2sin2x+C∫cos2xdx=12sin2x+C (don't forget the integration constant!) Using that info, plus the fact that int1dx=x+C∫1dx=x+C, we have:
1/2(color(red)(int1dx)-color(blue)(intcos2xdx))=1/2(color(red)(x)-color(blue)(1/2sin2x))+C12(∫1dx−∫cos2xdx)=12(x−12sin2x)+C
Use the identity sin2x=2sinxcosxsin2x=2sinxcosx, we find:
1/2(x-1/2sin2x)+C=1/2(x-1/2(2sinxcosx))+C12(x−12sin2x)+C=12(x−12(2sinxcosx))+C
=1/2(x-sinxcosx)+C=12(x−sinxcosx)+C
And that is the answer Gio found using the integration by parts method.