We have,
cosθ+sinθ=cos2θ+sin2θ
⇒cosθ−cos2θ=sin2θ−sinθ
⇒2sinθ+2θ2sin2θ−θ2=2cos2θ+θ2sin2θ−θ2
⇒sin3θ2=cos3θ2
⇒sin3θ2cos3θ2=1
⇒tan3θ2=1
⇒tan3θ2=tanπ4
⇒3θ2=nπ+π4
⇒3θ=2nπ+π2
⇒θ=23nπ+π6
Hence, this is the answer.