If we distribute the square:
(sinx+cosx)²
sin²x+2sinxcosx+cos²x
Since there is a formula that sin²x+cos²x=1, then substitute:
2sinxcosx+1
Since there is also a formula that 2sinxcosx=sin2x, then substitute again.
sin2x+1
That is the answer. Hope this helps =)