This can be a very tricky question if you do not know how to approach it. Our first instinct may be to try a substitution, but this gets us nowhere. In fact, the trick is to make use of the identity cos2x = 2cos^2x - 1. This can then be rearranged to give us (cos2x + 1)/2 = cos^2x. Using this identity, our integration problem has suddenly become a lot easier - we can take the constant 1/2 outside of the integral leaving us to integrate the expression cos2x + 1. Integrating cos2x is simply a matter of reversing the chain rule, so the result of this integration is (sin2x)/2 + x. Finally, we multiply this by 1/2 (the constant we took outside the integral before) to give us a final result of (sin2x)/4 + x/2. Of course, don't forget the +C assuming this is an indefinite integral.Note that the same identity can help us integrate sin^2x as well. This is because we can rewrite the identity as cos2x = 2cos^2x - 1 = 1 - 2in^2x.