Note:
1)
cos(pi/2 - a) = sin a ; sin(pi/2 + a) = cos (a) ; sin2a = 2*sin(a) * cos (a)
2)
sin (a + pi/4) = (1/2)*radice 2 * ( sin a + cos a)
Quindi:
= (1/2)*(sin a + cos a)² - sin(2a) + (1/2)*sin(2a) =
= (1/2)*[1 + sin(2a)] - sin(2a) + (1/2)*sin(2a) = (1/2)