(cosx - sinx)^2=cos^2x-2cosx*sinx+sin^2x
cos^2x-2cosx*sinx+sin^2x-cos2x=1
cos2x=cos^2x-sin^2x
cos^2x-2cosx*sinx+sin^2x-(cos^2x-sin^2x)=1
cos^2x-2cosx*sinx+sin^2x-cos^2x+sin^2x=1
-2cosx*sinx+2sin^2x=1
2sin^2x-2cosx*sinx=1
sinx(2sinx-2cosx)=1
sinx=1
x=π/2+2πk
sinx*cosx=1/2
2sinxcosx= 1
sin2x=1
2x=π/2+2πk
x=π/4+πk