If sinx+cosx=t then on squaring
1+sin2x=t2
∴t=(t2−1)−1 or t2−t−2=0
or (t−2)(t+1)=0 ∴t=2,−1
cosx+sinx=2 or −1
or 1√2cosx+1√2sinx=√2 or −1√2
or cos(x−π4)=√2 or −cosπ4
The first option is rejected as √2>1
∴cos(x−π4)=cos(π−π4)=cos3π4
∴x−π4=2nπ±3π4
∴x=2nπ+π or 2nπ−π2.