It is impossible to dirctly integrate sin^2(x) so we must transform it into something that can be integrated. Trigonometry can be used to do this. Recall the identity cos(2x) = cos^2(x) - sin^2(x) and cos^(x) + sin^2(x) = 1. These 2 indentities can be combined through a little bit of algebra to give; sin^2(x) = 0.5 - 0.5cos(2x). Now this is an expression which can be directly integrated!
The integral of 0.5 - 0.5cos(2x) is simply 0.5x -0.25sin(2x)