We have,
sinα−sinβ=a and cosα+cosβ=b
Now, a2+b2=(sinα−sinβ)2+(cosα+cosβ)2
=sin2α+sin2β−2sinαsinβ+cos2αcos2β+2cosαcosβ
=(sin2α+cos2α)+(sin2β+cos2β)+2[cosαcosβ−sinαsinβ]
=1+1+2cos(α+β)
=2+2cos(α+β)
⇒a2+b2=2+2cos(α+β)
⇒a2+b2−2=2cos(α+β)
⇒2cos(α+β)=a2+b2−2
⇒cos(α+β)=a2+b2−22