From the double angle formula for cosine, we know that cos(2x)=cos2(x)-sin2(x). Also, we know that sin2(x)+cos2(x)=1. So by substituting the second formula into the first, we can say that cos(2x)=(1-sin2(x))-sin2(x)=1-2sin2(x)
By rearranging, this gives sin2(x)=1/2-1/2cos(2x). Now, the right hand side of this equation can be more easily integrated with regards to x.
The integral of cos(ax) is (1/a)sin(ax). So, the indefinite integral of the RHS (and hence sin2(x)) is (1/2)x-1/4sin(2x)+C for some arbitrary constant, C.