I can't remember exactly the forumla to calculate the enrergy of a periodic signal nor can i find it on the web, but if it is simply the integral of your signal from neg. inf. to inf., then your energy will be infinite. Since your signal is a sinusoid squared, when you integrate something that's all-positive and periodic from neg. inf. to inf., you get infinity as your answer. As for the math, use the double-angle formula (cos^2(x) = 1/2 + cos(2x)/2 ) to simplify that integral; you shouldn't have a problem from there.