1-2(sin(x))^2 is identical to cos(2x), so if x=(pi)/8, 2x=(pi)/4 and cos((pi)/4) (cosine and sine of 45 degrees)=1/sqrt(2), which can be written sqrt(2)/2 (because 1/sqrt(2)=sqrt(2)/(sqrt(2))^2), multiplying top and bottom of the fraction by sqrt(2)). (An isosceles right-angled triangle has two angles of 45 degrees. The hypotenuse is sqrt(2) times the length of the other two equal sides, by Pythagoras, so the sine and cosine of 45 degrees equals 1/sqrt(2).)