In the 4th line, there’s a denominator of 4 in the first term. It seems to have disappeared in the next line. Also, it looks like $-4\cos^2(2x)$ accidentally became $-\color{red}{2}\cos^2(2x)$ between lines 7 and 8. I didn't look beyond that.
– Steve KassApr 20 '14 at 20:36