cos‌x+cos‌y‌=p‌‌‌⋅⋅⋅⋅⋅⋅⋅(i) sin‌x+sin‌y‌=q‌‌‌⋅⋅⋅⋅⋅⋅⋅(ii) On adding Eqs. (i) and (ii) after doing square ‌(cos2x+cos2y+2‌cos‌x⋅cos‌y) ‌+(sin‌2x+sin‌2y+2sin‌x⋅sin‌y)=p2+q2 ⇒2+2‌cos(x−y)=p2+q2 ⇒2[1+cos(x−y)]=p2+q2 ⇒2⋅2cos2(‌