Just looking at the expression
(sin^2(2x)+cos^2(2x)(x^2 - 2cospie + 2/x^2)
There are 4 left-hand brackets and only three right-hand brackets.
There should be the same number of each.
Could you check if you have a right-hand bracket missing, or do you have an extra left-hand bracket that shouldn't be there.