Simplifying the LHS of (cosA+cosB)2+(sinA+sinB)2=4cos2A−B2.
(cosA+cosB)2+(sinA+sinB)2=cos2A+cos2B+2cosAcosB+sin2A+sin2B+2sinAsinB
=cos2A+sin2A+cos2B+sin2B+2cosAcosB+2sinAsinB
=1+1+2(cosAcosB+sinAsinB)
=2+2cos(A−B)
=2(1+cos(A−B))
=2(2cos2A−B2)
=4cos2A−B2
=RHS